From bfeaf717b79478f4742614ca1684c01f9139c125 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Thu, 29 Sep 2022 10:14:51 +0200 Subject: [PATCH] Improved light theme and removed unused property --- src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt | 7 ++----- .../kotlin/com/jetpackduba/gitnuro/theme/ColorsScheme.kt | 1 - src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt | 4 ---- .../gitnuro/ui/components/AdjustableOutlinedTextField.kt | 6 +++++- .../com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt | 5 ++++- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt index 2d14c00..72d73c6 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Color.kt @@ -13,11 +13,10 @@ val lightTheme = ColorsScheme( onError = Color(0xFFFFFFFF), background = Color(0xFFFFFFFF), backgroundSelected = Color(0xC0cee1f2), - surface = Color(0xFFe9ecf7), + surface = Color(0xFFf1f3fa), secondarySurface = Color(0xFFedeef2), - headerBackground = Color(0xFFF4F6FA), + headerBackground = Color(0xFFe9eaed), borderColor = Color(0xFF989898), - graphHeaderBackground = Color(0xFFF4F6FA), addFile = Color(0xFF32A852), deletedFile = Color(0xFFc93838), modifiedFile = Color(0xFF0070D8), @@ -46,7 +45,6 @@ val darkBlueTheme = ColorsScheme( secondarySurface = Color(0xFF1a2c40), headerBackground = Color(0xFF0a335c), borderColor = Color(0xFF989898), - graphHeaderBackground = Color(0xFF303132), addFile = Color(0xFF32A852), deletedFile = Color(0xFFc93838), modifiedFile = Color(0xFF0070D8), @@ -74,7 +72,6 @@ val darkGrayTheme = ColorsScheme( secondarySurface = Color(0xFF282d36), headerBackground = Color(0xFF21303d), borderColor = Color(0xFF989898), - graphHeaderBackground = Color(0xFF303132), addFile = Color(0xFF32A852), deletedFile = Color(0xFFc93838), modifiedFile = Color(0xFF0070D8), diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/ColorsScheme.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/ColorsScheme.kt index b9bd9fa..4503ba8 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/ColorsScheme.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/ColorsScheme.kt @@ -31,7 +31,6 @@ data class ColorsScheme( val headerBackground: Color, val onHeader: Color = primaryText, val borderColor: Color, - val graphHeaderBackground: Color, val addFile: Color, val deletedFile: Color, val modifiedFile: Color, diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt index c97be8e..f1c67a1 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/theme/Theme.kt @@ -53,10 +53,6 @@ val Colors.borderColor: Color val Colors.headerBackground: Color get() = appTheme.headerBackground -@get:Composable -val Colors.graphHeaderBackground: Color - get() = appTheme.graphHeaderBackground - @get:Composable val Colors.addFile: Color get() = appTheme.addFile diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/AdjustableOutlinedTextField.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/AdjustableOutlinedTextField.kt index 6af3ad3..f3a93e4 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/AdjustableOutlinedTextField.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/components/AdjustableOutlinedTextField.kt @@ -1,5 +1,6 @@ package com.jetpackduba.gitnuro.ui.components +import androidx.compose.foundation.background import androidx.compose.foundation.border import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box @@ -16,6 +17,7 @@ import androidx.compose.runtime.getValue import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Shape import androidx.compose.ui.graphics.SolidColor import androidx.compose.ui.graphics.takeOrElse @@ -37,6 +39,7 @@ fun AdjustableOutlinedTextField( textStyle: TextStyle = LocalTextStyle.current.copy(fontSize = MaterialTheme.typography.body1.fontSize), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, shape: Shape = RoundedCornerShape(4.dp), + backgroundColor: Color = MaterialTheme.colors.background ) { val textColor = textStyle.color.takeOrElse { colors.textColor(enabled).value @@ -47,7 +50,8 @@ fun AdjustableOutlinedTextField( BasicTextField( modifier = modifier - .heightIn(min = 48.dp), + .heightIn(min = 48.dp) + .background(backgroundColor), value = value, onValueChange = onValueChange, enabled = enabled, diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt index 91b2b68..6d09d16 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/dialogs/AuthorDialog.kt @@ -32,7 +32,10 @@ fun AuthorDialog( var name by remember(authorInfo) { mutableStateOf(authorInfo.name.orEmpty()) } var email by remember(authorInfo) { mutableStateOf(authorInfo.email.orEmpty()) } - MaterialDialog(onCloseRequested = onClose) { + MaterialDialog( + onCloseRequested = onClose, + background = MaterialTheme.colors.surface, + ) { Column( modifier = Modifier .padding(horizontal = 8.dp),