Remove useless bottom sheet buttons
This commit is contained in:
parent
b7abc4986d
commit
d8f11a04c7
@ -64,15 +64,6 @@ fun RestoreBackupSheet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dismissButton = if (state == RestoreBackupState.Ready && compatibility != BackupCompatibility.Incompatible) {
|
|
||||||
{
|
|
||||||
OutlinedButton(
|
|
||||||
onClick = onDismissRequest
|
|
||||||
) {
|
|
||||||
Text(stringResource(android.R.string.cancel))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else null
|
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package de.mm20.launcher2.ui.common
|
|||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
@ -38,19 +39,10 @@ fun WeatherLocationSearchDialog(
|
|||||||
text = stringResource(R.string.preference_location),
|
text = stringResource(R.string.preference_location),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
confirmButton = {
|
|
||||||
TextButton(
|
|
||||||
onClick = onDismissRequest,
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = stringResource(android.R.string.cancel),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
var query by remember { mutableStateOf("") }
|
var query by remember { mutableStateOf("") }
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier.fillMaxWidth().padding(it)
|
modifier = Modifier.fillMaxSize().padding(it)
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
Modifier.padding(bottom = 16.dp)
|
Modifier.padding(bottom = 16.dp)
|
||||||
|
|||||||
@ -28,7 +28,6 @@ import androidx.compose.material3.CircularProgressIndicator
|
|||||||
import androidx.compose.material3.DropdownMenu
|
import androidx.compose.material3.DropdownMenu
|
||||||
import androidx.compose.material3.DropdownMenuItem
|
import androidx.compose.material3.DropdownMenuItem
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedButton
|
import androidx.compose.material3.OutlinedButton
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
@ -87,17 +86,13 @@ fun CustomizeSearchableSheet(
|
|||||||
Text(stringResource(if (pickIcon) R.string.icon_picker_title else R.string.menu_customize))
|
Text(stringResource(if (pickIcon) R.string.icon_picker_title else R.string.menu_customize))
|
||||||
},
|
},
|
||||||
dismissible = { !pickIcon },
|
dismissible = { !pickIcon },
|
||||||
confirmButton = {
|
confirmButton = if (pickIcon) {
|
||||||
if (pickIcon) {
|
{
|
||||||
OutlinedButton(onClick = { viewModel.closeIconPicker() }) {
|
OutlinedButton(onClick = { viewModel.closeIconPicker() }) {
|
||||||
Text(stringResource(id = android.R.string.cancel))
|
Text(stringResource(id = android.R.string.cancel))
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
OutlinedButton(onClick = onDismiss) {
|
|
||||||
Text(stringResource(id = R.string.close))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} else null
|
||||||
) {
|
) {
|
||||||
if (!pickIcon) {
|
if (!pickIcon) {
|
||||||
Column(
|
Column(
|
||||||
@ -328,10 +323,12 @@ fun CustomizeSearchableSheet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
text = filterIconPack?.name ?: stringResource(id = R.string.icon_picker_filter_all_packs),
|
text = filterIconPack?.name
|
||||||
|
?: stringResource(id = R.string.icon_picker_filter_all_packs),
|
||||||
modifier = Modifier.animateContentSize()
|
modifier = Modifier.animateContentSize()
|
||||||
)
|
)
|
||||||
Icon(Icons.Rounded.ArrowDropDown,
|
Icon(
|
||||||
|
Icons.Rounded.ArrowDropDown,
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(start = ButtonDefaults.IconSpacing)
|
.padding(start = ButtonDefaults.IconSpacing)
|
||||||
.size(ButtonDefaults.IconSize),
|
.size(ButtonDefaults.IconSize),
|
||||||
|
|||||||
@ -118,17 +118,13 @@ fun EditFavoritesSheet(
|
|||||||
dismissible = {
|
dismissible = {
|
||||||
createShortcutTarget == null
|
createShortcutTarget == null
|
||||||
},
|
},
|
||||||
confirmButton = {
|
confirmButton = if (createShortcutTarget != null) {
|
||||||
if (createShortcutTarget != null) {
|
{
|
||||||
OutlinedButton(onClick = { viewModel.cancelPickShortcut() }) {
|
OutlinedButton(onClick = { viewModel.cancelPickShortcut() }) {
|
||||||
Text(stringResource(id = android.R.string.cancel))
|
Text(stringResource(id = android.R.string.cancel))
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
OutlinedButton(onClick = onDismiss) {
|
|
||||||
Text(stringResource(id = R.string.close))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} else null
|
||||||
) {
|
) {
|
||||||
if (loading) {
|
if (loading) {
|
||||||
Box(
|
Box(
|
||||||
|
|||||||
@ -45,11 +45,6 @@ fun HiddenItemsSheet(
|
|||||||
Icon(imageVector = Icons.Rounded.Edit, contentDescription = null)
|
Icon(imageVector = Icons.Rounded.Edit, contentDescription = null)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirmButton = {
|
|
||||||
OutlinedButton(onClick = onDismiss) {
|
|
||||||
Text(stringResource(id = R.string.close))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
SearchResultGrid(
|
SearchResultGrid(
|
||||||
|
|||||||
@ -77,15 +77,6 @@ fun CreateBackupSheet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dismissButton = if (state == CreateBackupState.Ready) {
|
|
||||||
{
|
|
||||||
OutlinedButton(
|
|
||||||
onClick = onDismissRequest
|
|
||||||
) {
|
|
||||||
Text(stringResource(android.R.string.cancel))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else null
|
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|||||||
@ -24,7 +24,6 @@ import androidx.compose.material.icons.Icons
|
|||||||
import androidx.compose.material.icons.rounded.Check
|
import androidx.compose.material.icons.rounded.Check
|
||||||
import androidx.compose.material.icons.rounded.Warning
|
import androidx.compose.material.icons.rounded.Warning
|
||||||
import androidx.compose.material3.Button
|
import androidx.compose.material3.Button
|
||||||
import androidx.compose.material3.Checkbox
|
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.OutlinedButton
|
import androidx.compose.material3.OutlinedButton
|
||||||
@ -77,31 +76,29 @@ fun EditTagSheet(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
confirmButton = {
|
confirmButton = if (viewModel.page == EditTagSheetPage.CustomizeTag) {
|
||||||
if (viewModel.page == EditTagSheetPage.CustomizeTag) {
|
null
|
||||||
OutlinedButton(onClick = {
|
} else if (isCreatingNewTag) {
|
||||||
viewModel.save()
|
{
|
||||||
onTagSaved(viewModel.tagName)
|
|
||||||
onDismiss()
|
|
||||||
}) {
|
|
||||||
Text(stringResource(R.string.close))
|
|
||||||
}
|
|
||||||
} else if (isCreatingNewTag) {
|
|
||||||
Button(
|
Button(
|
||||||
enabled = (viewModel.tagName.isNotBlank() && viewModel.page == EditTagSheetPage.CreateTag && !viewModel.tagNameExists)
|
enabled = (viewModel.tagName.isNotBlank() && viewModel.page == EditTagSheetPage.CreateTag && !viewModel.tagNameExists)
|
||||||
|| (viewModel.page == EditTagSheetPage.PickItems && viewModel.taggedItems.isNotEmpty()),
|
|| (viewModel.page == EditTagSheetPage.PickItems && viewModel.taggedItems.isNotEmpty()),
|
||||||
onClick = { viewModel.onClickContinue() }) {
|
onClick = { viewModel.onClickContinue() }) {
|
||||||
Text(stringResource(R.string.action_next))
|
Text(stringResource(R.string.action_next))
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
} else {
|
||||||
|
{
|
||||||
OutlinedButton(onClick = { viewModel.closeItemPicker() }) {
|
OutlinedButton(onClick = { viewModel.closeItemPicker() }) {
|
||||||
Text(stringResource(id = R.string.ok))
|
Text(stringResource(id = R.string.ok))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onDismissRequest = {
|
onDismissRequest = {
|
||||||
if (viewModel.page == EditTagSheetPage.CustomizeTag) viewModel.save()
|
if (viewModel.page == EditTagSheetPage.CustomizeTag) {
|
||||||
|
viewModel.save()
|
||||||
|
onTagSaved(viewModel.tagName)
|
||||||
|
}
|
||||||
onDismiss()
|
onDismiss()
|
||||||
},
|
},
|
||||||
dismissible = {
|
dismissible = {
|
||||||
@ -204,9 +201,11 @@ fun ListItem(
|
|||||||
ShapedLauncherIcon(
|
ShapedLauncherIcon(
|
||||||
icon = { icon },
|
icon = { icon },
|
||||||
size = 48.dp,
|
size = 48.dp,
|
||||||
modifier = Modifier.padding(4.dp).clickable {
|
modifier = Modifier
|
||||||
onTagChanged(!item.isTagged)
|
.padding(4.dp)
|
||||||
},
|
.clickable {
|
||||||
|
onTagChanged(!item.isTagged)
|
||||||
|
},
|
||||||
)
|
)
|
||||||
if (item.isTagged) {
|
if (item.isTagged) {
|
||||||
Surface(
|
Surface(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user