LeanbackSettingsFragment

abstract class LeanbackSettingsFragment : Fragment
kotlin.Any
   ↳ android.app.Fragment
   ↳ androidx.leanback.preference.LeanbackSettingsFragment

This fragment provides a container for displaying a LeanbackPreferenceFragment

The following sample code shows a simple leanback preference fragment that is populated from a resource. The resource it loads is:

{@sample frameworks/support/samples/SupportPreferenceDemos/src/main/res/xml/preferences.xml preferences}

The sample implements PreferenceFragment.OnPreferenceStartFragmentCallback#onPreferenceStartFragment(PreferenceFragment, Preference), PreferenceFragment.OnPreferenceStartScreenCallback#onPreferenceStartScreen(PreferenceFragment, PreferenceScreen), and #onPreferenceStartInitialScreen():

{@sample frameworks/support/samples/SupportPreferenceDemos/src/main/java/com/example/android/supportpreference/FragmentSupportPreferencesLeanback.java * support_fragment_leanback}

Summary

Public constructors

Public methods
abstract Unit

Called to instantiate the initial androidx.preference.PreferenceFragment to be shown in this fragment.

open Unit

open Unit
onViewCreated(view: View!, savedInstanceState: Bundle!)

open Boolean
onPreferenceDisplayDialog(caller: PreferenceFragment, pref: Preference!)

open Unit

open View!
onCreateView(inflater: LayoutInflater!, container: ViewGroup!, savedInstanceState: Bundle!)

open Unit

Displays a preference fragment to the user.

open Unit

Displays a fragment to the user, temporarily replacing the contents of this fragment.

Public constructors

<init>

LeanbackSettingsFragment()

Public methods

onPreferenceStartInitialScreen

abstract fun onPreferenceStartInitialScreen(): Unit

Called to instantiate the initial androidx.preference.PreferenceFragment to be shown in this fragment. Implementations are expected to call #startPreferenceFragment(android.app.Fragment).

onPause

open fun onPause(): Unit

onViewCreated

open fun onViewCreated(view: View!, savedInstanceState: Bundle!): Unit

onPreferenceDisplayDialog

open fun onPreferenceDisplayDialog(caller: PreferenceFragment, pref: Preference!): Boolean

onResume

open fun onResume(): Unit

onCreateView

open fun onCreateView(inflater: LayoutInflater!, container: ViewGroup!, savedInstanceState: Bundle!): View!

startPreferenceFragment

open fun startPreferenceFragment(fragment: Fragment): Unit

Displays a preference fragment to the user. This method can also be used to display list-style fragments on top of the stack of preference fragments.

Parameters
fragment Fragment: Fragment instance to be added.

startImmersiveFragment

open fun startImmersiveFragment(fragment: Fragment): Unit

Displays a fragment to the user, temporarily replacing the contents of this fragment.

Parameters
fragment Fragment: Fragment instance to be added.