public class NavigationFragment extends AbstractPreferenceFragment implements NavigationPreferenceAdapter.Callback
PreferenceActivity.| Modifier and Type | Class and Description |
|---|---|
static interface |
NavigationFragment.Callback
Defines the interface, a class, which should be notified about the fragment's events, must
implement.
|
| Constructor and Description |
|---|
NavigationFragment() |
| Modifier and Type | Method and Description |
|---|---|
java.util.List<NavigationPreference> |
getAllNavigationPreferences()
Returns a list, which contains all navigation preferences, which are contained by the
navigation.
|
NavigationFragment.Callback |
getCallback()
Returns the callback, which is notified about the fragment's events.
|
NavigationPreference |
getNavigationPreference(int index)
Returns the navigation preference, which corresponds to a specific index.
|
int |
getNavigationPreferenceCount()
Returns the number of navigation preferences, which are contained by the navigation.
|
NavigationPreference |
getSelectedNavigationPreference()
Returns the currently selected navigation preference.
|
int |
getSelectedNavigationPreferenceIndex()
Returns the index of the navigation preference, which is currently selected, among all
navigation preferences.
|
boolean |
isAdapterCreated()
Returns, whether the adapter, which contains the navigation preferences, has been created
yet, or not.
|
void |
onActivityCreated(android.os.Bundle savedInstanceState) |
protected PreferenceAdapter |
onCreatePreferenceAdapter(PreferenceScreen preferenceScreen)
The method, which is invoked in order to create the adapter, which is used to manage the
fragment's preferences.
|
void |
onCreatePreferences(android.os.Bundle savedInstanceState,
java.lang.String rootKey) |
RecyclerView |
onCreateRecyclerView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
android.os.Bundle savedInstanceState) |
void |
onNavigationPreferenceAdded(NavigationPreference navigationPreference)
The method, which is invoked, when a navigation preference has been added.
|
void |
onNavigationPreferenceRemoved(NavigationPreference navigationPreference)
The method, which is invoked, when a navigation preference has been removed.
|
void |
onNavigationPreferenceSelected(NavigationPreference navigationPreference,
android.os.Bundle arguments)
The method, which is invoked, when a navigation preference has been selected.
|
void |
onNavigationPreferenceUnselected()
The method, which is invoked, when a navigation preference has been unselected.
|
boolean |
onSelectNavigationPreference(NavigationPreference navigationPreference)
The method, which is invoked, when a navigation preference is about to be selected.
|
void |
selectNavigationPreference(int index,
android.os.Bundle arguments)
Selects a specific navigation preference.
|
void |
setAdapterCallback(NavigationPreferenceAdapter.Callback callback)
Sets the callback, which should be notified about the events of the adapter, which contains
the navigation preferences.
|
void |
setCallback(NavigationFragment.Callback callback)
Sets the callback, which should be notified about the fragment's events.
|
void |
setEnabled(boolean enabled)
Sets, whether the navigation should be enabled, i.e.
|
void |
setSelectionColor(int color)
Sets the background color of the currently selected navigation preference.
|
getDividerColor, onCreate, onCreateAdapter, onCreateView, setDividerColorpublic final void setCallback(NavigationFragment.Callback callback)
callback - The callback, which should be set, as an instance of the type NavigationFragment.Callback or
null, if no callback should be notifiedpublic final NavigationFragment.Callback getCallback()
NavigationFragment.Callback or null, if no callback is notifiedpublic final void setAdapterCallback(NavigationPreferenceAdapter.Callback callback)
callback - The callback, which should be set, as an instance of the type NavigationPreferenceAdapter.Callback or null, if no callback should be notifiedpublic final int getNavigationPreferenceCount()
Integer valuepublic final java.util.List<NavigationPreference> getAllNavigationPreferences()
List or an empty collection, if no navigation
preferences are contained by the navigationpublic final NavigationPreference getNavigationPreference(int index)
index - The index of the navigation preference, which should be returned, among all
navigation preferences as an Integer valueNavigationPreference or null, if the adapter, which contains the navigation
preferences, has not been initialized yetpublic final NavigationPreference getSelectedNavigationPreference()
NavigationPreference or null, if no navigation preference is currently selectedpublic final int getSelectedNavigationPreferenceIndex()
Integer value or -1, if no navigation preference is selectedpublic final void selectNavigationPreference(int index,
android.os.Bundle arguments)
index - The index of the navigation preference, which should be selected, among all
navigation preferences, as an Integer value or -1, if no navigation
preference should be selectedarguments - The arguments, which should be passed to the fragment, which is associated with the
navigation preference, as an instance of the class Bundle or null, if no
arguments should be passed to the fragmentpublic final void setSelectionColor(int color)
color - The color, which should be set, as an Integer valuepublic final void setEnabled(boolean enabled)
enabled - True, if the navigation should be enabled, false otherwisepublic final boolean isAdapterCreated()
public final boolean onSelectNavigationPreference(NavigationPreference navigationPreference)
NavigationPreferenceAdapter.CallbackonSelectNavigationPreference in interface NavigationPreferenceAdapter.CallbacknavigationPreference - The navigation preference, which is about to be selected, as an instance of the
class NavigationPreference. The navigation preference may not be nullpublic final void onNavigationPreferenceSelected(NavigationPreference navigationPreference, android.os.Bundle arguments)
NavigationPreferenceAdapter.CallbackonNavigationPreferenceSelected in interface NavigationPreferenceAdapter.CallbacknavigationPreference - The navigation preference, which has been selected, as an instance of the class
NavigationPreference. The navigation preference may not be nullarguments - The arguments, which should be passed to the fragment, which is associated with
the navigation preference, as an instance of the class Bundle or null, if
no arguments should be passed to the fragmentpublic final void onNavigationPreferenceUnselected()
NavigationPreferenceAdapter.CallbackonNavigationPreferenceUnselected in interface NavigationPreferenceAdapter.Callbackpublic final void onNavigationPreferenceAdded(NavigationPreference navigationPreference)
NavigationPreferenceAdapter.CallbackonNavigationPreferenceAdded in interface NavigationPreferenceAdapter.CallbacknavigationPreference - The navigation preference, which has been added, as an instance of the class
NavigationPreference. The navigation preference may not be nullpublic final void onNavigationPreferenceRemoved(NavigationPreference navigationPreference)
NavigationPreferenceAdapter.CallbackonNavigationPreferenceRemoved in interface NavigationPreferenceAdapter.CallbacknavigationPreference - The navigation preference, which has been removed, as an instance of the class
NavigationPreference. The navigation preference may not be nullpublic final void onActivityCreated(android.os.Bundle savedInstanceState)
public void onCreatePreferences(android.os.Bundle savedInstanceState,
java.lang.String rootKey)
public final RecyclerView onCreateRecyclerView(android.view.LayoutInflater inflater,
android.view.ViewGroup parent,
android.os.Bundle savedInstanceState)
protected final PreferenceAdapter onCreatePreferenceAdapter(PreferenceScreen preferenceScreen)
AbstractPreferenceFragmentonCreatePreferenceAdapter in class AbstractPreferenceFragmentpreferenceScreen - The preference screen, which contains the preferences, which should be managed by the
adapter, as an instance of the class PreferenceScreen. The preference screen may not
be nullPreferenceAdapter. The adapter may not be null