Skip to content

Commit

Permalink
Moved handleClick() into a method that can be overridden. For #8
Browse files Browse the repository at this point in the history
  • Loading branch information
grennis committed Mar 3, 2016
1 parent 2487da6 commit d6388dc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Then add this to your build.gradle dependencies for the project where you want t

dependencies {
...
compile 'com.github.grennis:ExpandableRecyclerView:0.9.2'
compile 'com.github.grennis:ExpandableRecyclerView:0.9.3'
}

# Usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,19 @@ public HeaderViewHolder(View view, final ImageView arrow) {
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (toggleExpandedItems(getLayoutPosition(), false)) {
openArrow(arrow);
} else {
closeArrow(arrow);
}
handleClick();
}
});
}

protected void handleClick() {
if (toggleExpandedItems(getLayoutPosition(), false)) {
openArrow(arrow);
} else {
closeArrow(arrow);
}
}

public void bind(int position) {
arrow.setRotation(isExpanded(position) ? 90 : 0);
}
Expand Down

0 comments on commit d6388dc

Please sign in to comment.