Don't dispatch gestures in widget edit mode
This commit is contained in:
parent
2cddd38211
commit
6567c77ba2
@ -254,7 +254,7 @@ fun PagerScaffold(
|
||||
available: Offset,
|
||||
source: NestedScrollSource
|
||||
): Offset {
|
||||
if (source == NestedScrollSource.Drag) gestureManager.dispatchDrag(available)
|
||||
if (source == NestedScrollSource.Drag && !isWidgetEditMode) gestureManager.dispatchDrag(available)
|
||||
val deltaSearchBarOffset =
|
||||
consumed.y * if (isSearchOpen && reverseSearchResults) 1 else -1
|
||||
searchBarOffset.value =
|
||||
@ -263,7 +263,7 @@ fun PagerScaffold(
|
||||
}
|
||||
|
||||
override suspend fun onPreFling(available: Velocity): Velocity {
|
||||
gestureManager.dispatchDragEnd()
|
||||
if (!isWidgetEditMode) gestureManager.dispatchDragEnd()
|
||||
return super.onPreFling(available)
|
||||
}
|
||||
}
|
||||
@ -346,10 +346,10 @@ fun PagerScaffold(
|
||||
.pointerInput(Unit) {
|
||||
detectTapGestures(
|
||||
onDoubleTap = {
|
||||
gestureManager.dispatchDoubleTap(it)
|
||||
if (!isWidgetEditMode) gestureManager.dispatchDoubleTap(it)
|
||||
},
|
||||
onLongPress = {
|
||||
gestureManager.dispatchLongPress(it)
|
||||
if (!isWidgetEditMode) gestureManager.dispatchLongPress(it)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@ -315,7 +315,7 @@ fun PullDownScaffold(
|
||||
if (offsetY.value > toggleSearchThreshold || offsetY.value < -toggleSearchThreshold) {
|
||||
viewModel.toggleSearch()
|
||||
}
|
||||
gestureManager.dispatchDragEnd()
|
||||
if (!isWidgetEditMode) gestureManager.dispatchDragEnd()
|
||||
if (offsetY.value != 0f) {
|
||||
offsetY.animateTo(0f)
|
||||
return available
|
||||
@ -331,10 +331,10 @@ fun PullDownScaffold(
|
||||
.pointerInput(Unit) {
|
||||
detectHorizontalDragGestures(
|
||||
onDragEnd = {
|
||||
gestureManager.dispatchDragEnd()
|
||||
if (!isWidgetEditMode) gestureManager.dispatchDragEnd()
|
||||
},
|
||||
onHorizontalDrag = { _, dragAmount ->
|
||||
gestureManager.dispatchDrag(Offset(dragAmount, 0f))
|
||||
if (!isWidgetEditMode) gestureManager.dispatchDrag(Offset(dragAmount, 0f))
|
||||
}
|
||||
)
|
||||
}
|
||||
@ -388,10 +388,10 @@ fun PullDownScaffold(
|
||||
.pointerInput(Unit) {
|
||||
detectTapGestures(
|
||||
onDoubleTap = {
|
||||
gestureManager.dispatchDoubleTap(it)
|
||||
if (!isWidgetEditMode) gestureManager.dispatchDoubleTap(it)
|
||||
},
|
||||
onLongPress = {
|
||||
gestureManager.dispatchLongPress(it)
|
||||
if (!isWidgetEditMode) gestureManager.dispatchLongPress(it)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user