O Google tem o compromisso de promover a igualdade racial para as comunidades negras. Saiba como.

FragmentStateAdapter

abstract class FragmentStateAdapter : RecyclerView.Adapter<FragmentViewHolder!>, StatefulAdapter
kotlin.Any
   ↳ androidx.recyclerview.widget.RecyclerView.Adapter<androidx.viewpager2.adapter.FragmentViewHolder>
   ↳ androidx.viewpager2.adapter.FragmentStateAdapter

Similar in behavior to FragmentStatePagerAdapter

Lifecycle within RecyclerView:

Summary

Nested classes
abstract

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

Public constructors
<init>(@NonNull fragmentActivity: FragmentActivity)

<init>(@NonNull fragment: Fragment)

<init>(@NonNull fragmentManager: FragmentManager, @NonNull lifecycle: Lifecycle)

Public methods
open Boolean
containsItem(itemId: Long)

Default implementation works for collections that don't add, move, remove items.

abstract Fragment
createFragment(position: Int)

Provide a new Fragment associated with the specified position.

open Long
getItemId(position: Int)

Default implementation works for collections that don't add, move, remove items.

open Unit
onAttachedToRecyclerView(@NonNull recyclerView: RecyclerView)

Unit
onBindViewHolder(@NonNull holder: FragmentViewHolder, position: Int)

FragmentViewHolder
onCreateViewHolder(@NonNull parent: ViewGroup, viewType: Int)

open Unit
onDetachedFromRecyclerView(@NonNull recyclerView: RecyclerView)

Boolean

Unit

Unit

open Unit

Registers a FragmentTransactionCallback to listen to fragment lifecycle changes that happen inside the adapter.

Unit
restoreState(@NonNull savedState: Parcelable)

Parcelable

Unit
setHasStableIds(hasStableIds: Boolean)

open Unit

Unregisters a FragmentTransactionCallback.

Inherited functions