Share About content: add material-free KlottrAboutContent; use it inside Android AlertDialog

This commit is contained in:
2025-09-18 23:18:05 +02:00
parent 32afeb5a31
commit 9da472fd2d
2 changed files with 56 additions and 19 deletions

View File

@@ -0,0 +1,40 @@
package app.klottr.ui
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.text.BasicText
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
/**
* Material-fri About-layout. Android/iOS ger in header (t.ex. logotyp) och textraderna.
*/
@Composable
fun KlottrAboutContent(
header: @Composable () -> Unit,
lines: List<String>,
lineStyle: TextStyle,
spacingDp: Int = 12
) {
Column(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.Start
) {
// Header (t.ex. centrerad logga)
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center
) {
header()
}
Spacer(Modifier.height((spacingDp * 3).dp))
lines.forEachIndexed { i, s ->
if (i > 0) Spacer(Modifier.height(8.dp))
BasicText(s, style = lineStyle)
}
}
}