diff --git a/app/src/main/java/cz/bugsy/karemote/ui/screens/settings/SettingsScreen.kt b/app/src/main/java/cz/bugsy/karemote/ui/screens/settings/SettingsScreen.kt index f148649..9f433aa 100644 --- a/app/src/main/java/cz/bugsy/karemote/ui/screens/settings/SettingsScreen.kt +++ b/app/src/main/java/cz/bugsy/karemote/ui/screens/settings/SettingsScreen.kt @@ -18,6 +18,8 @@ package cz.bugsy.karemote.ui.screens.settings +import android.content.Intent +import android.net.Uri import android.os.Build import androidx.compose.foundation.background import androidx.compose.foundation.border @@ -40,7 +42,9 @@ import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material.icons.filled.Check +import androidx.compose.material.icons.filled.Code import androidx.compose.material.icons.filled.DarkMode +import androidx.compose.material.icons.filled.Info import androidx.compose.material.icons.filled.LightMode import androidx.compose.material.icons.filled.Palette import androidx.compose.material.icons.filled.PhoneAndroid @@ -56,6 +60,7 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.OutlinedTextField import androidx.compose.material3.Scaffold import androidx.compose.material3.Text +import androidx.compose.material3.TextButton import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable @@ -66,6 +71,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Brush import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel @@ -186,36 +192,67 @@ fun SettingsScreen( Spacer(modifier = Modifier.height(24.dp)) - // App Info - Card( - modifier = Modifier.fillMaxWidth(), - colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.5f) - ) + // About + SettingsSection( + title = "About", + icon = Icons.Default.Info ) { - Column( - modifier = Modifier - .fillMaxWidth() - .padding(16.dp), - horizontalAlignment = Alignment.CenterHorizontally + val context = LocalContext.current + + Text( + text = "KaRemote", + style = MaterialTheme.typography.titleMedium, + fontWeight = FontWeight.Bold + ) + Spacer(modifier = Modifier.height(4.dp)) + Text( + text = "Version 1.0", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + Spacer(modifier = Modifier.height(4.dp)) + Text( + text = "Remote control for Karadio32", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + Spacer(modifier = Modifier.height(8.dp)) + Text( + text = "Copyright \u00A9 2026 Pavel Baksy", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + Text( + text = "Licensed under GNU GPLv3 or later", + style = MaterialTheme.typography.bodySmall, + color = MaterialTheme.colorScheme.onSurfaceVariant + ) + Spacer(modifier = Modifier.height(8.dp)) + Row( + horizontalArrangement = Arrangement.spacedBy(8.dp) ) { - Text( - text = "KaRemote", - style = MaterialTheme.typography.titleMedium, - fontWeight = FontWeight.Bold - ) - Spacer(modifier = Modifier.height(4.dp)) - Text( - text = "Version 1.0", - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant - ) - Spacer(modifier = Modifier.height(4.dp)) - Text( - text = "Remote control for Karadio32", - style = MaterialTheme.typography.bodySmall, - color = MaterialTheme.colorScheme.onSurfaceVariant - ) + TextButton( + onClick = { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://git.bugsy.cz/beval/karemote")) + context.startActivity(intent) + } + ) { + Icon( + imageVector = Icons.Default.Code, + contentDescription = null, + modifier = Modifier.size(18.dp) + ) + Spacer(modifier = Modifier.width(4.dp)) + Text("Source Code") + } + TextButton( + onClick = { + val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.gnu.org/licenses/gpl-3.0.html")) + context.startActivity(intent) + } + ) { + Text("License") + } } } }