Change button colors in dark theme

This commit is contained in:
Sylwester Zieliński
2022-03-31 14:57:12 +02:00
parent c599c20696
commit b37e11d1cd
3 changed files with 13 additions and 11 deletions

View File

@@ -52,14 +52,14 @@ fun HomeScreen() {
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
FeatureButton(R.drawable.ic_bps, R.string.bps_module, R.string.bps_module_full) { FeatureButton(R.drawable.ic_gls, R.string.gls_module, R.string.gls_module_full) {
viewModel.openProfile(ProfileDestination.BPS) viewModel.openProfile(ProfileDestination.GLS)
} }
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
FeatureButton(R.drawable.ic_gls, R.string.gls_module, R.string.gls_module_full) { FeatureButton(R.drawable.ic_bps, R.string.bps_module, R.string.bps_module_full) {
viewModel.openProfile(ProfileDestination.GLS) viewModel.openProfile(ProfileDestination.BPS)
} }
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
@@ -96,14 +96,14 @@ fun HomeScreen() {
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
FeatureButton(R.drawable.ic_prx, R.string.prx_module, R.string.prx_module_full, state.isPRXModuleRunning) { FeatureButton(R.drawable.ic_cgm, R.string.cgm_module, R.string.cgm_module_full, state.isCGMModuleRunning) {
viewModel.openProfile(ProfileDestination.PRX) viewModel.openProfile(ProfileDestination.CGMS)
} }
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))
FeatureButton(R.drawable.ic_cgm, R.string.cgm_module, R.string.cgm_module_full, state.isCGMModuleRunning) { FeatureButton(R.drawable.ic_prx, R.string.prx_module, R.string.prx_module_full, state.isPRXModuleRunning) {
viewModel.openProfile(ProfileDestination.CGMS) viewModel.openProfile(ProfileDestination.PRX)
} }
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(16.dp))

View File

@@ -16,11 +16,11 @@
<string name="cgm_module">CGMS</string> <string name="cgm_module">CGMS</string>
<string name="cgm_module_full">Continuous Glucose</string> <string name="cgm_module_full">Continuous Glucose</string>
<string name="uart_module">UART</string> <string name="uart_module">UART</string>
<string name="uart_module_full">Serial port over BLE</string> <string name="uart_module_full">Universal Asynchronous Receiver/Transmitter (UART)</string>
<string name="dfu_module">DFU</string> <string name="dfu_module">DFU</string>
<string name="dfu_module_full">Device Firmware Update</string> <string name="dfu_module_full">Device Firmware Update</string>
<string name="dfu_module_info">Available in separate application.</string> <string name="dfu_module_info">Open DFU application.</string>
<string name="dfu_module_install">Install from Google Play Store.</string> <string name="dfu_module_install">Download from Google Play.</string>
<string name="viewmodel_profiles">ViewModel profiles</string> <string name="viewmodel_profiles">ViewModel profiles</string>
<string name="service_profiles">Service profiles</string> <string name="service_profiles">Service profiles</string>

View File

@@ -22,6 +22,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.ColorFilter
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@@ -90,6 +91,7 @@ internal fun UARTAddMacroDialog(macro: UARTMacro?, onEvent: (UARTViewEvent) -> U
Image( Image(
painter = painterResource(id = icon.toResId()), painter = painterResource(id = icon.toResId()),
contentDescription = stringResource(id = R.string.uart_macro_icon), contentDescription = stringResource(id = R.string.uart_macro_icon),
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onPrimary),
modifier = Modifier modifier = Modifier
.size(40.dp) .size(40.dp)
.clip(RoundedCornerShape(10.dp)) .clip(RoundedCornerShape(10.dp))