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

The following examples show how to use androidx.recyclerview.widget.RecyclerView#getTag() . 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: FeatureOverviewActivity.java    From mapbox-plugins-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
static ItemClickSupport addTo(RecyclerView view) {
  ItemClickSupport support = (ItemClickSupport) view.getTag(R.id.item_click_support);
  if (support == null) {
    support = new ItemClickSupport(view);
  }
  return support;
}
 
Example 2
Source File: ItemClickSupport.java    From MusicBobber with MIT License 5 votes vote down vote up
public static ItemClickSupport from(RecyclerView recyclerView) {
    if (recyclerView == null) {
        return null;
    }

    return (ItemClickSupport) recyclerView.getTag(R.id.twowayview_item_click_support);
}
 
Example 3
Source File: RvItemClickSupport.java    From Aria with Apache License 2.0 5 votes vote down vote up
public static RvItemClickSupport addTo(RecyclerView view) {
  RvItemClickSupport support = (RvItemClickSupport) view.getTag(R.id.item_click_support);
  if (support == null) {
    support = new RvItemClickSupport(view);
  }
  return support;
}
 
Example 4
Source File: RvItemClickSupport.java    From Aria with Apache License 2.0 5 votes vote down vote up
public static RvItemClickSupport removeFrom(RecyclerView view) {
  RvItemClickSupport support = (RvItemClickSupport) view.getTag(R.id.item_click_support);
  if (support != null) {
    support.detach(view);
  }
  return support;
}
 
Example 5
Source File: EpoxyModelTouchCallback.java    From epoxy with Apache License 2.0 4 votes vote down vote up
private boolean recyclerViewHasSelection(RecyclerView recyclerView) {
  return recyclerView.getTag(R.id.epoxy_touch_helper_selection_status) != null;
}
 
Example 6
Source File: EpoxyVisibilityTracker.java    From epoxy with Apache License 2.0 4 votes vote down vote up
/**
 * @param recyclerView the view.
 * @return the tracker for the given {@link RecyclerView}. Null if no tracker was attached.
 */
@Nullable
private static EpoxyVisibilityTracker getTracker(@NonNull RecyclerView recyclerView) {
  return (EpoxyVisibilityTracker) recyclerView.getTag(TAG_ID);
}