ConcatAdapter.Config.StableIdMode


public enum ConcatAdapter.Config.StableIdMode


Defines how ConcatAdapter handle stable ids (hasStableIds).

Summary

Enum Values

ISOLATED_STABLE_IDS

In this mode, ConcatAdapter will return true from hasStableIds and will require all added Adapters to have stable ids.

NO_STABLE_IDS

In this mode, ConcatAdapter ignores the stable ids reported by sub adapters.

SHARED_STABLE_IDS

In this mode, ConcatAdapter will return true from hasStableIds and will require all added Adapters to have stable ids.

Public methods

static ConcatAdapter.Config.StableIdMode

Returns the enum constant of this type with the specified name.

static ConcatAdapter.Config.StableIdMode[]

Returns an array containing the constants of this enum type, in the order they're declared.

Enum Values

ISOLATED_STABLE_IDS

ConcatAdapter.Config.StableIdMode ConcatAdapter.Config.StableIdMode.ISOLATED_STABLE_IDS

In this mode, ConcatAdapter will return true from hasStableIds and will require all added 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 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 getItemId might differ from the value returned from getItemId. Adding an adapter without stable ids will result in an IllegalArgumentException.

NO_STABLE_IDS

ConcatAdapter.Config.StableIdMode ConcatAdapter.Config.StableIdMode.NO_STABLE_IDS

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

SHARED_STABLE_IDS

ConcatAdapter.Config.StableIdMode ConcatAdapter.Config.StableIdMode.SHARED_STABLE_IDS

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

Public methods

valueOf

Added in 1.2.0
public static ConcatAdapter.Config.StableIdMode valueOf(String name)

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Returns
ConcatAdapter.Config.StableIdMode

the enum constant with the specified name

Throws
java.lang.IllegalArgumentException

if this enum type has no constant with the specified name

values

Added in 1.2.0
public static ConcatAdapter.Config.StableIdMode[] values()

Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.

Returns
ConcatAdapter.Config.StableIdMode[]

an array containing the constants of this enum type, in the order they're declared