Skip to content

Commit

Permalink
Merge pull request #924 from AllenCoder/master
Browse files Browse the repository at this point in the history
fix #919
  • Loading branch information
CymChad authored Mar 27, 2017
2 parents 9dd7033 + ad7a425 commit a2ffde5
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ public BaseViewHolder setOnClickListener(int viewId, View.OnClickListener listen
public BaseViewHolder addOnClickListener(final int viewId) {
childClickViewIds.add(viewId);
final View view = getView(viewId);
if (!view.isClickable()) {
view.setClickable(true);
}
if (view != null) {
if (!view.isClickable()) {
view.setClickable(true);
}
view.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Expand Down Expand Up @@ -395,10 +395,10 @@ public BaseViewHolder setNestView(int viewId) {
public BaseViewHolder addOnLongClickListener(final int viewId) {
itemChildLongClickViewIds.add(viewId);
final View view = getView(viewId);
if (!view.isLongClickable()) {
view.setLongClickable(true);
}
if (view != null) {
if (!view.isLongClickable()) {
view.setLongClickable(true);
}
view.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
Expand All @@ -409,7 +409,6 @@ public boolean onLongClick(View v) {
}
});
}

return this;
}

Expand Down

0 comments on commit a2ffde5

Please sign in to comment.