mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fixed rapid haptic feedback when trying to swipe to a double page in the seekbar
This commit is contained in:
parent
4566ab3741
commit
c9c82e35f6
1 changed files with 5 additions and 1 deletions
|
@ -725,8 +725,12 @@ class ReaderActivity :
|
|||
// Init listeners on bottom menu
|
||||
binding.readerNav.pageSeekbar.addOnChangeListener { _, value, fromUser ->
|
||||
if (viewer != null && fromUser) {
|
||||
val prevValue = (viewer as? PagerViewer)?.pager?.currentItem ?: -1
|
||||
moveToPageIndex(value.roundToInt())
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
|
||||
val newValue = (viewer as? PagerViewer)?.pager?.currentItem ?: -1
|
||||
if (prevValue > -1 && newValue != prevValue &&
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1
|
||||
) {
|
||||
binding.readerNav.pageSeekbar.performHapticFeedback(HapticFeedbackConstants.TEXT_HANDLE_MOVE)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue