public abstract class

FragmentStateAdapter.FragmentTransactionCallback

extends java.lang.Object

 java.lang.Object

↳androidx.viewpager2.adapter.FragmentStateAdapter.FragmentTransactionCallback

Overview

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

Summary

Constructors
publicFragmentTransactionCallback()

Methods
public FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListeneronFragmentMaxLifecyclePreUpdated(Fragment fragment, Lifecycle.State maxLifecycleState)

Called right before Fragment's maximum state is capped via FragmentTransaction.setMaxLifecycle(Fragment, Lifecycle.State).

public FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListeneronFragmentPreAdded(Fragment fragment)

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

public FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListeneronFragmentPreRemoved(Fragment fragment)

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

public FragmentStateAdapter.FragmentTransactionCallback.OnPostEventListeneronFragmentPreSavedInstanceState(Fragment fragment)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public FragmentTransactionCallback()

Methods

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

Parameters:

fragment: Fragment changing state

Returns:

Listener called after the operation

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

Parameters:

fragment: Fragment which state is being saved

Returns:

Listener called after the operation

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

Parameters:

fragment: Fragment changing state

Returns:

Listener called after the operation

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

Called right before Fragment's maximum state is capped via FragmentTransaction.setMaxLifecycle(Fragment, Lifecycle.State).

Parameters:

fragment: Fragment to have its state capped
maxLifecycleState: Ceiling state for the fragment

Returns:

Listener called after the operation