Add About section with license, author, and source code link

This commit is contained in:
Pavel Baksy 2026-02-13 11:42:55 +01:00
parent 8086b4741f
commit 70a0f8e262

View File

@ -18,6 +18,8 @@
package cz.bugsy.karemote.ui.screens.settings package cz.bugsy.karemote.ui.screens.settings
import android.content.Intent
import android.net.Uri
import android.os.Build import android.os.Build
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.border 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.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material.icons.filled.Check 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.DarkMode
import androidx.compose.material.icons.filled.Info
import androidx.compose.material.icons.filled.LightMode import androidx.compose.material.icons.filled.LightMode
import androidx.compose.material.icons.filled.Palette import androidx.compose.material.icons.filled.Palette
import androidx.compose.material.icons.filled.PhoneAndroid 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.OutlinedTextField
import androidx.compose.material3.Scaffold import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable 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.Brush
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel import androidx.hilt.navigation.compose.hiltViewModel
@ -186,36 +192,67 @@ fun SettingsScreen(
Spacer(modifier = Modifier.height(24.dp)) Spacer(modifier = Modifier.height(24.dp))
// App Info // About
Card( SettingsSection(
modifier = Modifier.fillMaxWidth(), title = "About",
colors = CardDefaults.cardColors( icon = Icons.Default.Info
containerColor = MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.5f)
)
) { ) {
Column( val context = LocalContext.current
modifier = Modifier
.fillMaxWidth() Text(
.padding(16.dp), text = "KaRemote",
horizontalAlignment = Alignment.CenterHorizontally 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( TextButton(
text = "KaRemote", onClick = {
style = MaterialTheme.typography.titleMedium, val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://git.bugsy.cz/beval/karemote"))
fontWeight = FontWeight.Bold context.startActivity(intent)
) }
Spacer(modifier = Modifier.height(4.dp)) ) {
Text( Icon(
text = "Version 1.0", imageVector = Icons.Default.Code,
style = MaterialTheme.typography.bodySmall, contentDescription = null,
color = MaterialTheme.colorScheme.onSurfaceVariant modifier = Modifier.size(18.dp)
) )
Spacer(modifier = Modifier.height(4.dp)) Spacer(modifier = Modifier.width(4.dp))
Text( Text("Source Code")
text = "Remote control for Karadio32", }
style = MaterialTheme.typography.bodySmall, TextButton(
color = MaterialTheme.colorScheme.onSurfaceVariant onClick = {
) val intent = Intent(Intent.ACTION_VIEW, Uri.parse("https://www.gnu.org/licenses/gpl-3.0.html"))
context.startActivity(intent)
}
) {
Text("License")
}
} }
} }
} }