Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

androidx.core.preference

Extension functions summary

For android.preference.PreferenceGroup
operator Preference

Returns the preference with key.

operator Preference

Returns the preference at index.

operator Boolean

Returns true if preference is found in this preference group.

operator Unit

Adds preference to this preference group.

operator Unit

Removes preference from this preference group.

Boolean

Returns true if this preference group contains no preferences.

Boolean

Returns true if this preference group contains one or more preferences.

Unit
PreferenceGroup.forEach(action: (preference: Preference) -> Unit)

Performs the given action on each preference in this preference group.

Unit
PreferenceGroup.forEachIndexed(action: (index: Int, preference: Preference) -> Unit)

Performs the given action on each preference in this preference group, providing its sequential index.

operator MutableIterator<Preference>

Returns a MutableIterator over the preferences in this preference group.

Extension properties summary

For android.preference.PreferenceGroup
Int

Returns the number of preferences in this preference group.

Sequence<Preference>

Returns a Sequence over the preferences in this preference group.

Extension functions

contains

operator fun PreferenceGroup.contains(preference: Preference): Boolean

Returns true if preference is found in this preference group.

forEach

inline fun PreferenceGroup.forEach(action: (preference: Preference) -> Unit): Unit

Performs the given action on each preference in this preference group.

forEachIndexed

inline fun PreferenceGroup.forEachIndexed(action: (index: Int, preference: Preference) -> Unit): Unit

Performs the given action on each preference in this preference group, providing its sequential index.

get

inline operator fun PreferenceGroup.get(key: CharSequence): Preference

Returns the preference with key.

Exceptions
NullPointerException if no preference is found with that key.

get

operator fun PreferenceGroup.get(index: Int): Preference

Returns the preference at index.

Exceptions
IndexOutOfBoundsException if index is less than 0 or greater than or equal to the count.

isEmpty

inline fun PreferenceGroup.isEmpty(): Boolean

Returns true if this preference group contains no preferences.

isNotEmpty

inline fun PreferenceGroup.isNotEmpty(): Boolean

Returns true if this preference group contains one or more preferences.

iterator

operator fun PreferenceGroup.iterator(): MutableIterator<Preference>

Returns a MutableIterator over the preferences in this preference group.

minusAssign

inline operator fun PreferenceGroup.minusAssign(preference: Preference): Unit

Removes preference from this preference group.

plusAssign

inline operator fun PreferenceGroup.plusAssign(preference: Preference): Unit

Adds preference to this preference group.

Extension properties

children

val PreferenceGroup.children: Sequence<Preference>

Returns a Sequence over the preferences in this preference group.

size

inline val PreferenceGroup.size: Int

Returns the number of preferences in this preference group.