Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class PreferenceItemSettings(val type: PreferenceType = PreferenceType.Item)

this provides a class to define some custom INTERNAL settings to customise a preference item

Link copied to clipboard
data class PreferenceItemSetup(val trailingContentSize: PreferenceItemSetup.TrailingContentSize = TrailingContentSize(), val ignoreForceNoIconInset: Boolean = false, val minHeight: Dp = 56.dp, val minSubTitleExtraHeight: Dp = 16.dp, val contentPlacementBottom: Boolean = false, val alignment: Alignment.Vertical = Alignment.CenterVertically, val hideTitle: Boolean = false, val excludeFromSectionStyle: Boolean = false)

this provides a class to define some custom setup to customise a preference item

Functions

Link copied to clipboard
fun PreferenceScope.BasePreference(modifier: Modifier = Modifier, enabled: Dependency = Dependency.Enabled, visible: Dependency = Dependency.Enabled, title: String, subtitle: String? = null, icon: @Composable () -> Unit? = null, onClick: () -> Unit? = null, onLongClick: () -> Unit? = null, itemStyle: PreferenceItemStyle = LocalPreferenceSettings.current.style.defaultItemStyle, itemSetup: PreferenceItemSetup = PreferenceItemSetup(), titleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, subtitleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, filterTags: List<String> = emptyList(), content: @Composable ColumnScope.() -> Unit? = null)

this is the default root composable that uses a BasePreferenceContainer and provides you with a common default layout that consists of an area for an icon, a title, a sub title and some content

Link copied to clipboard
fun PreferenceScope.BasePreferenceContainer(modifier: Modifier = Modifier, enabled: Dependency = Dependency.Enabled, visible: Dependency = Dependency.Enabled, onClick: () -> Unit? = null, onLongClick: () -> Unit? = null, itemStyle: PreferenceItemStyle = LocalPreferenceSettings.current.style.defaultItemStyle, filterTags: List<String> = emptyList(), content: @Composable (modifier: Modifier) -> Unit)

this is the root composable that MUST be used by all preferences!

Link copied to clipboard
fun PreferenceScope.BasePreferenceCustom(modifier: Modifier = Modifier, enabled: Dependency = Dependency.Enabled, visible: Dependency = Dependency.Enabled, onClick: () -> Unit? = null, onLongClick: () -> Unit? = null, itemStyle: PreferenceItemStyle = LocalPreferenceSettings.current.style.defaultItemStyle, itemSetup: PreferenceItemSetup = PreferenceItemSetup(), filterTags: List<String> = emptyList(), content: @Composable ColumnScope.() -> Unit)

this is the default root composable that uses a BasePreferenceContainer and provides you with a common default layout that consists of an area for an icon, a title, a sub title and some content

Link copied to clipboard
fun PreferenceScope.BasePreferenceDialog(dialogState: DialogStateNoData, dialog: @Composable (state: DialogStateNoData) -> Unit, title: String, enabled: Dependency = Dependency.Enabled, visible: Dependency = Dependency.Enabled, subtitle: String? = null, icon: @Composable () -> Unit? = null, itemStyle: PreferenceItemStyle = LocalPreferenceSettings.current.style.defaultItemStyle, itemSetup: PreferenceItemSetup = PreferenceInfoDefaults.itemSetup(), titleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, subtitleRenderer: @Composable (text: AnnotatedString) -> Unit = { Text(it) }, filterTags: List<String> = emptyList(), content: @Composable ColumnScope.() -> Unit? = null)

A dialog preference item

Link copied to clipboard
fun PreferenceContentText(text: String, itemSetup: PreferenceItemSetup, modifier: Modifier = Modifier, color: Color = Color.Unspecified, fontSize: TextUnit = TextUnit.Unspecified, fontStyle: FontStyle? = null, fontWeight: FontWeight? = null, fontFamily: FontFamily? = null, letterSpacing: TextUnit = TextUnit.Unspecified, textDecoration: TextDecoration? = null, lineHeight: TextUnit = TextUnit.Unspecified, softWrap: Boolean = true, minLines: Int = 1, onTextLayout: (TextLayoutResult) -> Unit = {}, style: TextStyle = LocalTextStyle.current)

this is the default text content composable for all preferences which does automatically apply all settings to this text (e.g. maxLines, alignment, ...)