android-components /



Name Summary
PreferencesHolder interface PreferencesHolder
Represents a class that holds a reference to SharedPreferences.


Name Summary
appName val <ERROR CLASS>.appName: String
Returns the name (label) of the application or the package name as a fallback.
appVersionName val <ERROR CLASS>.appVersionName: String?
The (visible) version name of the application, as specified by the tag’s versionName attribute. E.g. “2.0”.
isScreenReaderEnabled val <ERROR CLASS>.isScreenReaderEnabled: Boolean
Check if TalkBack service is enabled.


Name Summary
booleanPreference fun booleanPreference(key: String, default: Boolean): ReadWriteProperty<PreferencesHolder, Boolean>
Property delegate for getting and setting a boolean shared preference.
floatPreference fun floatPreference(key: String, default: Float): ReadWriteProperty<PreferencesHolder, Float>
Property delegate for getting and setting a float number shared preference.
getColorFromAttr fun <ERROR CLASS>.getColorFromAttr(attr: Int): <ERROR CLASS>
Returns the color int corresponding to the attribute.
getDrawableWithTint fun <ERROR CLASS>.getDrawableWithTint(resId: Int, tint: Int): <ERROR CLASS>
Returns a tinted drawable for the given resource ID.
hasCamera fun <ERROR CLASS>.hasCamera(): Boolean
Checks whether or not the device has a camera.
intPreference fun intPreference(key: String, default: Int): ReadWriteProperty<PreferencesHolder, Int>
Property delegate for getting and setting an int number shared preference.
isMainProcess fun <ERROR CLASS>.isMainProcess(): Boolean
Returns true if we are running in the main process false otherwise.
isOSOnLowMemory fun <ERROR CLASS>.isOSOnLowMemory(): Boolean
Returns whether or not the operating system is under low memory conditions.
isPermissionGranted fun <ERROR CLASS>.isPermissionGranted(permission: Iterable<String>): Boolean
Returns if a list of permission have been granted, if all the permission have been granted returns true otherwise <ERROR CLASS>.isPermissionGranted(vararg permission: String): Boolean
longPreference fun longPreference(key: String, default: Long): ReadWriteProperty<PreferencesHolder, Long>
Property delegate for getting and setting a long number shared preference.
runOnlyInMainProcess fun <ERROR CLASS>.runOnlyInMainProcess(block: () -> Unit): Unit
Takes a function runs it only it if we are running in the main process, otherwise the function will not be executed.
share fun <ERROR CLASS>.share(text: String, subject: String = getString(R.string.mozac_support_ktx_share_dialog_title)): Boolean
Shares content via ACTION_SEND intent.
stringPreference fun stringPreference(key: String, default: String): ReadWriteProperty<PreferencesHolder, String>
Property delegate for getting and setting a string shared preference.
stringSetPreference fun stringSetPreference(key: String, default: Set<String>): ReadWriteProperty<PreferencesHolder, Set<String>>
Property delegate for getting and setting a string set shared preference.