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