Show overflow on long text.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -16,6 +16,7 @@ import androidx.compose.ui.Alignment.Companion.End
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.InspectableModifier
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.dp
|
||||
import me.zobrist.tichucounter.R
|
||||
@@ -81,18 +82,13 @@ fun SettingsView(
|
||||
fun BooleanSetting(name: String, value: Boolean, updateValue: (Boolean) -> Unit) {
|
||||
|
||||
Row(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
.padding(20.dp)) {
|
||||
Column() {
|
||||
Text(name, style = MaterialTheme.typography.bodyLarge)
|
||||
Text(value.toString(), style = MaterialTheme.typography.labelLarge)
|
||||
Modifier.padding(20.dp).fillMaxWidth()) {
|
||||
Column(Modifier.weight(5f)) {
|
||||
Text(name, maxLines = 1, style = MaterialTheme.typography.bodyLarge, overflow = TextOverflow.Ellipsis)
|
||||
Text(stringResource(if(value) R.string.on else R.string.off), style = MaterialTheme.typography.labelLarge)
|
||||
|
||||
}
|
||||
Column(
|
||||
Modifier
|
||||
.fillMaxWidth()
|
||||
)
|
||||
Column(Modifier.weight(1f))
|
||||
{
|
||||
Switch(
|
||||
checked = value,
|
||||
@@ -102,7 +98,6 @@ fun BooleanSetting(name: String, value: Boolean, updateValue: (Boolean) -> Unit)
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun <T> StringSetting(name: String, map: Map<T, Int>, selected: T, onSelected: (T) -> Unit) {
|
||||
|
||||
@@ -113,18 +108,16 @@ fun <T> StringSetting(name: String, map: Map<T, Int>, selected: T, onSelected: (
|
||||
.fillMaxWidth()
|
||||
.padding(20.dp)
|
||||
.clickable { expanded = true }) {
|
||||
Column() {
|
||||
Text(name, style = MaterialTheme.typography.bodyLarge)
|
||||
Column(Modifier.weight(5f)) {
|
||||
Text(name, style = MaterialTheme.typography.bodyLarge, overflow = TextOverflow.Ellipsis)
|
||||
Text(stringResource(map[selected]!!), style = MaterialTheme.typography.labelLarge)
|
||||
}
|
||||
|
||||
Column(
|
||||
Modifier
|
||||
.fillMaxWidth()) {
|
||||
Column(Modifier.weight(1f)) {
|
||||
Icon(
|
||||
Icons.Outlined.ArrowDropDown,
|
||||
contentDescription = null,
|
||||
modifier = Modifier.align(End),)
|
||||
modifier = Modifier.align(End))
|
||||
}
|
||||
|
||||
DropdownMenu(
|
||||
|
||||
Reference in New Issue
Block a user