mirror of
https://github.com/LiveFastEatTrashRaccoon/RaccoonForLemmy.git
synced 2025-02-09 12:48:42 +01:00
fix: prevent drawer gesture when not needed
This commit is contained in:
parent
46baa4ec4c
commit
8efc873f62
@ -30,6 +30,7 @@ import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.CompositionLocalProvider
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
@ -53,6 +54,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.appearance.di.getThemeRepos
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.architecture.bindToLifecycle
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomImage
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getDrawerCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getInboxChatViewModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getNavigationCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.utils.onClick
|
||||
@ -70,6 +72,13 @@ class InboxChatScreen(
|
||||
val uiState by model.uiState.collectAsState()
|
||||
val navigator = remember { getNavigationCoordinator().getRootNavigator() }
|
||||
val focusManager = LocalFocusManager.current
|
||||
val drawerCoordinator = remember { getDrawerCoordinator() }
|
||||
DisposableEffect(key) {
|
||||
drawerCoordinator.setGesturesEnabled(false)
|
||||
onDispose {
|
||||
drawerCoordinator.setGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
modifier = Modifier.background(MaterialTheme.colorScheme.background)
|
||||
|
@ -78,6 +78,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.Swipeab
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.createcomment.CreateCommentScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.createpost.CreatePostScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getCommunityDetailViewModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getDrawerCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getNavigationCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.image.ZoomableImageScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.instanceinfo.InstanceInfoScreen
|
||||
@ -142,9 +143,12 @@ class CommunityDetailScreen(
|
||||
val downvoteColor by themeRepository.downvoteColor.collectAsState()
|
||||
val defaultUpvoteColor = MaterialTheme.colorScheme.primary
|
||||
val defaultDownVoteColor = MaterialTheme.colorScheme.tertiary
|
||||
val drawerCoordinator = remember { getDrawerCoordinator() }
|
||||
DisposableEffect(key) {
|
||||
drawerCoordinator.setGesturesEnabled(false)
|
||||
onDispose {
|
||||
notificationCenter.removeObserver(key)
|
||||
drawerCoordinator.setGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,6 +85,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.PostCar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.SwipeableCard
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.createcomment.CreateCommentScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.createpost.CreatePostScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getDrawerCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getNavigationCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getPostDetailViewModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.image.ZoomableImageScreen
|
||||
@ -147,9 +148,12 @@ class PostDetailScreen(
|
||||
}
|
||||
}
|
||||
val notificationCenter = remember { getNotificationCenter() }
|
||||
val drawerCoordinator = remember { getDrawerCoordinator() }
|
||||
DisposableEffect(key) {
|
||||
drawerCoordinator.setGesturesEnabled(false)
|
||||
onDispose {
|
||||
notificationCenter.removeObserver(key)
|
||||
drawerCoordinator.setGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
val themeRepository = remember { getThemeRepository() }
|
||||
|
@ -32,6 +32,7 @@ import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.material3.rememberTopAppBarState
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@ -58,6 +59,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.Floatin
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.PostCard
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.SectionSelector
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.createcomment.CreateCommentScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getDrawerCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getNavigationCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getSavedItemsViewModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.image.ZoomableImageScreen
|
||||
@ -103,6 +105,13 @@ class SavedItemsScreen : Screen {
|
||||
}
|
||||
}
|
||||
}
|
||||
val drawerCoordinator = remember { getDrawerCoordinator() }
|
||||
DisposableEffect(key) {
|
||||
drawerCoordinator.setGesturesEnabled(false)
|
||||
onDispose {
|
||||
drawerCoordinator.setGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
|
@ -78,6 +78,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.Section
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.SwipeableCard
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.UserHeader
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.createcomment.CreateCommentScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getDrawerCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getNavigationCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getUserDetailViewModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.image.ZoomableImageScreen
|
||||
@ -139,9 +140,12 @@ class UserDetailScreen(
|
||||
val downvoteColor by themeRepository.downvoteColor.collectAsState()
|
||||
val defaultUpvoteColor = MaterialTheme.colorScheme.primary
|
||||
val defaultDownVoteColor = MaterialTheme.colorScheme.tertiary
|
||||
val drawerCoordinator = remember { getDrawerCoordinator() }
|
||||
DisposableEffect(key) {
|
||||
drawerCoordinator.setGesturesEnabled(false)
|
||||
onDispose {
|
||||
notificationCenter.removeObserver(key)
|
||||
drawerCoordinator.setGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
LaunchedEffect(model) {
|
||||
|
@ -37,6 +37,7 @@ import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.material3.rememberTopAppBarState
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
@ -60,6 +61,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.Floatin
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.FloatingActionButtonMenuItem
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.MultiCommunityItem
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.SwipeableCard
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getDrawerCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getNavigationCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.utils.onClick
|
||||
import com.github.diegoberaldin.raccoonforlemmy.feature.search.di.getManageSubscriptionsViewModel
|
||||
@ -95,6 +97,13 @@ class ManageSubscriptionsScreen : Screen {
|
||||
}
|
||||
}
|
||||
}
|
||||
val drawerCoordinator = remember { getDrawerCoordinator() }
|
||||
DisposableEffect(key) {
|
||||
drawerCoordinator.setGesturesEnabled(false)
|
||||
onDispose {
|
||||
drawerCoordinator.setGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
|
@ -70,6 +70,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.PostCar
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.PostCardPlaceholder
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.SwipeableCard
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.createcomment.CreateCommentScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getDrawerCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getNavigationCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.image.ZoomableImageScreen
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.modals.SortBottomSheet
|
||||
@ -123,9 +124,12 @@ class MultiCommunityScreen(
|
||||
}
|
||||
}
|
||||
}
|
||||
val drawerCoordinator = remember { getDrawerCoordinator() }
|
||||
DisposableEffect(key) {
|
||||
drawerCoordinator.setGesturesEnabled(false)
|
||||
onDispose {
|
||||
notificationCenter.removeObserver(key)
|
||||
drawerCoordinator.setGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -34,6 +34,7 @@ import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TextFieldDefaults
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
@ -58,6 +59,7 @@ import com.github.diegoberaldin.raccoonforlemmy.core.appearance.theme.Spacing
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.architecture.bindToLifecycle
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CommunityItem
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.components.CustomImage
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getDrawerCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.commonui.di.getNavigationCoordinator
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.persistence.data.MultiCommunityModel
|
||||
import com.github.diegoberaldin.raccoonforlemmy.core.utils.onClick
|
||||
@ -89,6 +91,13 @@ class MultiCommunityEditorScreen(
|
||||
}
|
||||
}.launchIn(this)
|
||||
}
|
||||
val drawerCoordinator = remember { getDrawerCoordinator() }
|
||||
DisposableEffect(key) {
|
||||
drawerCoordinator.setGesturesEnabled(false)
|
||||
onDispose {
|
||||
drawerCoordinator.setGesturesEnabled(true)
|
||||
}
|
||||
}
|
||||
|
||||
Scaffold(
|
||||
topBar = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user