-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #347 from artsmvch/artsmvch/fix-swipe-to-back
Fix the full scene swipe without intercepting touch events
Showing
2 changed files
with
24 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
precompose/src/commonMain/kotlin/moe/tlaster/precompose/navigation/SwipeProperties.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
@file:OptIn(ExperimentalMaterialApi::class) | ||
|
||
package moe.tlaster.precompose.navigation | ||
|
||
import androidx.compose.material.ExperimentalMaterialApi | ||
import androidx.compose.ui.unit.Density | ||
import androidx.compose.ui.unit.Dp | ||
import androidx.compose.ui.unit.dp | ||
|
||
/** | ||
* @param spaceToSwipe width of the swipe space from the left side of screen. | ||
* Can be set to [Int.MAX_VALUE].dp to enable full-scene swipe | ||
* */ | ||
class SwipeProperties( | ||
val spaceToSwipe: Dp = 10.dp, | ||
val positionalThreshold: (totalDistance: Float) -> Float = { distance: Float -> distance * 0.5f }, | ||
val velocityThreshold: Density.() -> Float = { 56.dp.toPx() }, | ||
) |