change swipe sensitivity
This commit is contained in:
parent
b6c79dae40
commit
34a3e9e5a3
1 changed files with 3 additions and 3 deletions
|
@ -167,9 +167,9 @@ class Swipy @JvmOverloads constructor(
|
||||||
val totalDragDistance =
|
val totalDragDistance =
|
||||||
Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
||||||
if (verticalPos == VerticalPosition.Top)
|
if (verticalPos == VerticalPosition.Top)
|
||||||
topBeingSwiped.invoke(overscroll / totalDragDistance)
|
topBeingSwiped.invoke(overscroll * 2 / totalDragDistance)
|
||||||
else
|
else
|
||||||
bottomBeingSwiped.invoke(overscroll / totalDragDistance)
|
bottomBeingSwiped.invoke(overscroll * 2 / totalDragDistance)
|
||||||
} else {
|
} else {
|
||||||
val totalDragDistance =
|
val totalDragDistance =
|
||||||
Resources.getSystem().displayMetrics.widthPixels / dragDivider
|
Resources.getSystem().displayMetrics.widthPixels / dragDivider
|
||||||
|
@ -243,7 +243,7 @@ class Swipy @JvmOverloads constructor(
|
||||||
|
|
||||||
if (vertical) {
|
if (vertical) {
|
||||||
val totalDragDistance = Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
val totalDragDistance = Resources.getSystem().displayMetrics.heightPixels / dragDivider
|
||||||
if (overscrollDistance > totalDragDistance)
|
if (overscrollDistance * 2 > totalDragDistance)
|
||||||
if (verticalPos == VerticalPosition.Top)
|
if (verticalPos == VerticalPosition.Top)
|
||||||
onTopSwiped.invoke()
|
onTopSwiped.invoke()
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue