mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2026-01-10 02:04:26 +01:00
Change macro screen button size and layout
This commit is contained in:
@@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material3.AlertDialog
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextButton
|
||||
@@ -17,40 +18,16 @@ import androidx.compose.ui.graphics.ColorFilter
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
import no.nordicsemi.android.material.you.Card
|
||||
import no.nordicsemi.android.theme.R
|
||||
|
||||
@Composable
|
||||
fun StringListDialog(config: StringListDialogConfig) {
|
||||
Dialog(onDismissRequest = { config.onResult(FlowCanceled) }) {
|
||||
StringListView(config)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun StringListView(config: StringListDialogConfig) {
|
||||
Card(
|
||||
modifier = Modifier.height(300.dp),
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.padding(16.dp),
|
||||
verticalArrangement = Arrangement.SpaceBetween
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
Text(
|
||||
text = config.title ?: stringResource(id = R.string.dialog).toAnnotatedString(),
|
||||
style = MaterialTheme.typography.headlineMedium
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.size(8.dp))
|
||||
|
||||
AlertDialog(
|
||||
onDismissRequest = { config.onResult(FlowCanceled) },
|
||||
title = { Text(text = config.title ?: stringResource(id = R.string.dialog).toAnnotatedString()) },
|
||||
text = {
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxHeight(0.8f)
|
||||
.verticalScroll(rememberScrollState())
|
||||
) {
|
||||
|
||||
@@ -78,17 +55,13 @@ fun StringListView(config: StringListDialogConfig) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.End
|
||||
) {
|
||||
TextButton(onClick = { config.onResult(FlowCanceled) }) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.cancel),
|
||||
)
|
||||
}
|
||||
},
|
||||
confirmButton = {
|
||||
TextButton(onClick = { config.onResult(FlowCanceled) }) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.cancel),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user