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,8 +13,8 @@ android {
|
|||||||
applicationId = "ru.kalinamall.seaca"
|
applicationId = "ru.kalinamall.seaca"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 9
|
versionCode = 10
|
||||||
versionName = "0.4.5"
|
versionName = "0.4.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import androidx.compose.material3.Button
|
|||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.CircularProgressIndicator
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.RadioButton
|
import androidx.compose.material3.RadioButton
|
||||||
|
import androidx.compose.material3.Surface
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.LaunchedEffect
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
@@ -212,56 +213,67 @@ fun DeviceScreen(repo: SacRepository, onLogout: () -> Unit) {
|
|||||||
deviceId = repo.session.getDeviceId()
|
deviceId = repo.session.getDeviceId()
|
||||||
}
|
}
|
||||||
|
|
||||||
Column(
|
Surface(
|
||||||
Modifier
|
modifier = Modifier.fillMaxSize(),
|
||||||
.fillMaxSize()
|
color = MaterialTheme.colorScheme.background,
|
||||||
.verticalScroll(rememberScrollState())
|
|
||||||
.padding(16.dp)
|
|
||||||
.navigationBarsPadding(),
|
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
|
||||||
) {
|
) {
|
||||||
Text("Моё устройство", style = MaterialTheme.typography.titleLarge)
|
Column(
|
||||||
Field("Сервер", baseUrl ?: "—")
|
Modifier
|
||||||
Field("Пользователь", username ?: "—")
|
.fillMaxSize()
|
||||||
Field("Роль", role ?: "—")
|
.verticalScroll(rememberScrollState())
|
||||||
Field("Device ID", deviceId.toString())
|
.padding(16.dp)
|
||||||
Field("Версия", ru.kalinamall.seaca.BuildConfig.VERSION_NAME)
|
.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(
|
Text(
|
||||||
stringResource(R.string.notification_mode_title),
|
stringResource(R.string.notification_mode_title),
|
||||||
style = MaterialTheme.typography.titleMedium,
|
style = MaterialTheme.typography.titleMedium,
|
||||||
modifier = Modifier.padding(top = 8.dp),
|
color = MaterialTheme.colorScheme.primary,
|
||||||
)
|
modifier = Modifier.padding(top = 8.dp),
|
||||||
NotificationMode.entries.forEach { mode ->
|
)
|
||||||
Row(
|
NotificationMode.entries.forEach { mode ->
|
||||||
Modifier
|
Row(
|
||||||
.fillMaxWidth()
|
Modifier
|
||||||
.padding(vertical = 2.dp),
|
.fillMaxWidth()
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
.padding(vertical = 2.dp),
|
||||||
) {
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
RadioButton(
|
) {
|
||||||
selected = notificationMode == mode,
|
RadioButton(
|
||||||
onClick = {
|
selected = notificationMode == mode,
|
||||||
scope.launch { repo.session.setNotificationMode(mode) }
|
onClick = {
|
||||||
},
|
scope.launch { repo.session.setNotificationMode(mode) }
|
||||||
)
|
},
|
||||||
Text(
|
)
|
||||||
mode.label,
|
Text(
|
||||||
modifier = Modifier.padding(start = 8.dp),
|
mode.label,
|
||||||
style = MaterialTheme.typography.bodyMedium,
|
modifier = Modifier.padding(start = 8.dp),
|
||||||
)
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
}
|
color = MaterialTheme.colorScheme.onSurface,
|
||||||
}
|
)
|
||||||
|
|
||||||
Button(
|
|
||||||
onClick = {
|
|
||||||
scope.launch {
|
|
||||||
repo.logout()
|
|
||||||
onLogout()
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
modifier = Modifier.fillMaxWidth(),
|
|
||||||
) { Text("Выйти") }
|
Button(
|
||||||
|
onClick = {
|
||||||
|
scope.launch {
|
||||||
|
repo.logout()
|
||||||
|
onLogout()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
) { Text("Выйти") }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user