From cccd09fb5cb88a2b5f44dd104929431afa96d2a5 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 30 Apr 2022 09:43:49 -0400 Subject: [PATCH] Allow passing modifier to preference composables --- .../eu/kanade/presentation/components/Preferences.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/components/Preferences.kt b/app/src/main/java/eu/kanade/presentation/components/Preferences.kt index b3db495b2..d358f69cb 100644 --- a/app/src/main/java/eu/kanade/presentation/components/Preferences.kt +++ b/app/src/main/java/eu/kanade/presentation/components/Preferences.kt @@ -22,14 +22,18 @@ import eu.kanade.core.prefs.PreferenceMutableState import eu.kanade.presentation.util.horizontalPadding @Composable -fun Divider() { +fun Divider( + modifier: Modifier = Modifier, +) { androidx.compose.material3.Divider( + modifier = modifier, color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.2f), ) } @Composable fun PreferenceRow( + modifier: Modifier = Modifier, title: String, painter: Painter? = null, onClick: () -> Unit = {}, @@ -45,7 +49,7 @@ fun PreferenceRow( ) Row( - modifier = Modifier + modifier = modifier .fillMaxWidth() .heightIn(min = height) .combinedClickable( @@ -91,12 +95,14 @@ fun PreferenceRow( @Composable fun SwitchPreference( + modifier: Modifier = Modifier, preference: PreferenceMutableState, title: String, subtitle: String? = null, painter: Painter? = null, ) { PreferenceRow( + modifier = modifier, title = title, subtitle = subtitle, painter = painter,