Package-level declarations

Types

Link copied to clipboard
open class AtomicFile
Static library support version of the framework's android.util.AtomicFile, a helper class for performing atomic operations on a file by writing to a new file and renaming it into the place of the original file after the write has successfully completed.
Link copied to clipboard
fun interface Consumer<T>

Compat version of java.util.function.Consumer

Link copied to clipboard
Helper for accessing features in android.util.DebugUtils.
Link copied to clipboard
fun interface Function<T, R>

Compat version of java.util.function.Function

Link copied to clipboard
Link copied to clipboard
open class ObjectsCompat
This class consists of static utility methods for operating on objects.
Link copied to clipboard
open class Pair<F, S>
Container to ease passing around a tuple of two objects.
Link copied to clipboard
Commonly used regular expression patterns.
Link copied to clipboard
class Pools

Helper class for creating pools of objects. An example use looks like this:

Link copied to clipboard
Simple static methods to be called at the start of your own methods to verify correct arguments and state.
Link copied to clipboard
interface Predicate<T>
Link copied to clipboard
SESL-specific fading edge height and interpolator overrides for the bottom edge.
Link copied to clipboard
open class SeslDisplayUtils
Utility class for display-related queries, Dex/Desktop windowing checks, and edge panel settings.
Link copied to clipboard
Contract for AGSL-based fading edge rendering used by SESL scrollable widgets.
Link copied to clipboard
AGSL RuntimeShader based fading edge renderer for SESL scrollable widgets.
Link copied to clipboard
Legacy LinearGradient based fading edge renderer for SESL scrollable widgets (API <33).
Link copied to clipboard
Controller for AGSL-based fading edge shaders used by SESL scrollable widgets.
Link copied to clipboard
SESL-specific fading edge height and interpolator overrides for the top edge.
Link copied to clipboard
Immutable class for describing width and height dimensions in some arbitrary unit.
Link copied to clipboard
fun interface Supplier<T>

Compat version of java.util.function.Supplier

Link copied to clipboard
Helper for accessing features in android.util.TimeUtils.
Link copied to clipboard
open class TypedValueCompat
Container for a dynamically typed data value.

Properties

Link copied to clipboard

Returns the number of key/value pairs in the collection.

Returns the number of key/value entries in the collection.

Functions

Link copied to clipboard
@RequiresApi(value = 21)
infix inline fun <T : Comparable<T>> Range<T>.and(other: Range<T>): Range<T>

Return the intersection of this range and other.

Link copied to clipboard

Returns a Consumer that will resume this Continuation when the result of an operation is accepted.

Link copied to clipboard

Returns a java.util.function.Consumer that will resume this Continuation when the result of an operation is accepted.

Link copied to clipboard

Returns a Runnable that will resume this Continuation when an operation completes and the returned Runnable's Runnable.run method is called.

Link copied to clipboard
inline operator fun <F, S> Pair<F, S>.component1(): F
inline operator fun <F, S> Pair<F, S>.component1(): F

Returns the first component of the pair.

@RequiresApi(value = 21)
inline operator fun Size.component1(): Int

Returns "width", the first component of this Size.

@RequiresApi(value = 21)
inline operator fun SizeF.component1(): Float

Returns "width", the first component of this SizeF.

inline operator fun SizeFCompat.component1(): Float

Returns "width", the first component of this SizeFCompat.

Link copied to clipboard
inline operator fun <F, S> Pair<F, S>.component2(): S
inline operator fun <F, S> Pair<F, S>.component2(): S

Returns the second component of the pair.

@RequiresApi(value = 21)
inline operator fun Size.component2(): Int

Returns "height", the second component of this Size.

@RequiresApi(value = 21)
inline operator fun SizeF.component2(): Float

Returns "height", the second component of this SizeF.

inline operator fun SizeFCompat.component2(): Float

Returns "height", the second component of this SizeFCompat.

Link copied to clipboard
inline operator fun <T> LongSparseArray<T>.contains(key: Long): Boolean
inline operator fun <T> SparseArray<T>.contains(key: Int): Boolean
inline operator fun SparseBooleanArray.contains(key: Int): Boolean
inline operator fun SparseIntArray.contains(key: Int): Boolean
inline operator fun SparseLongArray.contains(key: Int): Boolean

Returns true if the collection contains key.

Link copied to clipboard
inline fun <T> LongSparseArray<T>.containsKey(key: Long): Boolean
inline fun <T> SparseArray<T>.containsKey(key: Int): Boolean

Returns true if the collection contains key.

Link copied to clipboard
inline fun <T> LongSparseArray<T>.containsValue(value: T): Boolean
inline fun <T> SparseArray<T>.containsValue(value: T): Boolean

Returns true if the collection contains value.

Link copied to clipboard
inline fun <T> LongSparseArray<T>.forEach(action: (key: Long, value: T) -> Unit)
inline fun <T> SparseArray<T>.forEach(action: (key: Int, value: T) -> Unit)
inline fun SparseBooleanArray.forEach(action: (key: Int, value: Boolean) -> Unit)
inline fun SparseIntArray.forEach(action: (key: Int, value: Int) -> Unit)
inline fun SparseLongArray.forEach(action: (key: Int, value: Long) -> Unit)

Performs the given action for each key/value entry.

