fix: readable push notification settings on device screen (0.4.6)
Use explicit onSurface/primary text colors and a themed Surface background. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.RadioButton
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
@@ -212,56 +213,67 @@ fun DeviceScreen(repo: SacRepository, onLogout: () -> Unit) {
|
||||
deviceId = repo.session.getDeviceId()
|
||||
}
|
||||
|
||||
Column(
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.verticalScroll(rememberScrollState())
|
||||
.padding(16.dp)
|
||||
.navigationBarsPadding(),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
Surface(
|
||||
modifier = Modifier.fillMaxSize(),
|
||||
color = MaterialTheme.colorScheme.background,
|
||||
) {
|
||||
Text("Моё устройство", style = MaterialTheme.typography.titleLarge)
|
||||
Field("Сервер", baseUrl ?: "—")
|
||||
Field("Пользователь", username ?: "—")
|
||||
Field("Роль", role ?: "—")
|
||||
Field("Device ID", deviceId.toString())
|
||||
Field("Версия", ru.kalinamall.seaca.BuildConfig.VERSION_NAME)
|
||||
Column(
|
||||
Modifier
|
||||
.fillMaxSize()
|
||||
.verticalScroll(rememberScrollState())
|
||||
.padding(16.dp)
|
||||
.navigationBarsPadding(),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
Text(
|
||||
"Моё устройство",
|
||||
style = MaterialTheme.typography.titleLarge,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
Field("Сервер", baseUrl ?: "—")
|
||||
Field("Пользователь", username ?: "—")
|
||||
Field("Роль", role ?: "—")
|
||||
Field("Device ID", deviceId.toString())
|
||||
Field("Версия", ru.kalinamall.seaca.BuildConfig.VERSION_NAME)
|
||||
|
||||
Text(
|
||||
stringResource(R.string.notification_mode_title),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
modifier = Modifier.padding(top = 8.dp),
|
||||
)
|
||||
NotificationMode.entries.forEach { mode ->
|
||||
Row(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 2.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
RadioButton(
|
||||
selected = notificationMode == mode,
|
||||
onClick = {
|
||||
scope.launch { repo.session.setNotificationMode(mode) }
|
||||
},
|
||||
)
|
||||
Text(
|
||||
mode.label,
|
||||
modifier = Modifier.padding(start = 8.dp),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = {
|
||||
scope.launch {
|
||||
repo.logout()
|
||||
onLogout()
|
||||
Text(
|
||||
stringResource(R.string.notification_mode_title),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
color = MaterialTheme.colorScheme.primary,
|
||||
modifier = Modifier.padding(top = 8.dp),
|
||||
)
|
||||
NotificationMode.entries.forEach { mode ->
|
||||
Row(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(vertical = 2.dp),
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
) {
|
||||
RadioButton(
|
||||
selected = notificationMode == mode,
|
||||
onClick = {
|
||||
scope.launch { repo.session.setNotificationMode(mode) }
|
||||
},
|
||||
)
|
||||
Text(
|
||||
mode.label,
|
||||
modifier = Modifier.padding(start = 8.dp),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
}
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) { Text("Выйти") }
|
||||
}
|
||||
|
||||
Button(
|
||||
onClick = {
|
||||
scope.launch {
|
||||
repo.logout()
|
||||
onLogout()
|
||||
}
|
||||
},
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) { Text("Выйти") }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user