Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 80 additions & 60 deletions app/src/main/kotlin/app/hypostats/ui/about/AboutScreen.kt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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()
}
}
}
}

Expand Down Expand Up @@ -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") },
)
}

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
<!-- About -->
<string name="about_privacy_policy">Ochrana osobních údajů</string>
<string name="about_desc">Jednoduché sledování a statistiky pro hypo</string>
<string name="about_dev">Vyvinul psfinaki</string>
<string name="about_source_code">Zdrojový kód</string>
<string name="about_report_issue">Nahlásit chybu</string>
<string name="about_contact_dev">Kontaktovat vývojáře</string>
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
<!-- About -->
<string name="about_privacy_policy">Privacy Policy</string>
<string name="about_desc">Simple tracking and stats for hypos</string>
<string name="about_dev">Developed by psfinaki</string>
<string name="about_source_code">Source Code</string>
<string name="about_report_issue">Report an Issue</string>
<string name="about_contact_dev">Contact the Developer</string>
Expand Down