From a0f9e3787ae15cb8173aab64b220024db7028023 Mon Sep 17 00:00:00 2001 From: Eli Hart Date: Tue, 19 Jun 2018 15:09:19 -0500 Subject: [PATCH] Prepare for 2.13.0 release --- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- .../com/airbnb/epoxy/EpoxyModelGroup.java | 20 +++++++++---------- gradle.properties | 2 +- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c45bf06283..ee914cfc08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.13.0 (June 19, 2018) +- **Fix** Reduce memory usage in model groups and differ (#433) +- **Fix** Support for wildcards in private epoxy attributes (#451) +- **Fix** Generated Kotlin Extensions Don't Adhere to Constructor Nullability (#449) +- **Fix** Infinite loop in annotation processor (#447) + # 2.12.0 (April 18, 2018) - **Breaking** Several updates to the Paging Library integration were made (https://github.com/airbnb/epoxy/pull/421) diff --git a/README.md b/README.md index 2443abf697..c7da2ed441 100755 --- a/README.md +++ b/README.md @@ -19,9 +19,9 @@ Gradle is the only supported build configuration, so just add the dependency to ```groovy dependencies { - compile 'com.airbnb.android:epoxy:2.12.0' + compile 'com.airbnb.android:epoxy:2.13.0' // Add the annotation processor if you are using Epoxy's annotations (recommended) - annotationProcessor 'com.airbnb.android:epoxy-processor:2.12.0' + annotationProcessor 'com.airbnb.android:epoxy-processor:2.13.0' } ``` diff --git a/epoxy-adapter/src/main/java/com/airbnb/epoxy/EpoxyModelGroup.java b/epoxy-adapter/src/main/java/com/airbnb/epoxy/EpoxyModelGroup.java index 1d77079633..07046b027b 100644 --- a/epoxy-adapter/src/main/java/com/airbnb/epoxy/EpoxyModelGroup.java +++ b/epoxy-adapter/src/main/java/com/airbnb/epoxy/EpoxyModelGroup.java @@ -305,16 +305,15 @@ protected final Holder createNewHolder() { } public static class Holder extends EpoxyHolder { - // Hold it for `bindView`, clear it after `bindView` be called - private EpoxyModelGroup modelGroup; - private List> models; + // We use the model group that was used to create the view holder for initializing the view. + // We release the reference after the viewholder is initialized. + private EpoxyModelGroup initializingModelGroup; private List views; private List holders; private ViewGroup rootView; - public Holder(@NonNull EpoxyModelGroup modelGroup) { - this.modelGroup = modelGroup; - this.models = modelGroup.models; + public Holder(@NonNull EpoxyModelGroup initializingModelGroup) { + this.initializingModelGroup = initializingModelGroup; } /** @@ -336,7 +335,9 @@ protected void bindView(View itemView) { rootView = (ViewGroup) itemView; ViewGroup childContainer = findChildContainer(rootView); + List> models = initializingModelGroup.models; int modelCount = models.size(); + views = new ArrayList<>(modelCount); holders = new ArrayList<>(modelCount); @@ -346,7 +347,7 @@ protected void bindView(View itemView) { View view; if (useViewStubs) { view = replaceNextViewStub(childContainer, model, - modelGroup.useViewStubLayoutParams(model, i)); + initializingModelGroup.useViewStubLayoutParams(model, i)); } else { view = createAndAddView(childContainer, model); } @@ -362,10 +363,7 @@ protected void bindView(View itemView) { views.add(view); } - // Clear the reference, because of `EpoxyController.buildModels` - // will build new modelGroup instance during every call. - modelGroup = null; - models = null; + initializingModelGroup = null; } /** diff --git a/gradle.properties b/gradle.properties index 21cb2396a2..e5fd5945d3 100755 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=2.12.0 +VERSION_NAME=2.13.0 GROUP=com.airbnb.android POM_DESCRIPTION=Epoxy is a system for composing complex screens with a ReyclerView in Android. POM_URL=https://github.com/airbnb/epoxy