TwoStatePreference

public abstract class TwoStatePreference
extends Preference

java.lang.Object
   ↳ androidx.preference.Preference
     ↳ androidx.preference.TwoStatePreference


Common base class for preferences that have two selectable states, save a boolean value, and may have dependent preferences that are enabled/disabled based on the current state.

Summary

Inherited constants

Fields

protected boolean mChecked

Public constructors

TwoStatePreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
TwoStatePreference(Context context, AttributeSet attrs, int defStyleAttr)
TwoStatePreference(Context context, AttributeSet attrs)
TwoStatePreference(Context context)

Public methods

boolean getDisableDependentsState()

Returns whether dependents are disabled when this preference is on (true) or when this preference is off (false).

CharSequence getSummaryOff()

Returns the summary to be shown when unchecked.

CharSequence getSummaryOn()

Returns the summary to be shown when checked.

boolean isChecked()

Returns the checked state.