FragmentStateAdapter

Similar in behavior to FragmentStatePagerAdapter

Lifecycle within RecyclerView:

Constructors

Link copied to clipboard
constructor(@NonNull fragmentActivity: FragmentActivity)
constructor(@NonNull fragment: Fragment)
constructor(@NonNull fragmentManager: FragmentManager, @NonNull lifecycle: Lifecycle)

Types

Link copied to clipboard
Callback interface for listening to fragment lifecycle changes that happen inside the adapter.

Functions

Link copied to clipboard
open fun containsItem(itemId: Long): Boolean
Default implementation works for collections that don't add, move, remove items.
Link copied to clipboard
abstract fun createFragment(position: Int): Fragment
Provide a new Fragment associated with the specified position.
Link copied to clipboard
open fun getItemId(position: Int): Long
Default implementation works for collections that don't add, move, remove items.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Registers a FragmentTransactionCallback to listen to fragment lifecycle changes that happen inside the adapter.
Link copied to clipboard
fun restoreState(@NonNull savedState: Parcelable)
Restores adapter state
Link copied to clipboard
Saves adapter state
Link copied to clipboard
fun setHasStableIds(hasStableIds: Boolean)