Package-level declarations

Types

Link copied to clipboard
@Serializable
enum Axis : Enum<Axis>

Layout axis.

Link copied to clipboard
@Serializable
value class Color(@ColorInt val int: Int)

Packed color int.

Link copied to clipboard
@Serializable
enum ColumnCount : Enum<ColumnCount>
Link copied to clipboard

A Configurable is a component with a set of configurable Settings.

Link copied to clipboard

Simple progression strategy which increments or decrements the setting by a fixed number.

Link copied to clipboard
interface EnumPreference<T> : Preference<T>

A Preference which accepts a closed set of values.

Link copied to clipboard
class EnumPreferenceDelegate<T>(getValue: () -> T?, getEffectiveValue: () -> T, getIsEffective: () -> Boolean, updateValue: (T?) -> Unit, val supportedValues: List<T>) : PreferenceDelegate<T> , EnumPreference<T>
Link copied to clipboard
@Serializable
enum Fit : Enum<Fit>

Method for constraining a resource inside the viewport.

Link copied to clipboard
@Serializable
value class FontFamily(val name: String)

Typeface for a publication's text.

Link copied to clipboard
@Serializable
enum ImageFilter : Enum<ImageFilter>
Link copied to clipboard
class IntIncrement(increment: Int) : ProgressionStrategy<Int>

Simple progression strategy which increments or decrements the setting by a fixed number.

Link copied to clipboard

A Preference whose values must be null or in a ClosedRange of T.

Link copied to clipboard
class OptionalRangePreferenceDelegate<T : Comparable<T>>(getValue: () -> T?, getEffectiveValue: () -> T?, getIsEffective: () -> Boolean, updateValue: (T?) -> Unit, defaultValue: T, valueFormatter: (T) -> String, val supportedRange: ClosedRange<T>, progressionStrategy: ProgressionStrategy<T>) : PreferenceDelegate<T?> , OptionalRangePreference<T>
Link copied to clipboard
interface Preference<T>

A handle to edit the value of a specific preference which is able to predict which value the Configurable will effectively use.

Link copied to clipboard
open class PreferenceDelegate<T>(getValue: () -> T?, getEffectiveValue: () -> T, getIsEffective: () -> Boolean, updateValue: (T?) -> Unit) : Preference<T>
Link copied to clipboard

Interactive editor of preferences.

Link copied to clipboard

A filter to keep only some preferences and filter out some others.

Link copied to clipboard

JSON serializer of P.

Link copied to clipboard

A strategy to increment or decrement a setting.

Link copied to clipboard

A Preference whose values must be in a ClosedRange of T.

Link copied to clipboard
class RangePreferenceDelegate<T : Comparable<T>>(getValue: () -> T?, getEffectiveValue: () -> T, getIsEffective: () -> Boolean, updateValue: (T?) -> Unit, valueFormatter: (T) -> String, val supportedRange: ClosedRange<T>, progressionStrategy: ProgressionStrategy<T>) : PreferenceDelegate<T> , RangePreference<T>
Link copied to clipboard

Direction of the reading progression across resources.

Link copied to clipboard
@Serializable
enum Spread : Enum<Spread>

Synthetic spread policy.

Link copied to clipboard
class StepsProgression<T : Comparable<T>>(steps: List<T>, equalsDelta: (T, T) -> Boolean) : ProgressionStrategy<T>

Progression strategy based on a list of preferred values for the setting.

Link copied to clipboard
@Serializable
enum TextAlign : Enum<TextAlign>
Link copied to clipboard
@Serializable
enum Theme : Enum<Theme>

Functions

Link copied to clipboard
fun <T> Preference<T>.clear()

Unset the preference.

Link copied to clipboard

Returns a new preference with its boolean value flipped.

Link copied to clipboard
fun <T, V> Preference<T>.map(from: (T) -> V, to: (V) -> T): Preference<V>

Creates a new Preference object wrapping the receiver and converting its value from and to the target type V.

fun <T, V> EnumPreference<T>.map(from: (T) -> V, to: (V) -> T, supportedValues: (List<T>) -> List<V> = { it.map(from) }): EnumPreference<V>

Creates a new EnumPreference object wrapping the receiver and converting its value and supportedValues, from and to the target type V.

fun <T : Comparable<T>> RangePreference<T>.map(supportedRange: (ClosedRange<T>) -> ClosedRange<T> = { it }, formatValue: (T) -> String? = null, increment: RangePreference<T>.() -> Unit? = null, decrement: RangePreference<T>.() -> Unit? = null): RangePreference<T>

Creates a new RangePreference object wrapping the receiver and transforming its supportedRange, or overwriting its formatValue or increment and decrement strategy.

fun <T : Comparable<T>, V : Comparable<V>> RangePreference<T>.map(from: (T) -> V, to: (V) -> T, supportedRange: (ClosedRange<T>) -> ClosedRange<V> = { from(it.start)..from(it.endInclusive) }, formatValue: (V) -> String? = null, increment: RangePreference<V>.() -> Unit? = null, decrement: RangePreference<V>.() -> Unit? = null): RangePreference<V>

Creates a new RangePreference object wrapping the receiver and converting its value and supportedRange, from and to the target type V.

Link copied to clipboard

Creates a new EnumPreference object wrapping the receiver and transforming its supported values with transform.

Link copied to clipboard
Link copied to clipboard

Toggle the preference value. A default value is taken as the initial one if the preference is currently unset.

Link copied to clipboard
fun <T : Comparable<T>> RangePreference<T>.withSupportedRange(range: ClosedRange<T> = supportedRange, progressionStrategy: ProgressionStrategy<T>): RangePreference<T>

Creates a new RangePreference object wrapping the receiver and using a different supported range. A new progressionStrategy can be provided to customize the implementation of increment and decrement.

Link copied to clipboard
fun <T> EnumPreference<T>.withSupportedValues(vararg supportedValues: T): EnumPreference<T>
fun <T> Preference<T>.withSupportedValues(vararg supportedValues: T): EnumPreference<T>
fun <T> Preference<T>.withSupportedValues(supportedValues: List<T>): EnumPreference<T>

Creates a new EnumPreference object wrapping the receiver with the provided supportedValues.