Google 致力于为黑人社区推动种族平等。查看具体举措

SwitchPreferenceCompat

open class SwitchPreferenceCompat : TwoStatePreference
kotlin.Any
   ↳ androidx.preference.Preference
   ↳ androidx.preference.TwoStatePreference
   ↳ androidx.preference.SwitchPreferenceCompat

A Preference that provides a two-state toggleable option.

This preference will save a boolean value to android.content.SharedPreferences.

Summary

Inherited constants
Public constructors
<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int)

Construct a new SwitchPreference with the given style options.

<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int)

Construct a new SwitchPreference with the given style options.

<init>(context: Context!, attrs: AttributeSet!)

Construct a new SwitchPreference with the given style options.

<init>(context: Context!)

Construct a new SwitchPreference with default style options.

Public methods
open CharSequence!

open CharSequence!

open Unit

open Unit

Set the text displayed on the switch widget in the off state.

open Unit

Set the text displayed on the switch widget in the off state.

open Unit

Set the text displayed on the switch widget in the on state.

open Unit

Set the text displayed on the switch widget in the on state.

Inherited functions