FragmentStateAdapter.FragmentTransactionCallback


abstract class FragmentStateAdapter.FragmentTransactionCallback


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

Summary

Public constructors

Public functions

FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener
onFragmentMaxLifecyclePreUpdated(
    fragment: Fragment,
    maxLifecycleState: Lifecycle.State
)

Called right before Fragment's maximum state is capped via setMaxLifecycle.

FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Called right before the Fragment is added to adapter's FragmentManager.

FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Called right before the Fragment is removed from adapter's FragmentManager.

FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Called right before Fragment's state is being saved through a saveFragmentInstanceState call.

Public constructors

FragmentTransactionCallback

Added in 1.1.0
FragmentTransactionCallback()

Public functions

onFragmentMaxLifecyclePreUpdated

Added in 1.1.0
fun onFragmentMaxLifecyclePreUpdated(
    fragment: Fragment,
    maxLifecycleState: Lifecycle.State
): FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Called right before Fragment's maximum state is capped via setMaxLifecycle.

Parameters
fragment: Fragment

Fragment to have its state capped

maxLifecycleState: Lifecycle.State

Ceiling state for the fragment

Returns
FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Listener called after the operation

onFragmentPreAdded

Added in 1.1.0
fun onFragmentPreAdded(fragment: Fragment): FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Called right before the Fragment is added to adapter's FragmentManager.

Parameters
fragment: Fragment

Fragment changing state

Returns
FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Listener called after the operation

onFragmentPreRemoved

Added in 1.1.0
fun onFragmentPreRemoved(fragment: Fragment): FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Called right before the Fragment is removed from adapter's FragmentManager.

Parameters
fragment: Fragment

Fragment changing state

Returns
FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Listener called after the operation

onFragmentPreSavedInstanceState

Added in 1.1.0
@FragmentStateAdapter.ExperimentalFragmentStateAdapterApi
fun onFragmentPreSavedInstanceState(fragment: Fragment): FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Called right before Fragment's state is being saved through a saveFragmentInstanceState call.

Parameters
fragment: Fragment

Fragment which state is being saved

Returns
FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListener

Listener called after the operation