Java Code Examples for androidx.recyclerview.widget.RecyclerView#setTag()

The following examples show how to use androidx.recyclerview.widget.RecyclerView#setTag() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ItemClickSupport.java    From MusicBobber with MIT License 5 votes vote down vote up
public static ItemClickSupport addTo(RecyclerView recyclerView) {
    ItemClickSupport itemClickSupport = from(recyclerView);
    if (itemClickSupport == null) {
        itemClickSupport = new ItemClickSupport(recyclerView);
        recyclerView.setTag(R.id.twowayview_item_click_support, itemClickSupport);
    }

    return itemClickSupport;
}
 
Example 2
Source File: ItemClickSupport.java    From MusicBobber with MIT License 5 votes vote down vote up
public static void removeFrom(RecyclerView recyclerView) {
    final ItemClickSupport itemClickSupport = from(recyclerView);
    if (itemClickSupport == null) {
        return;
    }

    recyclerView.removeOnItemTouchListener(itemClickSupport.mTouchListener);
    recyclerView.setTag(R.id.twowayview_item_click_support, null);
}
 
Example 3
Source File: EpoxyModelTouchCallback.java    From epoxy with Apache License 2.0 4 votes vote down vote up
private void markRecyclerViewHasSelection(RecyclerView recyclerView) {
  recyclerView.setTag(R.id.epoxy_touch_helper_selection_status, Boolean.TRUE);
}
 
Example 4
Source File: EpoxyModelTouchCallback.java    From epoxy with Apache License 2.0 4 votes vote down vote up
private void clearRecyclerViewSelectionMarker(RecyclerView recyclerView) {
  recyclerView.setTag(R.id.epoxy_touch_helper_selection_status, null);
}
 
Example 5
Source File: EpoxyVisibilityTracker.java    From epoxy with Apache License 2.0 4 votes vote down vote up
/**
 * Store the tracker for the given {@link RecyclerView}.
 * @param recyclerView the view
 * @param tracker the tracker
 */
private static void setTracker(
    @NonNull RecyclerView recyclerView,
    @Nullable EpoxyVisibilityTracker tracker) {
  recyclerView.setTag(TAG_ID, tracker);
}
 
Example 6
Source File: RvItemClickSupport.java    From Aria with Apache License 2.0 4 votes vote down vote up
private void detach(RecyclerView view) {
  view.removeOnChildAttachStateChangeListener(mAttachListener);
  view.setTag(R.id.item_click_support, null);
}