Skip to content

Commit

Permalink
style: fix bad color combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
SuhasDissa committed Dec 10, 2023
1 parent 9e9da35 commit c080b8e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.material3.Divider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.surfaceColorAtElevation
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
Expand All @@ -35,7 +35,7 @@ fun ColumnScope.CalculatorDisplay(calculatorViewModel: CalculatorViewModel) {
.fillMaxWidth()
.weight(1.0f)
.clip(RoundedCornerShape(24.dp))
.background(MaterialTheme.colorScheme.surfaceVariant)
.background(MaterialTheme.colorScheme.surfaceColorAtElevation(10.dp))
) {
LazyColumn(
Modifier
Expand All @@ -55,16 +55,16 @@ fun ColumnScope.CalculatorDisplay(calculatorViewModel: CalculatorViewModel) {
},
textAlign = TextAlign.End,
style = MaterialTheme.typography.displaySmall,
color = MaterialTheme.colorScheme.onSurfaceVariant,
color = MaterialTheme.colorScheme.onSurface,
)
}
}
Divider(Modifier.fillMaxWidth())
val scroll = rememberScrollState()
Row(
Modifier
.fillMaxWidth()
.horizontalScroll(scroll),
.horizontalScroll(scroll)
.background(MaterialTheme.colorScheme.surfaceColorAtElevation(50.dp)),
horizontalArrangement = Arrangement.End
) {
BasicTextField(
Expand All @@ -79,7 +79,7 @@ fun ColumnScope.CalculatorDisplay(calculatorViewModel: CalculatorViewModel) {
textStyle = MaterialTheme.typography.displayMedium.plus(
TextStyle(
textAlign = TextAlign.End,
color = MaterialTheme.colorScheme.onSurfaceVariant
color = MaterialTheme.colorScheme.onSurface
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.compose.material.icons.rounded.Calculate
import androidx.compose.material.icons.rounded.KeyboardAlt
import androidx.compose.material.icons.rounded.WifiProtectedSetup
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalDrawerSheet
import androidx.compose.material3.NavigationDrawerItem
Expand Down Expand Up @@ -49,11 +50,12 @@ fun NavDrawerContent(
Icon(
modifier = Modifier.size(128.dp),
painter = painterResource(id = R.drawable.ic_launcher_monochrome),
contentDescription = null
contentDescription = null,
tint = LocalContentColor.current
)
Text(
stringResource(id = R.string.app_name),
color = MaterialTheme.colorScheme.primary,
color = LocalContentColor.current,
style = MaterialTheme.typography.titleLarge
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ fun KeyboardKey(
keyboardKey,
Modifier
.padding(4.dp),
style = MaterialTheme.typography.headlineSmall
style = MaterialTheme.typography.headlineSmall,
color = MaterialTheme.colorScheme.onPrimaryContainer

)
}
Expand Down Expand Up @@ -68,14 +69,16 @@ fun KeyboardSpecialKey(
Icon(
imageVector = icon,
contentDescription = keyboardKey,
modifier = Modifier.padding(horizontal = 16.dp)
modifier = Modifier.padding(horizontal = 16.dp),
tint = MaterialTheme.colorScheme.onPrimaryContainer
)
} else {
Text(
keyboardKey,
Modifier
.padding(vertical = 4.dp, horizontal = 16.dp),
style = MaterialTheme.typography.headlineSmall
style = MaterialTheme.typography.headlineSmall,
color = MaterialTheme.colorScheme.onPrimaryContainer
)
}
}
Expand Down

0 comments on commit c080b8e

Please sign in to comment.