@@ -1,6 +1,7 @@
|
||||
package de.mm20.launcher2.ui.launcher.scaffold
|
||||
|
||||
import android.app.WallpaperManager
|
||||
import android.util.Log
|
||||
import android.view.animation.PathInterpolator
|
||||
import androidx.activity.compose.LocalActivity
|
||||
import androidx.activity.compose.PredictiveBackHandler
|
||||
@@ -436,7 +437,7 @@ internal class LauncherScaffoldState(
|
||||
private set
|
||||
|
||||
suspend fun onDragStarted() {
|
||||
if (isLocked) return
|
||||
if (isLocked || currentZOffset > 0f) return
|
||||
isDragged = true
|
||||
offsetAnimatable.stop()
|
||||
zAnimatable.stop()
|
||||
@@ -444,7 +445,7 @@ internal class LauncherScaffoldState(
|
||||
|
||||
|
||||
fun onDrag(offset: Offset) {
|
||||
if (isLocked) return
|
||||
if (isLocked || currentZOffset > 0f) return
|
||||
if (currentGesture == null || (!isSettledOnSecondaryPage && currentOffset.x.absoluteValue <= touchSlop && currentOffset.y.absoluteValue <= touchSlop)) {
|
||||
currentGesture = getSwipeDirection(config, offset)
|
||||
}
|
||||
@@ -601,7 +602,7 @@ internal class LauncherScaffoldState(
|
||||
*/
|
||||
suspend fun onDragStopped(velocity: Velocity, disallowPageChange: Boolean = false) {
|
||||
isDragged = false
|
||||
if (isLocked) return
|
||||
if (isLocked || currentZOffset > 0f) return
|
||||
val velocity = when {
|
||||
!isAtTop && !isAtBottom -> velocity.copy(y = 0f)
|
||||
!isAtTop -> velocity.copy(y = velocity.y.coerceAtMost(0f))
|
||||
@@ -915,7 +916,6 @@ internal class LauncherScaffoldState(
|
||||
openSearch()
|
||||
return
|
||||
}
|
||||
lock()
|
||||
currentGesture = gesture
|
||||
|
||||
zAnimatable.snapTo(0f)
|
||||
@@ -1036,8 +1036,10 @@ internal class LauncherScaffoldState(
|
||||
}
|
||||
|
||||
suspend fun reset() {
|
||||
Log.d("MM20", "reset was called!!!")
|
||||
isSearchBarFocused = false
|
||||
currentOffset = Offset.Zero
|
||||
currentZOffset = 0f
|
||||
unlock()
|
||||
isSettledOnSecondaryPage = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user