New-UI: add AboutScreen and SettingsScreen as tabs with proper titles, clickable email link, fixed padding issues, and restrict FAB to Home/Nearby

This commit is contained in:
2025-10-03 21:25:34 +02:00
parent 07f8c666be
commit 56aab1911d
2 changed files with 156 additions and 22 deletions

View File

@@ -74,6 +74,7 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.zIndex
import app.cash.sqldelight.coroutines.asFlow // SQLDelight coroutine-extensions (Flow-stöd för queries)
import app.cash.sqldelight.coroutines.mapToList // SQLDelight coroutine-extensions (Flow-stöd för queries)
import app.klottr.SettingsScreen
import app.klottr.create.CreateNoteOutcome
import app.klottr.create.QueueOutboxOutcome
import app.klottr.create.createNoteFlow
@@ -378,15 +379,17 @@ fun KlottrAppShell(
}
},
floatingActionButton = {
FloatingActionButton(
onClick = { showWrite = true }
) {
Icon(Icons.Filled.Add, contentDescription = "Klottra")
if (selectedTab in listOf("home", "nearby")) {
FloatingActionButton(
onClick = { showWrite = true }
) {
Icon(Icons.Filled.Add, contentDescription = "Klottra")
}
}
},
floatingActionButtonPosition = androidx.compose.material3.FabPosition.Center,
content = { innerPadding ->
if (selectedTab !in listOf("home", "nearby", "menu", "account", "about")) {
if (selectedTab !in listOf("home", "nearby", "menu", "account", "about", "settings")) {
selectedTab = "home"
}
// VIKTIGT: vi komponerar ALLA flikar alltid, och växlar bara synlighet.
@@ -776,6 +779,54 @@ fun KlottrAppShell(
.padding(horizontal = 16.dp, vertical = 0.dp) // egen padding, ingen top-padding
)
}
// === SETTINGS ===
Box(
modifier = Modifier
.fillMaxSize()
.alpha(if (selectedTab == "settings") 1f else 0f)
.zIndex(if (selectedTab == "settings") 1f else 0f)
) {
SettingsScreen(
onlyNew = onlyNew,
satellite = satellite,
night = night,
showCoords = showCoords,
onShowCoordsChanged = { SettingsStore.setShowCoordinates(it); showCoords = it },
useNewUi = useNewUi,
onUseNewUiChanged = { SettingsStore.setUseNewUi(it); useNewUi = it },
showKlotter = showKlotter,
showWiki = showWiki,
wikiRadius = wikiRadius,
showDm = showDm,
dmRadius = dmRadius,
showFornsok = showFornsok,
fornsokRadius = fornsokRadius,
onOnlyNewChanged = { SettingsStore.setOnlyNewHits(it); onlyNew = it },
onSatelliteChanged = { SettingsStore.setSatelliteMap(it); satellite = it },
onNightChanged = { SettingsStore.setNightMode(it); night = it },
onShowKlotterChanged = { SettingsStore.setShowKlotter(it); showKlotter = it },
onShowWikiChanged = { SettingsStore.setShowWikipedia(it); showWiki = it },
onWikiRadiusChanged = { SettingsStore.setWikiRadiusMeters(it); wikiRadius = it },
onShowDmChanged = { SettingsStore.setShowDigitaltMuseum(it); showDm = it },
onDmRadiusChanged = { SettingsStore.setDigitaltMuseumRadiusMeters(it); dmRadius = it },
onShowFornsokChanged = { SettingsStore.setShowFornsok(it); showFornsok = it },
onFornsokRadiusChanged = { SettingsStore.setFornsokRadiusMeters(it); fornsokRadius = it },
onClearFinds = {
FoundStore.clearAll()
forceEmptyFound = true
refreshFound()
FoundEvents.notifyFoundUpdated()
},
modifier = Modifier
.fillMaxSize()
.padding(
start = 16.dp,
end = 16.dp,
top = innerPadding.calculateTopPadding(), // 👈 respektera AppBar
bottom = innerPadding.calculateBottomPadding()
)
)
}
}
}
)