Add haptic feedback to reader page slider

Based of a main tachi pr, but using a different constant for the vibration
This commit is contained in:
Jays2Kings 2021-09-14 17:27:30 -04:00
parent cb235ee7fa
commit 6415387c16

View file

@ -13,6 +13,7 @@ import android.graphics.drawable.LayerDrawable
import android.net.Uri
import android.os.Build
import android.os.Bundle
import android.view.HapticFeedbackConstants
import android.view.KeyEvent
import android.view.Menu
import android.view.MenuItem
@ -725,6 +726,9 @@ class ReaderActivity :
binding.readerNav.pageSeekbar.addOnChangeListener { _, value, fromUser ->
if (viewer != null && fromUser) {
moveToPageIndex(value.roundToInt())
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
binding.readerNav.pageSeekbar.performHapticFeedback(HapticFeedbackConstants.TEXT_HANDLE_MOVE)
}
}
}