Skip to content

Commit

Permalink
Prepare for 2.13.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
elihart committed Jun 19, 2018
1 parent 4cbc32a commit a0f9e37
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
```

Expand Down
20 changes: 9 additions & 11 deletions epoxy-adapter/src/main/java/com/airbnb/epoxy/EpoxyModelGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<? extends EpoxyModel<?>> 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<View> views;
private List<EpoxyHolder> holders;
private ViewGroup rootView;

public Holder(@NonNull EpoxyModelGroup modelGroup) {
this.modelGroup = modelGroup;
this.models = modelGroup.models;
public Holder(@NonNull EpoxyModelGroup initializingModelGroup) {
this.initializingModelGroup = initializingModelGroup;
}

/**
Expand All @@ -336,7 +335,9 @@ protected void bindView(View itemView) {
rootView = (ViewGroup) itemView;
ViewGroup childContainer = findChildContainer(rootView);

List<? extends EpoxyModel<?>> models = initializingModelGroup.models;
int modelCount = models.size();

views = new ArrayList<>(modelCount);
holders = new ArrayList<>(modelCount);

Expand All @@ -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);
}
Expand All @@ -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;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a0f9e37

Please sign in to comment.