Skip to content

Commit

Permalink
Merge pull request #139 from airbnb/2.0
Browse files Browse the repository at this point in the history
Epoxy 2.0
  • Loading branch information
elihart authored Apr 10, 2017
2 parents 6d468f0 + 27c8ec1 commit bc9499c
Show file tree
Hide file tree
Showing 204 changed files with 13,426 additions and 2,526 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android:
components:
- tools
- platform-tools
- build-tools-25.0.0
- android-24
- build-tools-25.0.2
- android-25
- extra-google-google_play_services
- extra-android-m2repository
- extra-android-support
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 2.0.0 (March 25, 2017)

* **New**: The `EpoxyController` class helps you manage even models better. This should be used instead of the original `EpoxyAdapter` in most places. Read more about `EpoxyController` in [the wiki](https://github.com/airbnb/epoxy/wiki/Epoxy-Controller).
* **Change**: In the new EpoxyController, the diffing algorithm uses both `equals` and `hashCode` on each model to check for changes. This is a change from the EpoxyAdapter where only `hashCode` was used. Generated models have both hashCode and equals implemented properly already, but if you have any custom hashCode implementations in your models make sure you have equals implemented as well.
* **New**: Models that have a `View.OnClickListener` as an EpoxyAttribute will now have an overloaded setter on the generated model that allows you to set a click listener that will return the model, view, and adapter position. **Upgrade Note** If you were setting a click listener value to null anywhere you will need to now cast that to `View.OnClickListener` because of the new overloaded method.
* **New**: Attach an onBind/onUnbind listener directly to a model instead of overriding the onModelBound method. Generated models will have methods created to set this listener and handle the callback for you.
* **New**: Support for creating models in Kotlin (Thanks to @geralt-encore! https://github.com/airbnb/epoxy/pull/144)
* **New**: `EpoxyModelWithView` supports creating a View programmatically instead of inflating from XML.
* **New**: `EpoxyModelGroup` supports grouping models together in arbitrary formations.
* **New**: Instead of setting attribute options like `@EpoxyAttribute(hash = false)` you should now do `@EpoxyAttribute(DoNotHash)`. You can also set other options like that.
* **New**: Annotation processor options can now be set via gradle instead of with `PackageEpoxyConfig`
* **New**: In an EpoxyController, if a model with the same id changes state Epoxy will include its previous state as a payload in the change notification. The new model will have its `bind(view, previouslyBoundModel)` method called so it can compare what changed since the previous model, and so it can update the view with only the data that changed.

# 1.7.5 (Feb 21, 2017)

* **New**: Models inherit layouts specified in superclass `@EpoxyModelClass` annotations [#119](https://github.com/airbnb/epoxy/pull/119)
Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Epoxy is an Open Source Project

Pull requests are welcome! We'd love help improving this library.

We have a code style setting for the project. Please run `Reformat Code` in Android Studio (or Intellij) on changed files before pushing them.

Also, run `./gradlew check` locally to make sure that style checks and tests pass.

If you update the model annotation processor you may find the `update_processor_test_resources.rb` script very useful for updating the existing tests with your changes.
469 changes: 11 additions & 458 deletions README.md

Large diffs are not rendered by default.

48 changes: 25 additions & 23 deletions blessedDeps.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,38 @@
rootProject.ext.JAVA_SOURCE_VERSION = JavaVersion.VERSION_1_7
rootProject.ext.JAVA_TARGET_VERSION = JavaVersion.VERSION_1_7

rootProject.ext.TARGET_SDK_VERSION = 24
rootProject.ext.COMPILE_SDK_VERSION = 24
rootProject.ext.TARGET_SDK_VERSION = 25
rootProject.ext.COMPILE_SDK_VERSION = 25
rootProject.ext.MIN_SDK_VERSION = 16

rootProject.ext.ANDROID_BUILD_TOOLS_VERSION = "25.0.0"
rootProject.ext.ANDROID_SUPPORT_LIBS_VERSION = "25.0.1"
rootProject.ext.BUTTERKNIFE_VERSION = "8.4.0"
rootProject.ext.BUTTERKNIFE_COMPILER_VERSION = "8.4.0"
rootProject.ext.ANDROID_BUILD_TOOLS_VERSION = "25.0.2"
rootProject.ext.ANDROID_SUPPORT_LIBS_VERSION = "25.3.0"
rootProject.ext.BUTTERKNIFE_VERSION = "8.5.1"
rootProject.ext.GOOGLE_AUTO_SERVICE_VERSION = "1.0-rc2"
rootProject.ext.SQUARE_JAVAPOET_VERSION = "1.8.0"

rootProject.ext.ASSERTJ_VERSION = "1.7.1"
rootProject.ext.GOOGLE_TESTING_COMPILE_VERSION = "0.10"
rootProject.ext.JUNIT_VERSION = "4.12"
rootProject.ext.MOCKITO_VERSION = "2.2.11"
rootProject.ext.ROBOLECTRIC_VERSION = "3.1.4"
rootProject.ext.MOCKITO_VERSION = "2.7.7"
rootProject.ext.ROBOLECTRIC_VERSION = "3.3.1"

rootProject.ext.LOTTIE_VERSION = "2.0.0-beta3"

rootProject.ext.deps = [
androidSupportLibrary : "com.android.support:appcompat-v7:$ANDROID_SUPPORT_LIBS_VERSION",
androidCardView : "com.android.support:cardview-v7:$ANDROID_SUPPORT_LIBS_VERSION",
androidDesignLibrary : "com.android.support:design:$ANDROID_SUPPORT_LIBS_VERSION",
androidRecyclerView : "com.android.support:recyclerview-v7:$ANDROID_SUPPORT_LIBS_VERSION",
androidAnnotations : "com.android.support:support-annotations:$ANDROID_SUPPORT_LIBS_VERSION",
butterknifeLibrary : "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION",
butterknifeCompiler : "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_COMPILER_VERSION",
googleAutoService : "com.google.auto.service:auto-service:$GOOGLE_AUTO_SERVICE_VERSION",
squareJavaPoet : "com.squareup:javapoet:$SQUARE_JAVAPOET_VERSION",
assertj : "org.assertj:assertj-core:$ASSERTJ_VERSION",
googleTestingCompile : "com.google.testing.compile:compile-testing:$GOOGLE_TESTING_COMPILE_VERSION",
junit : "junit:junit:$JUNIT_VERSION",
mockito : "org.mockito:mockito-core:$MOCKITO_VERSION",
robolectric : "org.robolectric:robolectric:$ROBOLECTRIC_VERSION"
]
androidSupportLibrary: "com.android.support:appcompat-v7:$ANDROID_SUPPORT_LIBS_VERSION",
androidCardView : "com.android.support:cardview-v7:$ANDROID_SUPPORT_LIBS_VERSION",
androidDesignLibrary : "com.android.support:design:$ANDROID_SUPPORT_LIBS_VERSION",
androidRecyclerView : "com.android.support:recyclerview-v7:$ANDROID_SUPPORT_LIBS_VERSION",
androidAnnotations : "com.android.support:support-annotations:$ANDROID_SUPPORT_LIBS_VERSION",
butterknifeLibrary : "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION",
butterknifeCompiler : "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION",
googleAutoService : "com.google.auto.service:auto-service:$GOOGLE_AUTO_SERVICE_VERSION",
squareJavaPoet : "com.squareup:javapoet:$SQUARE_JAVAPOET_VERSION",
assertj : "org.assertj:assertj-core:$ASSERTJ_VERSION",
googleTestingCompile : "com.google.testing.compile:compile-testing:$GOOGLE_TESTING_COMPILE_VERSION",
junit : "junit:junit:$JUNIT_VERSION",
mockito : "org.mockito:mockito-core:$MOCKITO_VERSION",
robolectric : "org.robolectric:robolectric:$ROBOLECTRIC_VERSION",
lottie : "com.airbnb.android:lottie:$LOTTIE_VERSION"
]
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
}
}
Expand Down Expand Up @@ -63,6 +63,6 @@ def getRepositoryPassword() {
}

task wrapper(type: Wrapper) {
gradleVersion = '2.14.1'
gradleVersion = '3.3'
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
}
Loading

0 comments on commit bc9499c

Please sign in to comment.