feat: add tech stack information and app version display in SettingsScreen
This commit is contained in:
1 parent
10815300aa
commit
9559acf79a
5 files changed
+137
-37
No files matched your search
@@ -64,6 +64,18 @@ import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
private val TECH_STACK =
|
||||
listOf(
|
||||
"Language" to "Kotlin 2.2.21",
|
||||
"UI Toolkit" to "Jetpack Compose (BOM 2024.06.00)",
|
||||
"Design System" to "Material 3",
|
||||
"Local Database" to "Room 2.7.0",
|
||||
"Networking" to "Retrofit 2.9.0 / OkHttp 4.12.0",
|
||||
"Concurrency" to "Kotlin Coroutines 1.7.3",
|
||||
"Background Work" to "WorkManager 2.9.0",
|
||||
"Navigation" to "Navigation Compose 2.7.5",
|
||||
)
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun SettingsScreen(
|
||||
@@ -91,6 +103,14 @@ fun SettingsScreen(
|
||||
val syncIntervalMs by preferencesManager.syncPollIntervalMs.collectAsState()
|
||||
var syncIntervalInput by remember(syncIntervalMs) { mutableStateOf(syncIntervalMs.toString()) }
|
||||
var syncIntervalError by remember { mutableStateOf<String?>(null) }
|
||||
val appVersion =
|
||||
remember {
|
||||
try {
|
||||
context.packageManager.getPackageInfo(context.packageName, 0).versionName ?: "unknown"
|
||||
} catch (e: PackageManager.NameNotFoundException) {
|
||||
"unknown"
|
||||
}
|
||||
}
|
||||
// Authentication UI removed
|
||||
|
||||
// Permission launcher for Android 13+ notification permission
|
||||
@@ -466,6 +486,49 @@ fun SettingsScreen(
|
||||
}
|
||||
}
|
||||
|
||||
// About / Tech Stack
|
||||
Text(
|
||||
text = stringResource(R.string.about),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
)
|
||||
Card(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.surfaceVariant),
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.padding(12.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.app_version, appVersion),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
Text(
|
||||
text = stringResource(R.string.tech_stack),
|
||||
style = MaterialTheme.typography.labelSmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
TECH_STACK.forEach { (label, value) ->
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalArrangement = Arrangement.SpaceBetween,
|
||||
) {
|
||||
Text(
|
||||
text = label,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
Text(
|
||||
text = value,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
color = MaterialTheme.colorScheme.onSurface,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Leave Server section
|
||||
Text(
|
||||
text = stringResource(R.string.leave_server_section),
|
||||
|
||||
@@ -48,6 +48,9 @@
|
||||
<string name="notify_list_removed_desc">Notify when a list/table is deleted</string>
|
||||
<string name="notifications_footer">Notifications fire only when the app is in background or not visible.</string>
|
||||
<string name="open_logs">Open Logs</string>
|
||||
<string name="about">About</string>
|
||||
<string name="app_version">App version %1$s</string>
|
||||
<string name="tech_stack">Tech Stack</string>
|
||||
<string name="leave_server_section">Leave Server</string>
|
||||
<string name="leaving_removes_local_data">Leaving removes local data</string>
|
||||
<string name="disconnects_and_clears_db">Disconnects and clears local database</string>
|
||||
|
||||
Reference in new issue
Block a user