Skip to content

Commit a72b587

Browse files
author
TUBB
committed
Add: test code for swipe disable feature
1 parent 9aa005e commit a72b587

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/src/main/java/com/tubb/smrv/demo/rv/SimpleRvActivity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ public void onClick(View v) {
8484
myViewHolder.tvSwipeEnable.setText(swipeEnable ? "swipe on" : "swipe off");
8585
myViewHolder.sml.setSwipeEnable(swipeEnable);
8686
}
87+
88+
@Override
89+
public int getItemViewType(int position) {
90+
return position % 2 == 0 ? VIEW_TYPE_ENABLE : VIEW_TYPE_DISABLE;
91+
}
8792
}
8893

8994
public static class SimpleRvViewHolder extends RecyclerView.ViewHolder{

0 commit comments

Comments
 (0)