Resolve #668
This commit is contained in:
1 parent
f695c4598a
commit
3f8984d2dc
6 files changed
+21
-1
No files matched your search
@@ -988,6 +988,10 @@ class ReaderActivity : EhActivity() {
|
||||
.onEach { setPageNumberVisibility(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
readerPreferences.showReaderSeekbar().changes()
|
||||
.onEach { setReaderSeekbarVisibility(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
|
||||
readerPreferences.trueColor().changes()
|
||||
.onEach { setTrueColor(it) }
|
||||
.launchIn(lifecycleScope)
|
||||
@@ -1050,6 +1054,10 @@ class ReaderActivity : EhActivity() {
|
||||
binding.pageNumber.isVisible = visible
|
||||
}
|
||||
|
||||
fun setReaderSeekbarVisibility(visible: Boolean) {
|
||||
binding.readerSeekbar.isVisible = visible
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the 32-bit color mode according to [enabled].
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,7 @@ class ReaderGeneralSettings @JvmOverloads constructor(context: Context, attrs: A
|
||||
private fun initGeneralPreferences() {
|
||||
binding.backgroundColor.bindToIntPreference(readerPreferences.readerTheme(), R.array.reader_themes_values)
|
||||
binding.showPageNumber.bindToPreference(readerPreferences.showPageNumber())
|
||||
binding.showReaderSeekbar.bindToPreference(readerPreferences.showReaderSeekbar())
|
||||
binding.fullscreen.bindToPreference(readerPreferences.fullscreen())
|
||||
readerPreferences.fullscreen()
|
||||
.asHotFlow {
|
||||
|
||||
@@ -14,7 +14,7 @@ class ReaderPreferences(private val preferenceStore: PreferenceStore) {
|
||||
|
||||
fun showPageNumber() = preferenceStore.getBoolean("pref_show_page_number_key", true)
|
||||
|
||||
fun showReadingMode() = preferenceStore.getBoolean("pref_show_reading_mode", true)
|
||||
fun showReaderSeekbar() = preferenceStore.getBoolean("pref_show_reader_seekbar", true)
|
||||
|
||||
fun trueColor() = preferenceStore.getBoolean("pref_true_color_key", false)
|
||||
|
||||
|
||||
@@ -26,6 +26,15 @@
|
||||
android:text="@string/pref_show_page_number"
|
||||
android:textColor="?android:attr/textColorSecondary" />
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/show_reader_seekbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="16dp"
|
||||
android:paddingVertical="16dp"
|
||||
android:text="@string/pref_show_reader_seekbar"
|
||||
android:textColor="?android:attr/textColorSecondary" />
|
||||
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/fullscreen"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -603,6 +603,7 @@
|
||||
<string name="pref_fullscreen">全屏</string>
|
||||
<string name="pref_page_transitions">页面过渡动画</string>
|
||||
<string name="pref_show_page_number">显示页码</string>
|
||||
<string name="pref_show_reader_seekbar">显示跳页拖动条</string>
|
||||
<string name="pref_crop_borders">裁剪边缘</string>
|
||||
<string name="pref_custom_brightness">自定义亮度</string>
|
||||
<string name="pref_custom_color_filter">自定义滤镜</string>
|
||||
|
||||
@@ -684,6 +684,7 @@
|
||||
<string name="pref_cutout_short">Show content in cutout area</string>
|
||||
<string name="pref_page_transitions">Animate page transitions</string>
|
||||
<string name="pref_show_page_number">Show page number</string>
|
||||
<string name="pref_show_reader_seekbar">Show page jumping seekbar</string>
|
||||
<string name="pref_custom_brightness">Custom brightness</string>
|
||||
<string name="pref_grayscale">Grayscale</string>
|
||||
<string name="pref_inverted_colors">Inverted</string>
|
||||
|
||||
Reference in new issue
Block a user