Package-level declarations

Contains general purpose utilities to simplify common use cases, for instance: extension functions for Animation and Collection.

Types

Link copied to clipboard

Application class related utilities.

Link copied to clipboard
@IviExperimental(reasons = [])
class AppOpsUtil(context: Context)

Utility class to check whether app operations (app ops) are allowed.

Link copied to clipboard

An extension of AnimationListener with default implementations, so that not every method has to be implemented.

Properties

Link copied to clipboard
@IviExperimental(reasons = [])
val KClass<*>.enclosingClass: KClass<*>?
Link copied to clipboard

Functions

Link copied to clipboard

Checks whether any element in the collection is false. Returns false if empty.

Link copied to clipboard

Checks whether any element in the collection is true. Returns false if empty.

Link copied to clipboard
@IviExperimental(reasons = [])
suspend fun delay(duration: Duration)

Coroutine delay convenience syntax taking a java.time.Duration instead of kotlin.time.Duration.

Link copied to clipboard
@IviExperimental(reasons = [])
fun SharedPreferences.get(key: String, defaultValue: Any): Any

Retrieves the value of key from the preferences.

Link copied to clipboard

Same as the type-safe variant of PackageManager.getActivityInfo on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard

Same as the type-safe variant of PackageManager.getApplicationInfo on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard

Returns a Rect, bounding the view.

Link copied to clipboard
@IviExperimental(reasons = [])
fun SharedPreferences.getDouble(key: String, defaultValue: Double): Double

Retrieves the Double value of key from the preferences.

Link copied to clipboard

Same as the type-safe variant of PackageManager.getInstalledApplications on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard

Same as the type-safe variant of PackageManager.getPackageArchiveInfo on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard

Same as the type-safe variant of PackageManager.getPackageInfo on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard

Same as the type-safe variant of Bundle.getParcelable on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard
Link copied to clipboard

Same as the type-safe variant of Bundle.getSerializable on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard
@IviExperimental(reasons = [])
fun <T> ArrayList<T>.indexOfFirstOrNull(predicate: (T) -> Boolean): Int?

Returns index of the first element matching the given predicate, or null if the array does not contain such element.

@IviExperimental(reasons = [])
fun <T> Collection<T>.indexOfFirstOrNull(predicate: (T) -> Boolean): Int?

Returns index of the first element matching the given predicate, or null if the collection does not contain such element.

@IviExperimental(reasons = [])
fun <T> Iterable<T>.indexOfFirstOrNull(predicate: (T) -> Boolean): Int?

Returns index of the first element matching the given predicate, or null if the iterable does not contain such element.

Link copied to clipboard
@IviExperimental(reasons = [])
fun <T> ArrayList<T>.indexOfLastOrNull(predicate: (T) -> Boolean): Int?

Returns index of the last element matching the given predicate, or null if the array does not contain such element.

@IviExperimental(reasons = [])
fun <T> Collection<T>.indexOfLastOrNull(predicate: (T) -> Boolean): Int?

Returns index of the last element matching the given predicate, or null if the collection does not contain such element.

@IviExperimental(reasons = [])
fun <T> Iterable<T>.indexOfLastOrNull(predicate: (T) -> Boolean): Int?

Returns index of the last element matching the given predicate, or null if the iterable does not contain such element.

Link copied to clipboard

Whether the event is within the bounds of the view.

Link copied to clipboard

Returns true if the current process is a main one. A current process is considered the main process if its name is the same as the package name (application ID).

Link copied to clipboard
@IviExperimental(reasons = [])
inline fun <T> isNullable(): Boolean

Checks if a type is nullable.

Link copied to clipboard

Applies a mask to the provided String by replacing its content by a star "*", except the last two characters that will be kept as they are.

Link copied to clipboard
@IviExperimental(reasons = [])
fun SharedPreferences.put(key: String, newValue: Any)

Sets the key value in the preferences editor to newValue, and calls SharedPreferences.Editor.apply.

Link copied to clipboard

Sets key to the Double value value in the preferences editor, to be written back once SharedPreferences.Editor.commit or SharedPreferences.Editor.apply are called.

Link copied to clipboard

Same as the type-safe variant of PackageManager.queryBroadcastReceivers on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard

Same as the type-safe variant of PackageManager.queryIntentActivities on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard
fun PackageManager.queryIntentServicesCompat(intent: Intent, getResolvedFilter: Boolean = false, getMetaData: Boolean = false): List<ResolveInfo>

Same as the type-safe variant of PackageManager.queryIntentServices on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard

Removes the key value from the preferences and calls SharedPreferences.Editor.apply

Link copied to clipboard

Same as the type-safe variant of PackageManager.resolveActivity on Android 13 and later, or the type-unsafe variant on Android 12 or earlier.

Link copied to clipboard
@IviExperimental(reasons = [])
fun Animation.setAnimationEndListener(onAnimationEnd: () -> Unit)

Sets the animation listener on the animation, dispatching only the AnimationListener.onAnimationEnd callback.

Link copied to clipboard
@IviExperimental(reasons = [])
inline fun <T> Iterable<T>.sumByLong(selector: (T) -> Long): Long

Long version of Iterable.sumBy.

Link copied to clipboard
@IviExperimental(reasons = [])
suspend fun <T> withTimeout(timeout: Duration, block: suspend CoroutineScope.() -> T): T

Coroutine withTimeout convenience syntax taking a java.time.Duration instead of kotlin.time.Duration.