Skip to content

Commit

Permalink
bug fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Vivchar Vitaly committed Sep 21, 2017
1 parent b91518d commit d57f32d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ org.gradle.jvmargs=-Xmx1536m
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
VERSION_NAME=1.2.2
VERSION_CODE=14
VERSION_NAME=1.2.3
VERSION_CODE=15
GROUP=com.github.vivchar

POM_DESCRIPTION=A single adapter with multiple view types for the whole project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public abstract class CompositeViewRenderer <M extends CompositeItemModel, VH ex
{
@NonNull
private final ArrayList<ViewRenderer> mRenderers = new ArrayList<>();
@Nullable
private RendererRecyclerViewAdapter mAdapter;

public CompositeViewRenderer(final int viewType, @NonNull final Context context) {
Expand All @@ -41,6 +40,8 @@ public void bindView(@NonNull final M model, @NonNull final VH holder) {
@NonNull
@Override
public VH createViewHolder(@Nullable final ViewGroup parent) {
mAdapter = createAdapter();

for (final ViewRenderer renderer : mRenderers) {
getAdapter().registerRenderer(renderer);
}
Expand All @@ -63,11 +64,7 @@ public CompositeViewRenderer registerRenderer(@NonNull final ViewRenderer render
return this;
}

@NonNull
protected RendererRecyclerViewAdapter getAdapter() {
if (mAdapter == null) {
mAdapter = createAdapter();
}
return mAdapter;
}

Expand Down

0 comments on commit d57f32d

Please sign in to comment.