Fix snackbars not disappearing
This commit is contained in:
parent
0e05373222
commit
52595b25fe
@ -8,6 +8,7 @@ import androidx.compose.material.ExperimentalMaterialApi
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.*
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.SnackbarDuration
|
||||
import androidx.compose.material3.SnackbarResult
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.*
|
||||
@ -288,7 +289,7 @@ fun AppItem(
|
||||
val result = snackbarHostState.showSnackbar(
|
||||
message = context.getString(R.string.msg_item_hidden, app.label),
|
||||
actionLabel = context.getString(R.string.action_undo),
|
||||
|
||||
duration = SnackbarDuration.Short,
|
||||
)
|
||||
if(result == SnackbarResult.ActionPerformed) {
|
||||
viewModel.unhide()
|
||||
|
||||
@ -9,10 +9,7 @@ import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.*
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.SnackbarResult
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
@ -209,7 +206,7 @@ fun CalendarItem(
|
||||
val result = snackbarHostState.showSnackbar(
|
||||
message = context.getString(R.string.msg_item_hidden, calendar.label),
|
||||
actionLabel = context.getString(R.string.action_undo),
|
||||
|
||||
duration = SnackbarDuration.Short,
|
||||
)
|
||||
if(result == SnackbarResult.ActionPerformed) {
|
||||
viewModel.unhide()
|
||||
|
||||
@ -10,10 +10,7 @@ import androidx.compose.foundation.lazy.LazyRow
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.rounded.*
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.SnackbarResult
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
@ -268,7 +265,7 @@ fun ContactItem(
|
||||
val result = snackbarHostState.showSnackbar(
|
||||
message = context.getString(R.string.msg_item_hidden, contact.label),
|
||||
actionLabel = context.getString(R.string.action_undo),
|
||||
|
||||
duration = SnackbarDuration.Short,
|
||||
)
|
||||
if(result == SnackbarResult.ActionPerformed) {
|
||||
viewModel.unhide()
|
||||
|
||||
@ -251,7 +251,7 @@ fun FileItem(
|
||||
val result = snackbarHostState.showSnackbar(
|
||||
message = context.getString(R.string.msg_item_hidden, file.label),
|
||||
actionLabel = context.getString(R.string.action_undo),
|
||||
|
||||
duration = SnackbarDuration.Short,
|
||||
)
|
||||
if(result == SnackbarResult.ActionPerformed) {
|
||||
viewModel.unhide()
|
||||
|
||||
@ -170,7 +170,7 @@ fun AppShortcutItem(
|
||||
val result = snackbarHostState.showSnackbar(
|
||||
message = context.getString(R.string.msg_item_hidden, shortcut.label),
|
||||
actionLabel = context.getString(R.string.action_undo),
|
||||
|
||||
duration = SnackbarDuration.Short,
|
||||
)
|
||||
if(result == SnackbarResult.ActionPerformed) {
|
||||
viewModel.unhide()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user