From 2f29f76f0d117dba5d6ae4ed77e733ebf82c3a90 Mon Sep 17 00:00:00 2001 From: Petr Date: Tue, 30 Dec 2025 00:48:20 +0100 Subject: [PATCH] Rework dev link --- .../app/hypostats/ui/about/AboutScreen.kt | 140 ++++++++++-------- app/src/main/res/values-cs/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 3 files changed, 80 insertions(+), 62 deletions(-) diff --git a/app/src/main/kotlin/app/hypostats/ui/about/AboutScreen.kt b/app/src/main/kotlin/app/hypostats/ui/about/AboutScreen.kt index 2f79db6..3bd1925 100644 --- a/app/src/main/kotlin/app/hypostats/ui/about/AboutScreen.kt +++ b/app/src/main/kotlin/app/hypostats/ui/about/AboutScreen.kt @@ -1,9 +1,13 @@ package app.hypostats.ui.about +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll @@ -15,6 +19,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.res.stringResource +import androidx.compose.ui.semantics.Role import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import app.hypostats.BuildConfig @@ -23,64 +28,73 @@ import app.hypostats.R @Composable fun AboutScreen() { val uriHandler = LocalUriHandler.current - Column( - modifier = - Modifier - .fillMaxSize() - .verticalScroll(rememberScrollState()) - .padding(16.dp), - horizontalAlignment = Alignment.CenterHorizontally, - ) { - AboutHeader() - - HorizontalDivider() - - AboutLinkItem( - text = stringResource(R.string.about_source_code), - onClick = { - uriHandler.openUri("https://github.com/psfinaki/HypoStats") - }, - ) - - HorizontalDivider() - - AboutLinkItem( - text = stringResource(R.string.about_report_issue), - onClick = { - uriHandler.openUri("https://github.com/psfinaki/HypoStats/issues") - }, - ) - - HorizontalDivider() - - AboutLinkItem( - text = stringResource(R.string.about_contact_dev), - onClick = { - uriHandler.openUri("mailto:info@psfinaki.dev") - }, - ) - - HorizontalDivider() - - AboutLinkItem( - text = stringResource(R.string.about_privacy_policy), - onClick = { - uriHandler.openUri("https://github.com/psfinaki/HypoStats/blob/main/PRIVACY.md") - }, - ) - - HorizontalDivider() - - AboutLinkItem( - text = stringResource(R.string.about_support_app), - onClick = { - uriHandler.openUri("https://buymeacoffee.com/psfinaki") - }, - ) - - HorizontalDivider() - - AboutFooter() + BoxWithConstraints(modifier = Modifier.fillMaxSize()) { + val screenHeight = maxHeight + Column( + modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()), + ) { + Column( + modifier = + Modifier + .fillMaxWidth() + .heightIn(min = screenHeight) + .padding(16.dp), + horizontalAlignment = Alignment.CenterHorizontally, + ) { + AboutHeader() + + HorizontalDivider() + + AboutLinkItem( + text = stringResource(R.string.about_source_code), + onClick = { + uriHandler.openUri("https://github.com/psfinaki/HypoStats") + }, + ) + + HorizontalDivider() + + AboutLinkItem( + text = stringResource(R.string.about_report_issue), + onClick = { + uriHandler.openUri("https://github.com/psfinaki/HypoStats/issues") + }, + ) + + HorizontalDivider() + + AboutLinkItem( + text = stringResource(R.string.about_contact_dev), + onClick = { + uriHandler.openUri("mailto:info@psfinaki.dev") + }, + ) + + HorizontalDivider() + + AboutLinkItem( + text = stringResource(R.string.about_privacy_policy), + onClick = { + uriHandler.openUri("https://github.com/psfinaki/HypoStats/blob/main/PRIVACY.md") + }, + ) + + HorizontalDivider() + + AboutLinkItem( + text = stringResource(R.string.about_support_app), + onClick = { + uriHandler.openUri("https://buymeacoffee.com/psfinaki") + }, + ) + + HorizontalDivider() + + Spacer(modifier = Modifier.weight(1f)) + + AboutFooter() + } + } } } @@ -110,12 +124,18 @@ private fun AboutHeader() { @Composable private fun AboutFooter() { + val uriHandler = LocalUriHandler.current + Spacer(modifier = Modifier.height(32.dp)) Text( - text = stringResource(R.string.about_dev), + text = "psfinaki.dev", style = MaterialTheme.typography.bodyMedium, - modifier = Modifier.padding(vertical = 16.dp), + color = MaterialTheme.colorScheme.primary, + modifier = + Modifier + .padding(vertical = 16.dp) + .clickable(role = Role.Button) { uriHandler.openUri("https://psfinaki.dev") }, ) } diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index c4fdfeb..1282e5e 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -68,7 +68,6 @@ Ochrana osobních údajů Jednoduché sledování a statistiky pro hypo - Vyvinul psfinaki Zdrojový kód Nahlásit chybu Kontaktovat vývojáře diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 68fecce..dc524b9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -68,7 +68,6 @@ Privacy Policy Simple tracking and stats for hypos - Developed by psfinaki Source Code Report an Issue Contact the Developer