Package-level declarations

Properties

Link copied to clipboard

The value of the alpha channel of this color.

Link copied to clipboard

The smallest whole Float greater than or equal to this value.

Link copied to clipboard

The hex code for this color.

Link copied to clipboard

Two times this value.

Link copied to clipboard

The largest whole Float smaller than or equal to this value.

Link copied to clipboard
val Int.half: Int

Half of this value.

Link copied to clipboard

Returns the height of a single line of text.

Link copied to clipboard

The median of the values in this range.

Link copied to clipboard
val Int?.orZero: Int

This value as an integer if this value is not null, or zero otherwise.

Link copied to clipboard

This value as an integer if this value is not null, or zero otherwise.

Link copied to clipboard
const val PI_RAD: Float = 180.0f

The number of degrees equivalent to π radians.

Link copied to clipboard

180 degrees (π radians) times this value.

Link copied to clipboard

This value rounded to the nearest whole Float.

Link copied to clipboard

Returns the height of text.

Functions

Link copied to clipboard

An SDK version-dependant compat function for appending text to SpannableStringBuilder and setting the span.

Link copied to clipboard

Overlays the given color with DrawContext.elevationOverlayColor, changing the opacity of DrawContext.elevationOverlayColor depending on the value of elevationDp.

Link copied to clipboard
fun RectF.clear()

Sets all coordinates of this RectF to 0.

Link copied to clipboard

Creates a new RectF with the same coordinates as this RectF without modifying this RectF.

Creates a copy of this ArrayList and each child ArrayList contained in this ArrayList.

Link copied to clipboard
fun Int.copyColor(alpha: Float = this.extractColorChannel(ALPHA_BIT_SHIFT) / MAX_HEX_VALUE, red: Float = this.extractColorChannel(RED_BIT_SHIFT) / MAX_HEX_VALUE, green: Float = this.extractColorChannel(GREEN_BIT_SHIFT) / MAX_HEX_VALUE, blue: Float = this.extractColorChannel(BLUE_BIT_SHIFT) / MAX_HEX_VALUE): Int
fun Int.copyColor(alpha: Int = this.extractColorChannel(ALPHA_BIT_SHIFT), red: Int = this.extractColorChannel(RED_BIT_SHIFT), green: Int = this.extractColorChannel(GREEN_BIT_SHIFT), blue: Int = this.extractColorChannel(BLUE_BIT_SHIFT)): Int

Copies this color, updating any or all of the color channels.

Link copied to clipboard
fun firstNonNegativeOf(vararg floats: Float): Float?

The first non-negative value of the values provided, or null if none of the values is non-negative.

Link copied to clipboard
inline fun <T> Iterable<T>.forEachIndexedExtended(selector: (index: Int, isFirst: Boolean, isLast: Boolean, value: T) -> Unit)

Calls the selector function for each element in the collection, providing the index of the element and Booleans indicating whether the element is the first or last element in the collection.

Link copied to clipboard

Returns that of the Marker.EntryModels stored in the Map whose x-axis map key is the closest to the Point.x value.

Link copied to clipboard
fun RectF.getEnd(isLtr: Boolean): Float

Returns RectF.right if isLtr is true, and RectF.left otherwise.

Link copied to clipboard

Returns those of the Marker.EntryModels stored in the Map whose ChartEntry.x is equal to xValue.

Link copied to clipboard
inline fun <T, V> T.getFieldValue(fieldName: String): V

Returns the value of the field with the specified name. This involves temporarily setting the accessible flag to true.

Link copied to clipboard

Returns RectF.left if isLtr is true, and RectF.right otherwise.

Link copied to clipboard
fun Int.hasAnyFlagOf(vararg flags: Int): Boolean

Whether this value contains any of the provided bit flags.

Link copied to clipboard
fun Int.hasFlag(flag: Int): Boolean

Whether this value contains the provided bit flag.

Link copied to clipboard
inline fun <T1, T2, R> ifNotNull(t1: T1?, t2: T2?, onNotNull: (T1, T2) -> R): R?

Calls the specified function block with t1 and t2 as its arguments if t1 and t2 are not null. Returns the function block’s result if it was called, and null if it wasn’t.

inline fun <T1, T2, T3, R> ifNotNull(t1: T1?, t2: T2?, t3: T3?, onNotNull: (T1, T2, T3) -> R): R?

Calls the specified function block with t1, t2, and t3 as its arguments if t1, t2, and t3 are not null. Returns the function block’s result if it was called, and null if it wasn’t.

