Package-level declarations

Types

Link copied to clipboard
class MaterialThemePrefs(preferenceHelper: PreferenceHelper, darkColorPalette: Colors = darkColors(), lightColorPalette: Colors = lightColors()) : ThemePrefs

ThemePrefs implementation for Material (v1) theming. Provides colors that switch based on ThemeEnum (light/dark/system).

Properties

Link copied to clipboard

Returns Colors when this ThemePrefs is a MaterialThemePrefs; use inside Material theme scope.

Functions

Link copied to clipboard
fun MaterialAlertDialogContent(modifier: Modifier = Modifier, title: @Composable () -> Unit? = null, text: @Composable () -> Unit? = null, confirmButton: @Composable () -> Unit, dismissButton: @Composable () -> Unit? = null, shape: Shape = MaterialTheme.shapes.medium, backgroundColor: Color = MaterialTheme.colors.surface, contentColor: Color = contentColorFor(backgroundColor))
Link copied to clipboard
fun PreferableMaterialTheme(preferHelper: PreferenceHelper = rememberPreferenceHelper(), darkColorPalette: Colors = darkColors(), lightColorPalette: Colors = lightColors(), content: @Composable PreferableMaterialTheme.() -> Unit)

Material (v1) theme that respects stored light/dark preference and provides ThemePrefs via LocalThemePrefs.

Link copied to clipboard

Non-clickable list item used as a section header (icon + title in secondary style).

Link copied to clipboard
fun PreferenceItem(title: String, vector: ImageVector, onClick: () -> Unit = {}, secondaryText: @Composable () -> Unit? = null, trailing: @Composable () -> Unit? = null)

Clickable list row for a preference: icon, title, optional secondary/trailing content.

Link copied to clipboard

Radio group for selecting a ThemeEnum (Light, Dark, System default). Use inside theme dialogs.

Link copied to clipboard

Returns a MaterialThemePrefs remembered across recompositions using default rememberPreferenceHelper.

fun rememberThemePrefs(preferHelper: PreferenceHelper = rememberPreferenceHelper(), darkColorPalette: Colors = darkColors(), lightColorPalette: Colors = lightColors()): MaterialThemePrefs

Returns a MaterialThemePrefs with the given PreferenceHelper and color palettes.

Link copied to clipboard
fun SettingsScaffold(onBackClick: () -> Unit = {}, actions: @Composable RowScope.() -> Unit = {}, content: @Composable (PaddingValues) -> Unit)

Scaffold with a top app bar suitable for settings screens (back navigation + optional actions).

Link copied to clipboard
fun SettingsTopAppBar(onBackClick: () -> Unit = {}, actions: @Composable RowScope.() -> Unit = {}, localizedText: String = stringResource(Res.string.settings), backVector: ImageVector = Icons.AutoMirrored.Filled.ArrowBack)

Top app bar with back button and title for settings screens.

Link copied to clipboard
fun ThemeAlertDialog(themeState: MutableState<ThemeEnum> = themePrefs.themeState, writePref: (ThemeEnum) -> Unit = themePrefs.preferenceHelper.let { it::themeEnum::set }, dismissDialog: () -> Unit = {})

AlertDialog for selecting a theme. Should use directly in the composable destination that wants to show that dialog.

Link copied to clipboard
fun ThemeDialogContent(themeState: MutableState<ThemeEnum> = themePrefs.themeState, writePref: (ThemeEnum) -> Unit = themePrefs.preferenceHelper.let { it::themeEnum::set }, dismissDialog: () -> Unit = {})

Dialog layout for selecting a theme. Represents a separate screen. Should use in the dialog destination that will be hosted within a androidx.compose.ui.window.Dialog.

Link copied to clipboard
Link copied to clipboard
fun ThemePreferenceItem(themePrefs: ThemePrefs = LocalThemePrefs.current, onClick: () -> Unit = {})

List item that opens the theme picker when clicked. Shows current theme in secondary text.

Link copied to clipboard
@Preview(showBackground = true)
fun ThemePreferenceItemPreview()
Link copied to clipboard

List item used as a category header for the "Theme" section in preference screens.

Link copied to clipboard