[新增] 增加了一个开关进度条震动的按钮 #461
This commit is contained in:
@@ -239,4 +239,5 @@ object PreferKey {
|
||||
const val defaultSourceChangeAll = "defaultSourceChangeAll"
|
||||
|
||||
const val showTip = "showTip"
|
||||
const val sliderVibrator = "sliderVibrator"
|
||||
}
|
||||
|
||||
@@ -932,5 +932,11 @@ object AppConfig : SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
set(value) {
|
||||
appCtx.putPrefBoolean(PreferKey.defaultSourceChangeAll, value)
|
||||
}
|
||||
|
||||
var sliderVibrator: Boolean
|
||||
get() = appCtx.getPrefBoolean(PreferKey.sliderVibrator, false)
|
||||
set(value) {
|
||||
appCtx.putPrefBoolean(PreferKey.sliderVibrator, value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ import io.legado.app.model.ReadBook
|
||||
import io.legado.app.ui.browser.WebViewActivity
|
||||
import io.legado.app.ui.widget.seekbar.SeekBarChangeListener
|
||||
import io.legado.app.utils.ConstraintModify
|
||||
import io.legado.app.utils.VibrationUtils
|
||||
import io.legado.app.utils.activity
|
||||
import io.legado.app.utils.applyNavigationBarPadding
|
||||
import io.legado.app.utils.dpToPx
|
||||
@@ -446,11 +447,12 @@ class ReadMenu @JvmOverloads constructor(
|
||||
upBrightnessVwPos()
|
||||
}
|
||||
|
||||
seekReadPage.addOnChangeListener { slider, value, fromUser ->
|
||||
seekReadPage.addOnChangeListener { _, value, fromUser ->
|
||||
if (fromUser) {
|
||||
if (AppConfig.progressBarBehavior == "page")
|
||||
ReadBook.skipToPage(value.toInt() - 1)
|
||||
//VibrationUtils.vibrate(context, 12)
|
||||
if (AppConfig.sliderVibrator)
|
||||
VibrationUtils.vibrate(context, 10)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user