Link copied to clipboard
inline fun <T> LongSparseArray<T>.getOrDefault(key: Long, defaultValue: T): T
inline fun <T> SparseArray<T>.getOrDefault(key: Int, defaultValue: T): T
inline fun SparseBooleanArray.getOrDefault(key: Int, defaultValue: Boolean): Boolean
inline fun SparseIntArray.getOrDefault(key: Int, defaultValue: Int): Int
inline fun SparseLongArray.getOrDefault(key: Int, defaultValue: Long): Long

Return the value corresponding to key, or defaultValue when not present.

Link copied to clipboard
inline fun <T> LongSparseArray<T>.getOrElse(key: Long, defaultValue: () -> T): T
inline fun <T> SparseArray<T>.getOrElse(key: Int, defaultValue: () -> T): T
inline fun SparseBooleanArray.getOrElse(key: Int, defaultValue: () -> Boolean): Boolean
inline fun SparseIntArray.getOrElse(key: Int, defaultValue: () -> Int): Int
inline fun SparseLongArray.getOrElse(key: Int, defaultValue: () -> Long): Long

Return the value corresponding to key, or from defaultValue when not present.

Link copied to clipboard
inline fun <T> LongSparseArray<T>.isEmpty(): Boolean
inline fun <T> SparseArray<T>.isEmpty(): Boolean

Return true when the collection contains no elements.

Link copied to clipboard
inline fun <T> SparseArray<T>.isNotEmpty(): Boolean

Return true when the collection contains elements.

Link copied to clipboard
inline fun <K : Any, V : Any> lruCache(maxSize: Int, crossinline sizeOf: (key: K, value: V) -> Int = { _, _ -> 1 }, crossinline create: (key: K) -> V? = { null as V? }, crossinline onEntryRemoved: (evicted: Boolean, key: K, oldValue: V, newValue: V?) -> Unit = { _, _, _, _ -> }): LruCache<K, V>

Creates an LruCache with the given parameters.

Link copied to clipboard
operator fun <T> SparseArray<T>.plus(other: SparseArray<T>): SparseArray<T>

Creates a new collection by adding or replacing entries from other.

@RequiresApi(value = 21)
inline operator fun <T : Comparable<T>> Range<T>.plus(value: T): Range<T>

Return the smallest range that includes this and value.

@RequiresApi(value = 21)
inline operator fun <T : Comparable<T>> Range<T>.plus(other: Range<T>): Range<T>

Return the smallest range that includes this and other.

Link copied to clipboard
fun <T> SparseArray<T>.putAll(other: SparseArray<T>)

Update this collection by adding or replacing entries from other.

Link copied to clipboard
@RequiresApi(value = 21)
infix inline fun <T : Comparable<T>> T.rangeTo(that: T): Range<T>

Creates a range from this Comparable value to that.

Link copied to clipboard

Gets the entire content of this file as a byte array.

Link copied to clipboard
fun AtomicFile.readText(charset: Charset = Charsets.UTF_8): String

Gets the entire content of this file as a String using UTF-8 or specified charset.

Link copied to clipboard
fun <T> LongSparseArray<T>.remove(key: Long, value: T): Boolean
fun <T> SparseArray<T>.remove(key: Int, value: T): Boolean
fun SparseIntArray.remove(key: Int, value: Int): Boolean

Removes the entry for key only if it is mapped to value.

Removes the entry for key only if it is set to value.

Link copied to clipboard
inline operator fun <T> LongSparseArray<T>.set(key: Long, value: T)
inline operator fun <T> SparseArray<T>.set(key: Int, value: T)
inline operator fun SparseBooleanArray.set(key: Int, value: Boolean)
inline operator fun SparseIntArray.set(key: Int, value: Int)
inline operator fun SparseLongArray.set(key: Int, value: Long)

Allows the use of the index operator for storing values in the collection.

Link copied to clipboard
inline fun <F, S> Pair<F, S>.toAndroidPair(): Pair<F, S>

Returns this Kotlin Pair as an Android Pair.

Link copied to clipboard
inline fun <F, S> Pair<F, S>.toAndroidXPair(): Pair<F, S>

Returns this Kotlin Pair as an AndroidX Pair.

Link copied to clipboard

Returns this Range as a ClosedRange.

Link copied to clipboard
@RequiresApi(value = 26)
inline fun Double.toHalf(): Half

Returns a Half instance representing given Double.

@RequiresApi(value = 26)
inline fun Float.toHalf(): Half

Returns a Half instance representing given Float.

@RequiresApi(value = 26)
inline fun Short.toHalf(): Half

Returns a Half instance representing given Short.

@RequiresApi(value = 26)
inline fun String.toHalf(): Half

Returns a Half instance representing given String.

Link copied to clipboard
inline fun <F, S> Pair<F, S>.toKotlinPair(): Pair<F, S>

Returns this Android Pair as a Kotlin Pair.

inline fun <F, S> Pair<F, S>.toKotlinPair(): Pair<F, S>

Returns this AndroidX Pair as a Kotlin Pair.

Link copied to clipboard
@RequiresApi(value = 21)
fun <T : Comparable<T>> ClosedRange<T>.toRange(): Range<T>

Returns this ClosedRange as a Range.

Link copied to clipboard
inline fun AtomicFile.tryWrite(block: (out: FileOutputStream) -> Unit)

Perform the write operations inside block on this file. If block throws an exception the write will be failed. Otherwise the write will be applied atomically to the file.

Link copied to clipboard

Sets the content of this file as an array of bytes.

Link copied to clipboard
fun AtomicFile.writeText(text: String, charset: Charset = Charsets.UTF_8)

Sets the content of this file as text encoded using UTF-8 or specified charset. If this file exists, it becomes overwritten.