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