From 1214357e377ee2492e4ded792f302a6515eb53d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=BBerko?= Date: Mon, 2 Oct 2023 13:15:33 +0200 Subject: [PATCH] fix: implemented new swieable snackbar to avoid crashes when closing screen --- .../com/wire/android/WireApplication.kt | 2 +- .../com/wire/android/ui/WireActivity.kt | 2 +- .../ui/common/scaffold/WireScaffold.kt | 24 ++-- .../snackbar/LocalSnackbarHostState.kt | 2 +- .../common/snackbar/SwipeDismissSnackbar.kt | 82 ------------- .../ui/common/snackbar/SwipeableSnackbar.kt | 114 ++++++++++++++++++ .../ui/{ => common}/snackbar/WireSnackbar.kt | 2 +- .../ui/connection/ConnectionActionButton.kt | 4 +- .../wire/android/ui/home/HomeStateHolder.kt | 2 +- .../home/conversations/ConversationScreen.kt | 17 ++- .../conversations/ConversationScreenState.kt | 2 +- .../details/GroupConversationDetailsScreen.kt | 2 +- .../editguestaccess/EditGuestAccessScreen.kt | 2 +- .../home/gallery/MediaGalleryScreenState.kt | 2 +- .../recordaudio/RecordAudioComponent.kt | 2 +- .../NewConversationSearchPeopleScreen.kt | 2 +- .../home/settings/account/MyAccountScreen.kt | 2 +- .../devices/DeviceDetailsScreenState.kt | 2 +- .../ui/sharing/ImportMediaScreenState.kt | 2 +- .../avatarpicker/AvatarPickerState.kt | 2 +- .../other/OtherUserProfileScreen.kt | 2 +- .../other/OtherUserProfileScreenState.kt | 2 +- .../userprofile/self/SelfUserProfileScreen.kt | 2 +- .../service/ServiceDetailsScreen.kt | 2 +- 24 files changed, 163 insertions(+), 116 deletions(-) rename app/src/main/kotlin/com/wire/android/ui/{ => common}/snackbar/LocalSnackbarHostState.kt (95%) delete mode 100644 app/src/main/kotlin/com/wire/android/ui/common/snackbar/SwipeDismissSnackbar.kt create mode 100644 app/src/main/kotlin/com/wire/android/ui/common/snackbar/SwipeableSnackbar.kt rename app/src/main/kotlin/com/wire/android/ui/{ => common}/snackbar/WireSnackbar.kt (96%) diff --git a/app/src/main/kotlin/com/wire/android/WireApplication.kt b/app/src/main/kotlin/com/wire/android/WireApplication.kt index 5da7df6a04f..58a24257a3e 100644 --- a/app/src/main/kotlin/com/wire/android/WireApplication.kt +++ b/app/src/main/kotlin/com/wire/android/WireApplication.kt @@ -112,7 +112,7 @@ class WireApplication : Application(), Configuration.Provider { .detectDiskReads() .detectDiskWrites() .penaltyLog() - .penaltyDeath() +// .penaltyDeath() .build() ) StrictMode.setVmPolicy( diff --git a/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt b/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt index 4c5557b3831..7a5367357d2 100644 --- a/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt +++ b/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt @@ -79,7 +79,7 @@ import com.wire.android.ui.destinations.WelcomeScreenDestination import com.wire.android.ui.home.E2EIRequiredDialog import com.wire.android.ui.home.E2EISnoozeDialog import com.wire.android.ui.home.sync.FeatureFlagNotificationViewModel -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.theme.WireTheme import com.wire.android.util.CurrentScreenManager import com.wire.android.util.LocalSyncStateObserver diff --git a/app/src/main/kotlin/com/wire/android/ui/common/scaffold/WireScaffold.kt b/app/src/main/kotlin/com/wire/android/ui/common/scaffold/WireScaffold.kt index ce1f7385de6..5577006d118 100644 --- a/app/src/main/kotlin/com/wire/android/ui/common/scaffold/WireScaffold.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/scaffold/WireScaffold.kt @@ -17,6 +17,7 @@ */ package com.wire.android.ui.common.scaffold +import SwipeableSnackbar import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.imePadding @@ -24,12 +25,12 @@ import androidx.compose.foundation.layout.systemBarsPadding import androidx.compose.material3.FabPosition import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold +import androidx.compose.material3.SnackbarHost import androidx.compose.material3.contentColorFor import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import com.wire.android.ui.common.snackbar.SwipeDismissSnackbarHost -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState /** * A custom scaffold that automatically applies system UI insets and IME (Input Method Editor) @@ -68,12 +69,21 @@ fun WireScaffold( topBar = topBar, bottomBar = bottomBar, snackbarHost = { - SwipeDismissSnackbarHost(hostState = LocalSnackbarHostState.current) + SnackbarHost( + hostState = LocalSnackbarHostState.current, + snackbar = { data -> + SwipeableSnackbar( + hostState = LocalSnackbarHostState.current, + data = data, + onDismiss = { data.dismiss() } + ) + } + ) }, - floatingActionButton, - floatingActionButtonPosition, - containerColor, - contentColor, + floatingActionButton = floatingActionButton, + floatingActionButtonPosition = floatingActionButtonPosition, + containerColor = containerColor, + contentColor = contentColor, contentWindowInsets = WindowInsets(0, 0, 0, 0), content = content ) diff --git a/app/src/main/kotlin/com/wire/android/ui/snackbar/LocalSnackbarHostState.kt b/app/src/main/kotlin/com/wire/android/ui/common/snackbar/LocalSnackbarHostState.kt similarity index 95% rename from app/src/main/kotlin/com/wire/android/ui/snackbar/LocalSnackbarHostState.kt rename to app/src/main/kotlin/com/wire/android/ui/common/snackbar/LocalSnackbarHostState.kt index f01665669e8..b2564ebc9e7 100644 --- a/app/src/main/kotlin/com/wire/android/ui/snackbar/LocalSnackbarHostState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/snackbar/LocalSnackbarHostState.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.android.ui.snackbar +package com.wire.android.ui.common.snackbar import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.staticCompositionLocalOf diff --git a/app/src/main/kotlin/com/wire/android/ui/common/snackbar/SwipeDismissSnackbar.kt b/app/src/main/kotlin/com/wire/android/ui/common/snackbar/SwipeDismissSnackbar.kt deleted file mode 100644 index 7efb757bc7c..00000000000 --- a/app/src/main/kotlin/com/wire/android/ui/common/snackbar/SwipeDismissSnackbar.kt +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Wire - * Copyright (C) 2023 Wire Swiss GmbH - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/. - * - * - */ - -package com.wire.android.ui.common.snackbar - -import androidx.compose.material3.DismissDirection -import androidx.compose.material3.DismissValue -import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.SwipeToDismiss -import androidx.compose.material3.rememberDismissState -import androidx.compose.material3.Snackbar -import androidx.compose.material3.SnackbarData -import androidx.compose.material3.SnackbarHost -import androidx.compose.material3.SnackbarHostState -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier - -/** - * Wrapper around [Snackbar] to make it swipe-dismissable, - * using [SwipeToDismiss]. - */ -@OptIn(ExperimentalMaterial3Api::class) -@Composable -fun SwipeDismissSnackbar( - data: SnackbarData, - onDismiss: (() -> Unit)? = null, - snackbar: @Composable (SnackbarData) -> Unit = { Snackbar(it) }, -) { - val dismissState = rememberDismissState( - confirmValueChange = { - if (it != DismissValue.Default) { - // First dismiss the snackbar - data.dismiss() - // Then invoke the callback - onDismiss?.invoke() - } - true - }) - - SwipeToDismiss( - state = dismissState, - directions = setOf(DismissDirection.StartToEnd, DismissDirection.EndToStart), - background = {}, - dismissContent = { snackbar(data) } - ) -} - -@Composable -fun SwipeDismissSnackbarHost( - hostState: SnackbarHostState, - modifier: Modifier = Modifier, - onDismiss: () -> Unit = { hostState.currentSnackbarData?.dismiss() }, - snackbar: @Composable (SnackbarData) -> Unit = { data -> - SwipeDismissSnackbar( - data = data, - onDismiss = onDismiss, - ) - }, -) { - SnackbarHost( - hostState = hostState, - snackbar = snackbar, - modifier = modifier, - ) -} diff --git a/app/src/main/kotlin/com/wire/android/ui/common/snackbar/SwipeableSnackbar.kt b/app/src/main/kotlin/com/wire/android/ui/common/snackbar/SwipeableSnackbar.kt new file mode 100644 index 00000000000..19503629aea --- /dev/null +++ b/app/src/main/kotlin/com/wire/android/ui/common/snackbar/SwipeableSnackbar.kt @@ -0,0 +1,114 @@ +/* + * Wire + * Copyright (C) 2023 Wire Swiss GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/. + */ + +import androidx.compose.animation.core.SpringSpec +import androidx.compose.foundation.ExperimentalFoundationApi +import androidx.compose.foundation.gestures.AnchoredDraggableState +import androidx.compose.foundation.gestures.DraggableAnchors +import androidx.compose.foundation.gestures.Orientation +import androidx.compose.foundation.gestures.anchoredDraggable +import androidx.compose.foundation.layout.offset +import androidx.compose.material3.Snackbar +import androidx.compose.material3.SnackbarData +import androidx.compose.material3.SnackbarHostState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalConfiguration +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.unit.IntOffset +import androidx.compose.ui.unit.dp +import kotlin.math.roundToInt + +/** + * A swipeable [Snackbar] that allows users to manually dismiss it by dragging. + * + * This composable function extends the default Snackbar behavior by adding a draggable gesture. + * The Snackbar can be swiped horizontally to dismiss it, based on predefined positional and velocity thresholds. + * + * @param hostState The state of the [SnackbarHostState] this Snackbar is associated with. This allows + * the Snackbar to notify its host when it's dismissed. + * @param data The [SnackbarData] containing the message and optional action to display on the Snackbar. + * @param onDismiss An optional callback function to be executed when the Snackbar is swiped away. + * The default behavior will dismiss the current Snackbar from the [hostState]. + * @see Snackbar + * @see SnackbarData + * @see SnackbarHostState + */ +@OptIn(ExperimentalFoundationApi::class) +@Composable +fun SwipeableSnackbar( + hostState: SnackbarHostState, + data: SnackbarData, + onDismiss: () -> Unit = { hostState.currentSnackbarData?.dismiss() }, +) { + val density = LocalDensity.current + val configuration = LocalConfiguration.current + + val currentScreenWidth = with(density) { configuration.screenWidthDp.dp.toPx() } + + val anchors = DraggableAnchors { + SnackBarState.Visible at 0f + SnackBarState.Dismissed at currentScreenWidth + } + + // Determines how far the user needs to drag (as a fraction of total distance) for an action to be triggered. + // In this example, the Snackbar will trigger an action if dragged to half (0.5) of its width. + val positionalThreshold: (Float) -> Float = { distance -> distance * 0.5f } + + // Determines the minimum velocity (in pixels per second) with which the user needs to drag for an action to be triggered, + // even if the positional threshold hasn't been reached. + // Here, it's set to 125 device-independent pixels per second. + val velocityThreshold: () -> Float = with(density) { { 125.dp.toPx() } } + + val state = remember { + AnchoredDraggableState( + initialValue = SnackBarState.Visible, + anchors = anchors, + positionalThreshold = positionalThreshold, + velocityThreshold = velocityThreshold, + animationSpec = SpringSpec(), + confirmValueChange = { true } + ) + } + + LaunchedEffect(state.currentValue) { + if (state.currentValue == SnackBarState.Dismissed) { + onDismiss() + } + } + + Snackbar( + snackbarData = data, + modifier = Modifier + .anchoredDraggable( + state = state, + orientation = Orientation.Horizontal + ) + .offset { + IntOffset( + state + .requireOffset() + .roundToInt(), 0 + ) + }) +} + +private enum class SnackBarState { Visible, Dismissed } + diff --git a/app/src/main/kotlin/com/wire/android/ui/snackbar/WireSnackbar.kt b/app/src/main/kotlin/com/wire/android/ui/common/snackbar/WireSnackbar.kt similarity index 96% rename from app/src/main/kotlin/com/wire/android/ui/snackbar/WireSnackbar.kt rename to app/src/main/kotlin/com/wire/android/ui/common/snackbar/WireSnackbar.kt index b0f4914c491..1960e866eee 100644 --- a/app/src/main/kotlin/com/wire/android/ui/snackbar/WireSnackbar.kt +++ b/app/src/main/kotlin/com/wire/android/ui/common/snackbar/WireSnackbar.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.android.ui.snackbar +package com.wire.android.ui.common.snackbar import androidx.compose.material3.SnackbarHostState import androidx.compose.runtime.Composable diff --git a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt index a9a82ace49e..421b111a465 100644 --- a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt +++ b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt @@ -39,8 +39,8 @@ import com.wire.android.ui.common.dialogs.UnblockUserDialogContent import com.wire.android.ui.common.dialogs.UnblockUserDialogState import com.wire.android.ui.common.dimensions import com.wire.android.ui.common.visbility.rememberVisibilityState -import com.wire.android.ui.snackbar.LocalSnackbarHostState -import com.wire.android.ui.snackbar.collectAndShowSnackbar +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.collectAndShowSnackbar import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.user.ConnectionState import com.wire.kalium.logic.data.user.UserId diff --git a/app/src/main/kotlin/com/wire/android/ui/home/HomeStateHolder.kt b/app/src/main/kotlin/com/wire/android/ui/home/HomeStateHolder.kt index 179fd36adaa..3667123bea0 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/HomeStateHolder.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/HomeStateHolder.kt @@ -44,7 +44,7 @@ import com.wire.android.ui.common.bottomsheet.WireModalSheetState import com.wire.android.ui.common.bottomsheet.rememberWireModalSheetState import com.wire.android.ui.common.topappbar.search.SearchBarState import com.wire.android.ui.common.topappbar.search.rememberSearchbarState -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt index 42fd1d75507..1fb694d041c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreen.kt @@ -20,6 +20,7 @@ package com.wire.android.ui.home.conversations +import SwipeableSnackbar import android.net.Uri import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -30,6 +31,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyListState import androidx.compose.material3.Scaffold +import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarResult import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect @@ -73,7 +75,7 @@ import com.wire.android.ui.common.dialogs.calling.ConfirmStartCallDialog import com.wire.android.ui.common.dialogs.calling.JoinAnywayDialog import com.wire.android.ui.common.dialogs.calling.OngoingActiveCallDialog import com.wire.android.ui.common.error.CoreFailureErrorDialog -import com.wire.android.ui.common.snackbar.SwipeDismissSnackbarHost +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.destinations.GroupConversationDetailsScreenDestination import com.wire.android.ui.destinations.InitiatingCallScreenDestination import com.wire.android.ui.destinations.MediaGalleryScreenDestination @@ -104,7 +106,6 @@ import com.wire.android.ui.home.messagecomposer.MessageComposer import com.wire.android.ui.home.messagecomposer.state.MessageBundle import com.wire.android.ui.home.messagecomposer.state.MessageComposerStateHolder import com.wire.android.ui.home.messagecomposer.state.rememberMessageComposerStateHolder -import com.wire.android.ui.snackbar.LocalSnackbarHostState import com.wire.android.util.extension.openAppInfoScreen import com.wire.android.util.normalizeLink import com.wire.android.util.ui.UIText @@ -570,11 +571,15 @@ private fun ConversationScreen( } }, snackbarHost = { - SwipeDismissSnackbarHost( + SnackbarHost( hostState = snackbarHostState, - modifier = Modifier - .fillMaxWidth() - .imePadding() + snackbar = { data -> + SwipeableSnackbar( + hostState = snackbarHostState, + data = data, + onDismiss = { data.dismiss() } + ) + } ) }, content = { internalPadding -> diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreenState.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreenState.kt index c4c561a41eb..247395a42d6 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreenState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationScreenState.kt @@ -37,7 +37,7 @@ import com.wire.android.R import com.wire.android.ui.common.bottomsheet.WireModalSheetState import com.wire.android.ui.common.bottomsheet.rememberWireModalSheetState import com.wire.android.ui.home.conversations.model.UIMessage -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt index 2e9f5925506..a9ed4949afa 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt @@ -92,7 +92,7 @@ import com.wire.android.ui.home.conversations.details.participants.GroupConversa import com.wire.android.ui.home.conversations.details.participants.model.UIParticipant import com.wire.android.ui.home.conversationslist.model.DialogState import com.wire.android.ui.home.conversationslist.model.GroupDialogState -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireDimensions import com.wire.android.util.ui.UIText diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/EditGuestAccessScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/EditGuestAccessScreen.kt index 5127dd8b869..a635def14b9 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/EditGuestAccessScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/editguestaccess/EditGuestAccessScreen.kt @@ -57,7 +57,7 @@ import com.wire.android.ui.common.topappbar.WireCenterAlignedTopAppBar import com.wire.android.ui.destinations.CreatePasswordProtectedGuestLinkScreenDestination import com.wire.android.ui.home.conversations.details.editguestaccess.createPasswordProtectedGuestLink.CreatePasswordGuestLinkNavArgs import com.wire.android.ui.home.conversationslist.common.FolderHeader -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireDimensions import com.wire.android.ui.theme.wireTypography diff --git a/app/src/main/kotlin/com/wire/android/ui/home/gallery/MediaGalleryScreenState.kt b/app/src/main/kotlin/com/wire/android/ui/home/gallery/MediaGalleryScreenState.kt index 0828953ce8d..da3819c8e34 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/gallery/MediaGalleryScreenState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/gallery/MediaGalleryScreenState.kt @@ -27,7 +27,7 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import com.wire.android.ui.common.bottomsheet.WireModalSheetState import com.wire.android.ui.common.bottomsheet.rememberWireModalSheetState -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/recordaudio/RecordAudioComponent.kt b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/recordaudio/RecordAudioComponent.kt index b9898bb468f..9cf56e59809 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/recordaudio/RecordAudioComponent.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/messagecomposer/recordaudio/RecordAudioComponent.kt @@ -38,7 +38,7 @@ import com.sebaslogen.resaca.hilt.hiltViewModelScoped import com.wire.android.ui.common.colorsScheme import com.wire.android.ui.common.dimensions import com.wire.android.ui.home.conversations.model.UriAsset -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.theme.wireColorScheme import com.wire.android.util.extension.openAppInfoScreen import com.wire.android.util.permission.rememberRecordAudioRequestFlow diff --git a/app/src/main/kotlin/com/wire/android/ui/home/newconversation/search/NewConversationSearchPeopleScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/newconversation/search/NewConversationSearchPeopleScreen.kt index 74e9b6c5347..bd762d7920e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/newconversation/search/NewConversationSearchPeopleScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/newconversation/search/NewConversationSearchPeopleScreen.kt @@ -33,7 +33,7 @@ import com.wire.android.ui.home.conversations.search.SearchPeopleScreen import com.wire.android.ui.home.conversations.search.SearchPeopleScreenType import com.wire.android.ui.home.newconversation.NewConversationViewModel import com.wire.android.ui.home.newconversation.common.NewConversationNavGraph -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.kalium.logic.data.id.QualifiedID @NewConversationNavGraph(start = true) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/settings/account/MyAccountScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/settings/account/MyAccountScreen.kt index da32aafa5b3..5754fa0240c 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/settings/account/MyAccountScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/settings/account/MyAccountScreen.kt @@ -67,7 +67,7 @@ import com.wire.android.ui.home.settings.account.AccountDetailsItem.Team import com.wire.android.ui.home.settings.account.AccountDetailsItem.Username import com.wire.android.ui.home.settings.account.deleteAccount.DeleteAccountDialog import com.wire.android.ui.home.settings.account.deleteAccount.DeleteAccountViewModel -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireTypography import com.wire.android.util.CustomTabsHelper diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreenState.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreenState.kt index 2823002bca6..bf64f32f302 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreenState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreenState.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.text.AnnotatedString import com.wire.android.R -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaScreenState.kt b/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaScreenState.kt index 55ec67d2f97..3a5a5a686f4 100644 --- a/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaScreenState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaScreenState.kt @@ -25,7 +25,7 @@ import com.wire.android.ui.common.bottomsheet.WireModalSheetState import com.wire.android.ui.common.bottomsheet.rememberWireModalSheetState import com.wire.android.ui.common.topappbar.search.SearchBarState import com.wire.android.ui.common.topappbar.search.rememberSearchbarState -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/avatarpicker/AvatarPickerState.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/avatarpicker/AvatarPickerState.kt index bd089a03ea6..bf7275daf8d 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/avatarpicker/AvatarPickerState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/avatarpicker/AvatarPickerState.kt @@ -32,7 +32,7 @@ import com.wire.android.ui.common.bottomsheet.WireModalSheetState import com.wire.android.ui.common.bottomsheet.rememberWireModalSheetState import com.wire.android.ui.common.imagepreview.AvatarPickerFlow import com.wire.android.ui.common.imagepreview.rememberPickPictureState -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.util.ui.UIText import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt index 53657638244..3ab61983037 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt @@ -90,7 +90,7 @@ import com.wire.android.ui.destinations.DeviceDetailsScreenDestination import com.wire.android.ui.home.conversations.details.dialog.ClearConversationContentDialog import com.wire.android.ui.home.conversationslist.model.DialogState import com.wire.android.ui.home.conversationslist.model.Membership -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.theme.WireTheme import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireDimensions diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenState.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenState.kt index d0bad197711..9266d6016e0 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenState.kt @@ -29,7 +29,7 @@ import androidx.compose.ui.platform.ClipboardManager import androidx.compose.ui.platform.LocalClipboardManager import androidx.compose.ui.text.AnnotatedString import com.wire.android.R -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt index 9a01809b62b..67988735a85 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/self/SelfUserProfileScreen.kt @@ -81,7 +81,7 @@ import com.wire.android.ui.home.conversations.search.HighlightName import com.wire.android.ui.home.conversations.search.HighlightSubtitle import com.wire.android.ui.home.conversationslist.common.FolderHeader import com.wire.android.ui.theme.WireTheme -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.theme.wireDimensions import com.wire.android.ui.userprofile.common.EditableState import com.wire.android.ui.userprofile.common.UserProfileInfo diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/service/ServiceDetailsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/service/ServiceDetailsScreen.kt index 9f6b8f1e3cc..d38227d4f05 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/service/ServiceDetailsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/service/ServiceDetailsScreen.kt @@ -32,7 +32,7 @@ import com.wire.android.ui.common.dimensions import com.wire.android.ui.common.scaffold.WireScaffold import com.wire.android.ui.common.topappbar.WireCenterAlignedTopAppBar import com.wire.android.ui.home.conversationslist.model.Membership -import com.wire.android.ui.snackbar.LocalSnackbarHostState +import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireDimensions import com.wire.android.ui.theme.wireTypography