Share About content: add material-free KlottrAboutContent; use it inside Android AlertDialog
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user