New-UI: add AboutScreen tab and make contact email clickable with mailto link
This commit is contained in:
@@ -112,7 +112,7 @@ import app.klottr.platform.OutboxScheduler
|
||||
import app.klottr.platform.UiFeedback
|
||||
import app.klottr.platform.UiFeedbackDuration
|
||||
import app.klottr.platform.hasFgLocationPerms
|
||||
import app.klottr.ui.AboutDialog
|
||||
import app.klottr.ui.AboutScreen
|
||||
import app.klottr.ui.DmDialog
|
||||
import app.klottr.ui.FornsokDialog
|
||||
import app.klottr.ui.KlottrHomeContent
|
||||
@@ -386,7 +386,7 @@ fun KlottrAppShell(
|
||||
},
|
||||
floatingActionButtonPosition = androidx.compose.material3.FabPosition.Center,
|
||||
content = { innerPadding ->
|
||||
if (selectedTab !in listOf("home", "nearby", "menu", "account")) {
|
||||
if (selectedTab !in listOf("home", "nearby", "menu", "account", "about")) {
|
||||
selectedTab = "home"
|
||||
}
|
||||
// VIKTIGT: vi komponerar ALLA flikar alltid, och växlar bara synlighet.
|
||||
@@ -637,8 +637,8 @@ fun KlottrAppShell(
|
||||
) {
|
||||
items(
|
||||
listOf(
|
||||
Triple(Icons.Filled.Settings, "Inställningar") { showSettings = true },
|
||||
Triple(Icons.Filled.Info, "Om") { showAbout = true },
|
||||
Triple(Icons.Filled.Settings, "Inställningar") { selectedTab = "settings" },
|
||||
Triple(Icons.Filled.Info, "Om") { selectedTab = "about" },
|
||||
Triple(Icons.Filled.Person, "Konto") { selectedTab = "account" },
|
||||
Triple(Icons.Filled.Bookmark, "Bokmärken") { },
|
||||
Triple(Icons.Filled.Create, "Mitt klotter") { },
|
||||
@@ -763,6 +763,19 @@ fun KlottrAppShell(
|
||||
}
|
||||
)
|
||||
}
|
||||
// === ABOUT ===
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.alpha(if (selectedTab == "about") 1f else 0f)
|
||||
.zIndex(if (selectedTab == "about") 1f else 0f)
|
||||
) {
|
||||
AboutScreen(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(horizontal = 16.dp, vertical = 0.dp) // egen padding, ingen top-padding
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -1014,10 +1027,6 @@ fun KlottrAppShell(
|
||||
)
|
||||
}
|
||||
}
|
||||
// Om-appen
|
||||
if (showAbout) {
|
||||
AboutDialog { showAbout = false }
|
||||
}
|
||||
// Närliggande
|
||||
if (showNearby) {
|
||||
NearbyDialog(
|
||||
|
||||
@@ -2,6 +2,7 @@ package app.klottr.ui
|
||||
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.gestures.detectTransformGestures
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
@@ -42,6 +43,7 @@ import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import androidx.compose.ui.window.DialogProperties
|
||||
import app.klottr.platform.AppNavigator
|
||||
import app.klottr.platform.platformScreenHeightDp
|
||||
import app.klottr.nearby.FoundOpenAction
|
||||
import app.klottr.nearby.NearbyEntryShared
|
||||
@@ -374,3 +376,52 @@ fun ImageViewerDialog(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun AboutScreen(modifier: Modifier = Modifier) {
|
||||
val info = remember { appAboutInfo() } // platform provides
|
||||
Column(
|
||||
modifier = modifier
|
||||
.fillMaxSize()
|
||||
.padding(16.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally
|
||||
) {
|
||||
// Logotyp i toppen
|
||||
KlottrLogo(modifier = Modifier.height(64.dp))
|
||||
|
||||
Spacer(Modifier.height(16.dp))
|
||||
|
||||
Text("Om Klottr", style = MaterialTheme.typography.headlineMedium)
|
||||
|
||||
Spacer(Modifier.height(16.dp))
|
||||
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
horizontalAlignment = Alignment.Start,
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Text("Version ${info.versionName} (${info.buildType}) • build ${info.buildNumber}",
|
||||
style = MaterialTheme.typography.bodyMedium)
|
||||
Text("Byggd ${info.buildTimeUtc}", style = MaterialTheme.typography.bodyMedium)
|
||||
Text("Utvecklad av ${info.devBy}.", style = MaterialTheme.typography.bodyMedium)
|
||||
Text("iOS-ansvarig: ${info.iosLead}.", style = MaterialTheme.typography.bodyMedium)
|
||||
val email = info.contactEmail
|
||||
Row {
|
||||
Text(
|
||||
text = "Kontakt: ",
|
||||
style = MaterialTheme.typography.bodyMedium
|
||||
)
|
||||
Text(
|
||||
text = email,
|
||||
style = MaterialTheme.typography.bodyMedium.copy(
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
),
|
||||
modifier = Modifier.clickable {
|
||||
AppNavigator.openUrl("mailto:$email")
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user