[新增] 增加了一个开关进度条震动的按钮 #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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1359,4 +1359,5 @@
|
||||
<string name="cover_show_shadow">显示字体阴影</string>
|
||||
<string name="cover_show_stroke">显示字体描边</string>
|
||||
<string name="default_color">使用默认字体颜色</string>
|
||||
<string name="enable_slider_vibrator">滑动进度条时震动</string>
|
||||
</resources>
|
||||
|
||||
@@ -1362,4 +1362,5 @@
|
||||
<string name="cover_show_shadow">显示字体阴影</string>
|
||||
<string name="cover_show_stroke">显示字体描边</string>
|
||||
<string name="default_color">使用默认字体颜色</string>
|
||||
<string name="enable_slider_vibrator">滑动进度条时震动</string>
|
||||
</resources>
|
||||
|
||||
@@ -159,6 +159,12 @@
|
||||
android:title="@string/other"
|
||||
app:iconSpaceReserved="false">
|
||||
|
||||
<io.legado.app.lib.prefs.SwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="sliderVibrator"
|
||||
android:title="@string/enable_slider_vibrator"
|
||||
app:isBottomBackground="true" />
|
||||
|
||||
<io.legado.app.lib.prefs.SwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="autoChangeSource"
|
||||
|
||||
Reference in New Issue
Block a user