From e2eea61c6873ae67456d1bd042b2cbc1870dc926 Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 17 Jun 2024 14:09:30 +0930 Subject: [PATCH] Use Dimensions in AppBar --- .../java/org/thoughtcrime/securesms/ui/Dimensions.kt | 1 + .../org/thoughtcrime/securesms/ui/components/AppBar.kt | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/Dimensions.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/Dimensions.kt index 52ee6f915c..4c8fb38752 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/Dimensions.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/Dimensions.kt @@ -18,4 +18,5 @@ data class Dimensions( val marginMedium: Dp = 32.dp, val marginLarge: Dp = 64.dp, val dividerIndent: Dp = 80.dp, + val appBarHeight: Dp = 64.dp ) diff --git a/app/src/main/java/org/thoughtcrime/securesms/ui/components/AppBar.kt b/app/src/main/java/org/thoughtcrime/securesms/ui/components/AppBar.kt index 46fe1d8e20..1069275056 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/ui/components/AppBar.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/ui/components/AppBar.kt @@ -14,11 +14,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter -import androidx.compose.ui.unit.dp import network.loki.messenger.R -import org.thoughtcrime.securesms.ui.color.Colors +import org.thoughtcrime.securesms.ui.LocalDimensions import org.thoughtcrime.securesms.ui.PreviewTheme import org.thoughtcrime.securesms.ui.SessionColorsParameterProvider +import org.thoughtcrime.securesms.ui.color.Colors import org.thoughtcrime.securesms.ui.h4 @Preview @@ -33,8 +33,8 @@ fun AppBarPreview( @Composable fun AppBar(title: String, onClose: () -> Unit = {}, onBack: (() -> Unit)? = null) { - Row(modifier = Modifier.height(64.dp), verticalAlignment = Alignment.CenterVertically) { - Box(contentAlignment = Alignment.Center, modifier = Modifier.size(64.dp)) { + Row(modifier = Modifier.height(LocalDimensions.current.appBarHeight), verticalAlignment = Alignment.CenterVertically) { + Box(contentAlignment = Alignment.Center, modifier = Modifier.size(LocalDimensions.current.appBarHeight)) { onBack?.let { IconButton(onClick = it) { Icon(painter = painterResource(id = R.drawable.ic_prev), contentDescription = "back") @@ -44,7 +44,7 @@ fun AppBar(title: String, onClose: () -> Unit = {}, onBack: (() -> Unit)? = null Spacer(modifier = Modifier.weight(1f)) Text(text = title, style = h4) Spacer(modifier = Modifier.weight(1f)) - Box(contentAlignment = Alignment.Center, modifier = Modifier.size(64.dp)) { + Box(contentAlignment = Alignment.Center, modifier = Modifier.size(LocalDimensions.current.appBarHeight)) { IconButton(onClick = onClose) { Icon(painter = painterResource(id = R.drawable.ic_x), contentDescription = "close") }