android-components / mozilla.components.support.ktx.android.content

Package mozilla.components.support.ktx.android.content

Types

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

Properties

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.

Functions

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.
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 false.fun <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.