public enum

ConcatAdapter.Config.StableIdMode

extends java.lang.Enum<ConcatAdapter.Config.StableIdMode>

 java.lang.Object

↳java.lang.Enum<ConcatAdapter.Config.StableIdMode>

↳androidx.recyclerview.widget.ConcatAdapter.Config.StableIdMode

Overview

Defines how ConcatAdapter handle stable ids (RecyclerView.Adapter.hasStableIds()).

Summary

Enum Constants
ISOLATED_STABLE_IDSIn this mode, ConcatAdapter will return true from RecyclerView.Adapter.hasStableIds() and will require all added RecyclerView.Adapters to have stable ids.
NO_STABLE_IDSIn this mode, ConcatAdapter ignores the stable ids reported by sub adapters.
SHARED_STABLE_IDSIn this mode, ConcatAdapter will return true from RecyclerView.Adapter.hasStableIds() and will require all added RecyclerView.Adapters to have stable ids.
Methods
public static ConcatAdapter.Config.StableIdModevalueOf(java.lang.String name)

public static ConcatAdapter.Config.StableIdModevalues()

from java.lang.Enum<E>clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
from java.lang.ObjectgetClass, notify, notifyAll, wait, wait, wait

Enum Constants

NO_STABLE_IDS

In this mode, ConcatAdapter ignores the stable ids reported by sub adapters. This is the default mode. Adding an RecyclerView.Adapter with stable ids will result in a warning as it will be ignored.

ISOLATED_STABLE_IDS

In this mode, ConcatAdapter will return true from RecyclerView.Adapter.hasStableIds() and will require all added RecyclerView.Adapters to have stable ids. As two different adapters may return same stable ids because they are unaware of each-other, ConcatAdapter will isolate each RecyclerView.Adapter's id pool from each other such that it will overwrite the reported stable id before reporting back to the RecyclerView. In this mode, the value returned from RecyclerView.ViewHolder.getItemId() might differ from the value returned from RecyclerView.Adapter.getItemId(int). Adding an adapter without stable ids will result in an java.lang.IllegalArgumentException.

SHARED_STABLE_IDS

In this mode, ConcatAdapter will return true from RecyclerView.Adapter.hasStableIds() and will require all added RecyclerView.Adapters to have stable ids. Unlike ConcatAdapter.Config.StableIdMode.ISOLATED_STABLE_IDS, ConcatAdapter will not override the returned item ids. In this mode, child RecyclerView.Adapters must be aware of each-other and never return the same id unless and item is moved between RecyclerView.Adapters. Adding an adapter without stable ids will result in an java.lang.IllegalArgumentException.

Methods

public static ConcatAdapter.Config.StableIdMode values()

public static ConcatAdapter.Config.StableIdMode valueOf(java.lang.String name)