Package-level declarations

Types

Link copied to clipboard
class JchuPlainPreferenceColors(val contentColor: Color = Color.DarkGray, val containerColor: Color = Color.White.copy(alpha = .2f))
Link copied to clipboard
class JchuSwitchPreferenceColors(val contentColor: Color = Color.DarkGray, val containerColor: Color = Color.White.copy(alpha = .2f))
Link copied to clipboard
class PreferenceChoiceColors(val selectedRadioColor: Color = Color.DarkGray, val unselectedRadioColor: Color = Color.DarkGray, val containerColor: Color = Color.White, val contentColor: Color = Color.DarkGray)
Link copied to clipboard
class SwitchWithContainerColors(val iconEnabled: Color = artichoke, val iconDisabled: Color = cosmicLatte, val textEnabled: Color = artichoke, val textDisabled: Color = cosmicLatte, val backgroundEnabled: Color = cosmicLatte, val backgroundDisabled: Color = artichoke)

Functions

Link copied to clipboard
fun JchuPlainPreference(title: String, navigationContentDescription: String, modifier: Modifier = Modifier, @DrawableRes icon: Int? = null, colors: JchuPlainPreferenceColors = JchuPlainPreferenceColors(), subtitle: String? = null, onClick: () -> Unit)

Faithful port of iNook's plain preference row.

Link copied to clipboard
fun JchuPreferenceChoice(title: String, selected: Boolean, onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shape: Shape = MaterialTheme.shapes.large, containerColor: Color = MaterialTheme.colorScheme.surface, contentColor: Color = MaterialTheme.colorScheme.onSurface, radioColors: RadioButtonColors = RadioButtonDefaults.colors(), titleStyle: TextStyle = MaterialTheme.typography.titleMedium, contentPadding: PaddingValues = PaddingValues(horizontal = 16.dp, vertical = 14.dp))

A single-choice preference row with one selectable semantics node.

Link copied to clipboard
fun JchuPreferenceItem(title: String, onClick: () -> Unit, modifier: Modifier = Modifier, description: String? = null, enabled: Boolean = true, containerColor: Color = MaterialTheme.colorScheme.surface, contentColor: Color = MaterialTheme.colorScheme.onSurface, titleStyle: TextStyle = MaterialTheme.typography.titleMedium, descriptionStyle: TextStyle = MaterialTheme.typography.bodyMedium, onClickLabel: String? = null, onLongClickLabel: String? = null, onLongClick: () -> Unit? = null, leadingContent: @Composable () -> Unit? = null, trailingContent: @Composable RowScope.() -> Unit? = null)

A controlled preference row with typed composable slots for leading and trailing content.

Link copied to clipboard
fun JchuPreferenceSwitch(title: String, checked: Boolean, onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, description: String? = null, enabled: Boolean = true, containerColor: Color = MaterialTheme.colorScheme.surface, contentColor: Color = MaterialTheme.colorScheme.onSurface, switchColors: SwitchColors = SwitchDefaults.colors(), titleStyle: TextStyle = MaterialTheme.typography.titleMedium, descriptionStyle: TextStyle = MaterialTheme.typography.bodyMedium, leadingContent: @Composable () -> Unit? = null, checkedIcon: ImageVector? = null)

A preference row whose checked state is owned by the caller.

Link copied to clipboard
fun JchuSwitchPreference(title: String, value: Boolean, darkTheme: Boolean, modifier: Modifier = Modifier, painter: Painter? = null, subtitle: String? = null, onValueChange: (Boolean) -> Unit, colors: JchuSwitchPreferenceColors = JchuSwitchPreferenceColors())

Faithful painter-icon port of iNook's switch preference row.

fun JchuSwitchPreference(title: String, value: Boolean, darkTheme: Boolean, modifier: Modifier = Modifier, subtitle: String? = null, imageVector: ImageVector? = null, onValueChange: (Boolean) -> Unit, colors: JchuSwitchPreferenceColors = JchuSwitchPreferenceColors())

Faithful vector-icon port of iNook's switch preference row.

Link copied to clipboard
fun PreferenceItem(title: String, description: String? = null, icon: Any? = null, enabled: Boolean = true, containerColor: Color = Color.White, contentColor: Color = Color.DarkGray, onLongClickLabel: String? = null, onLongClick: () -> Unit? = null, onClickLabel: String? = null, titleStyle: TextStyle = MaterialTheme.typography.titleLarge, descriptionStyle: TextStyle = MaterialTheme.typography.bodyMedium, onClick: () -> Unit = {})

Compatibility wrapper for JchuPreferenceItem.

Link copied to clipboard
fun PreferencesHintCard(title: String = "Title ".repeat(2), description: String? = "Description text ".repeat(3), style: TextStyle = MaterialTheme.typography.titleLarge, icon: ImageVector? = Icons.Outlined.Translate, isDarkTheme: Boolean = false, backgroundColor: Color = MaterialTheme.colorScheme.run { if (isDarkTheme) onPrimaryContainer else secondaryContainer }, contentColor: Color = MaterialTheme.colorScheme.run { if (isDarkTheme) surface else onSecondaryContainer }, onClick: () -> Unit = {})
Link copied to clipboard
fun PreferenceSingleChoiceItem(modifier: Modifier = Modifier, text: String, selected: Boolean, shape: Shape = 15.cornerRadius(), style: TextStyle = MaterialTheme.typography.titleLarge, colors: PreferenceChoiceColors = PreferenceChoiceColors(), contentPadding: PaddingValues = PaddingValues(horizontal = 8.dp, vertical = 18.dp), onClick: () -> Unit)

Compatibility wrapper for JchuPreferenceChoice.

Link copied to clipboard
fun PreferenceSwitch(title: String, description: String? = null, icon: ImageVector? = null, enabled: Boolean = true, isChecked: Boolean = true, containerColor: Color = Color.White, contentColor: Color = Color.DarkGray, colors: SwitchColors = SwitchDefaults.colors(), checkedIcon: ImageVector = Icons.Outlined.Check, titleStyle: TextStyle = MaterialTheme.typography.titleLarge, descriptionStyle: TextStyle = MaterialTheme.typography.bodyMedium, onClick: () -> Unit = {})

Compatibility wrapper for JchuPreferenceSwitch.

Link copied to clipboard
fun PreferenceSwitchWithContainer(title: String, style: TextStyle = MaterialTheme.typography.titleLarge, icon: ImageVector? = null, colors: SwitchWithContainerColors = SwitchWithContainerColors(), switchColors: SwitchColors = SwitchDefaults.colors(), isChecked: Boolean, onClick: () -> Unit)