Link copied to clipboard
inline fun Canvas.inClip(rect: RectF, block: () -> Unit)

Clips the given rect in the receiver Canvas, runs the block, and releases the clip.

inline fun Canvas.inClip(left: Float, top: Float, right: Float, bottom: Float, block: () -> Unit)

Clips the given rectangle in the receiver Canvas, runs the block, and releases the clip.

Link copied to clipboard

Returns the width of the provided text.

Link copied to clipboard
fun <T> mutableListOf(sourceCollection: Collection<T>): MutableList<T>

Creates a MutableList containing all elements of the specified source collection.

Link copied to clipboard
inline fun <T> Iterable<T>.rangeOfOrNull(selector: (T) -> Float): ClosedFloatingPointRange<Float>?

Calls the selector function for each value in the collection and returns the range of the produced values.

Link copied to clipboard

Calls the selector function for each value in the collection and returns the range of the produced values.

Link copied to clipboard

Creates a range from this value to the provided value or from the provided value to this value, depending on which value is larger.

Link copied to clipboard
fun RectF.rotate(degrees: Float): RectF

Creates a RectF representing the bounding box of this RectF rotated by the provided number of degrees.

Link copied to clipboard
fun Canvas.saveLayer(left: Float, top: Float, right: Float, bottom: Float): Int

A convenience function for Canvas.saveLayer.

Link copied to clipboard
fun RectF.set(left: Number, top: Number, right: Number, bottom: Number)

Sets the coordinates of this RectF to the provided values converted to Floats.

Link copied to clipboard
fun <T> MutableList<T>.setAll(other: Array<out T>)

Replaces all of the elements of this MutableList with the elements of the provided array.

fun <T> MutableList<T>.setAll(other: Collection<T>)

Replaces all of the elements of this MutableList with the elements of the provided collection.

fun <K, V> MutableMap<K, V>.setAll(other: Map<K, V>)

Replaces all of the elements of this MutableMap with the elements of the provided map.

Link copied to clipboard
fun RectF.setAndRotate(left: Number, top: Number, right: Number, bottom: Number, rotationDegrees: Float): RectF

Applies the provided coordinates to this RectF and rotates it by the given number of degrees.

Link copied to clipboard
fun Drawable.setBounds(left: Float, top: Float, right: Float, bottom: Float)

Sets a bounding box for this Drawable.

Link copied to clipboard
inline fun <T, V> T.setFieldValue(fieldName: String, value: V)

Updates the value of the field with the specified name to the given value. This involves temporarily setting the accessible flag to true.

Link copied to clipboard

For each child ArrayList contained in this ArrayList, replaces the elements of the child ArrayList with the elements of the corresponding Collection from the provided List. The child ArrayList and Collection are associated by index. If a given child ArrayList contained in this ArrayList has no corresponding Collection in the provided List, the child ArrayList will be cleared. If the size of this ArrayList is smaller than the size of the provided List, an appropriate number of empty child ArrayLists will first be added to this ArrayList.

Link copied to clipboard

Converts the provided dimension from sp to px.

Link copied to clipboard
inline fun <T> Iterable<T>.sumByFloat(selector: (T) -> Float): Float

Calls the selector function for each value in the collection and returns the sum of the produced Floats.

Link copied to clipboard
inline fun <T> Iterable<T>.sumOf(selector: (T) -> Float): Float

Calls the selector function for each value in the collection and returns the sum of the produced values.

Link copied to clipboard
fun <T> Iterable<T>.transformToSpannable(separator: CharSequence = ", ", prefix: CharSequence = "", postfix: CharSequence = "", limit: Int = -1, truncated: CharSequence = "…", transform: SpannableStringBuilder.(T) -> Unit): Spannable

Converts the receiver Iterable to a Spannable.

Link copied to clipboard

Moves this RectF horizontally and vertically by the specified distances.

Link copied to clipboard
fun <K, V> TreeMap<K, MutableList<V>>.updateAll(other: Map<K, List<V>>)

Updates the receiver TreeMap with the contents of another Map.

Link copied to clipboard
fun RectF.updateBounds(left: Float = this.left, top: Float = this.top, right: Float = this.right, bottom: Float = this.bottom)

Updates the coordinates of this RectF.

Link copied to clipboard
fun RectF.updateBy(left: Float = 0.0f, top: Float = 0.0f, right: Float = 0.0f, bottom: Float = 0.0f)

Increments the coordinates of this RectF by the provided values.