Просмотр исходного кода

fix:修复阅读更多设置状态同步问题

HapeLee 5 месяцев назад
Родитель
Сommit
318bef3649

+ 43 - 0
app/src/main/java/io/legado/app/ui/book/read/ReadBookContract.kt

@@ -1049,6 +1049,9 @@ sealed interface ConfigUpdate {
     data class TitleBarMode(val value: String) : ConfigUpdate {
         override val actions = emptySet<ConfigUpdateAction>()
     }
+    data class ReadBodyToLh(val value: Boolean) : ConfigUpdate {
+        override val actions = setOf(ConfigUpdateAction.ReloadContent)
+    }
     data class TextFullJustify(val value: Boolean) : ConfigUpdate {
         override val actions = setOf(ConfigUpdateAction.ReloadContent)
     }
@@ -1087,9 +1090,49 @@ sealed interface ConfigUpdate {
     data class ProgressBarBehavior(val value: String) : ConfigUpdate {
         override val actions = emptySet<ConfigUpdateAction>()
     }
+    data class MouseWheelPage(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class VolumeKeyPage(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class VolumeKeyPageOnPlay(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class KeyPageOnLongPress(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class SliderVibrator(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class SelectVibrator(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class AutoChangeSource(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class SelectText(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
     data class NoAnimScrollPage(val value: Boolean) : ConfigUpdate {
         override val actions = emptySet<ConfigUpdateAction>()
     }
+    data class OptimizeRender(val value: Boolean) : ConfigUpdate {
+        override val actions = setOf(
+            ConfigUpdateAction.UpdateChapterStyle,
+            ConfigUpdateAction.ReloadContent,
+            ConfigUpdateAction.SubmitRenderTask,
+        )
+    }
+    data class ClickImgWay(val value: String) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class DisableReturnKey(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
+    data class ExpandTextMenu(val value: Boolean) : ConfigUpdate {
+        override val actions = emptySet<ConfigUpdateAction>()
+    }
     data class ShowReadTitleAddition(val value: Boolean) : ConfigUpdate {
         override val actions = emptySet<ConfigUpdateAction>()
     }

+ 94 - 0
app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@@ -633,10 +633,16 @@ class ReadBookViewModel(
             is ReadBookIntent.KeepLightChanged -> {
                 ReadConfig.keepLight = intent.value
                 _readPreferences.update { it.copy(keepLight = intent.value) }
+                viewModelScope.launch {
+                    readSettingsRepository.setKeepLight(intent.value)
+                }
                 _effects.tryEmit(ReadBookEffect.UpScreenTimeOut)
             }
             is ReadBookIntent.SetOrientation -> {
                 ReadConfig.screenOrientation = intent.value
+                viewModelScope.launch {
+                    readSettingsRepository.setScreenOrientation(intent.value)
+                }
                 _effects.tryEmit(ReadBookEffect.SetOrientation)
             }
             is ReadBookIntent.TextSelectAbleChanged -> _effects.tryEmit(
@@ -1457,6 +1463,12 @@ class ReadBookViewModel(
         }
     }
 
+    private suspend fun syncReadPreferencesSnapshot() {
+        val preferences = readSettingsRepository.preferences.first()
+        ReadConfig.syncReadPreferences(preferences)
+        _readPreferences.value = preferences
+    }
+
     private fun collectReadAloudPreferences() {
         viewModelScope.launch {
             readAloudSettingsRepository.preferences.collect { prefs ->
@@ -1734,6 +1746,7 @@ class ReadBookViewModel(
 
     fun initData(intent: Intent, success: (() -> Unit)? = null) {
         execute {
+            syncReadPreferencesSnapshot()
             ReadBook.inBookshelf = intent.getBooleanExtra("inBookshelf", true)
             ReadBook.chapterChanged = intent.getBooleanExtra("chapterChanged", false)
             val bookUrl = intent.getStringExtra("bookUrl")
@@ -2861,6 +2874,13 @@ class ReadBookViewModel(
                 }
                 postEvent(EventBus.UPDATE_READ_ACTION_BAR, true)
             }
+            is ConfigUpdate.ReadBodyToLh -> {
+                ReadConfig.readBodyToLh = update.value
+                ReadBookConfig.readBodyToLh = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setReadBodyToLh(update.value)
+                }
+            }
             is ConfigUpdate.TextFullJustify -> {
                 ReadBookConfig.textFullJustify = update.value
                 viewModelScope.launch {
@@ -2949,6 +2969,55 @@ class ReadBookViewModel(
                 }
                 _uiState.update { it.copy(styleConfig = buildStyleConfig()) }
             }
+            is ConfigUpdate.MouseWheelPage -> {
+                ReadConfig.mouseWheelPage = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setMouseWheelPage(update.value)
+                }
+            }
+            is ConfigUpdate.VolumeKeyPage -> {
+                ReadConfig.volumeKeyPage = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setVolumeKeyPage(update.value)
+                }
+            }
+            is ConfigUpdate.VolumeKeyPageOnPlay -> {
+                ReadConfig.volumeKeyPageOnPlay = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setVolumeKeyPageOnPlay(update.value)
+                }
+            }
+            is ConfigUpdate.KeyPageOnLongPress -> {
+                ReadConfig.keyPageOnLongPress = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setKeyPageOnLongPress(update.value)
+                }
+            }
+            is ConfigUpdate.SliderVibrator -> {
+                ReadConfig.sliderVibrator = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setSliderVibrator(update.value)
+                }
+            }
+            is ConfigUpdate.SelectVibrator -> {
+                ReadConfig.selectVibrator = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setSelectVibrator(update.value)
+                }
+            }
+            is ConfigUpdate.AutoChangeSource -> {
+                ReadConfig.autoChangeSource = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setAutoChangeSource(update.value)
+                }
+            }
+            is ConfigUpdate.SelectText -> {
+                ReadConfig.selectText = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setSelectText(update.value)
+                }
+                _effects.tryEmit(ReadBookEffect.UpTextSelectAble(update.value))
+            }
             is ConfigUpdate.NoAnimScrollPage -> {
                 ReadConfig.noAnimScrollPage = update.value
                 viewModelScope.launch {
@@ -2956,7 +3025,32 @@ class ReadBookViewModel(
                 }
                 _effects.tryEmit(ReadBookEffect.UpPageAnim(upRecorder = false))
             }
+            is ConfigUpdate.OptimizeRender -> {
+                ReadConfig.optimizeRender = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setOptimizeRender(update.value)
+                }
+            }
+            is ConfigUpdate.ClickImgWay -> {
+                ReadConfig.clickImgWay = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setClickImgWay(update.value)
+                }
+            }
+            is ConfigUpdate.DisableReturnKey -> {
+                ReadConfig.disableReturnKey = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setDisableReturnKey(update.value)
+                }
+            }
+            is ConfigUpdate.ExpandTextMenu -> {
+                ReadConfig.expandTextMenu = update.value
+                viewModelScope.launch {
+                    readSettingsRepository.setExpandTextMenu(update.value)
+                }
+            }
             is ConfigUpdate.ShowReadTitleAddition -> {
+                ReadConfig.showReadTitleAddition = update.value
                 viewModelScope.launch {
                     readSettingsRepository.setShowReadTitleAddition(update.value)
                 }

+ 21 - 17
app/src/main/java/io/legado/app/ui/book/read/sheet/MoreConfigSheet.kt

@@ -7,7 +7,6 @@ import androidx.compose.foundation.rememberScrollState
 import androidx.compose.foundation.verticalScroll
 import androidx.compose.runtime.Composable
 import androidx.compose.runtime.getValue
-import androidx.compose.runtime.rememberCoroutineScope
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.res.stringArrayResource
 import androidx.compose.ui.res.stringResource
@@ -23,7 +22,6 @@ import io.legado.app.ui.widget.components.modalBottomSheet.AppModalBottomSheet
 import io.legado.app.ui.widget.components.settingItem.TinyClickableSettingItem
 import io.legado.app.ui.widget.components.settingItem.TinyDropdownSettingItem
 import io.legado.app.ui.widget.components.settingItem.TinySwitchSettingItem
-import kotlinx.coroutines.launch
 import org.koin.compose.koinInject
 
 @Composable
@@ -38,7 +36,6 @@ fun MoreConfigSheet(
     val preferences by readSettingsRepository.preferences.collectAsStateWithLifecycle(
         initialValue = ReadPreferences()
     )
-    val scope = rememberCoroutineScope()
 
     AppModalBottomSheet(
         show = show,
@@ -57,11 +54,9 @@ fun MoreConfigSheet(
                 preferences = preferences,
                 onScreenOrientationChange = {
                     onIntent(ReadBookIntent.SetOrientation(it))
-                    scope.launch { readSettingsRepository.setScreenOrientation(it) }
                 },
                 onKeepLightChange = {
                     onIntent(ReadBookIntent.KeepLightChanged(it))
-                    scope.launch { readSettingsRepository.setKeepLight(it) }
                 },
                 onHideStatusBarChange = {
                     onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.HideStatusBar(it)))
@@ -73,7 +68,7 @@ fun MoreConfigSheet(
                     onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.PaddingDisplayCutouts(it)))
                 },
                 onReadBodyToLhChange = {
-                    scope.launch { readSettingsRepository.setReadBodyToLh(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.ReadBodyToLh(it)))
                 },
                 onTextFullJustifyChange = {
                     onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.TextFullJustify(it)))
@@ -103,16 +98,16 @@ fun MoreConfigSheet(
                     onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.ProgressBarBehavior(it)))
                 },
                 onMouseWheelPageChange = {
-                    scope.launch { readSettingsRepository.setMouseWheelPage(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.MouseWheelPage(it)))
                 },
                 onVolumeKeyPageChange = {
-                    scope.launch { readSettingsRepository.setVolumeKeyPage(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.VolumeKeyPage(it)))
                 },
                 onVolumeKeyPageOnPlayChange = {
-                    scope.launch { readSettingsRepository.setVolumeKeyPageOnPlay(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.VolumeKeyPageOnPlay(it)))
                 },
                 onKeyPageOnLongPressChange = {
-                    scope.launch { readSettingsRepository.setKeyPageOnLongPress(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.KeyPageOnLongPress(it)))
                 },
             )
 
@@ -121,30 +116,33 @@ fun MoreConfigSheet(
             OtherSettings(
                 preferences = preferences,
                 onSliderVibratorChange = {
-                    scope.launch { readSettingsRepository.setSliderVibrator(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.SliderVibrator(it)))
                 },
                 onSelectVibratorChange = {
-                    scope.launch { readSettingsRepository.setSelectVibrator(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.SelectVibrator(it)))
                 },
                 onAutoChangeSourceChange = {
-                    scope.launch { readSettingsRepository.setAutoChangeSource(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.AutoChangeSource(it)))
                 },
                 onSelectTextChange = {
-                    scope.launch { readSettingsRepository.setSelectText(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.SelectText(it)))
                 },
                 onNoAnimScrollPageChange = {
                     onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.NoAnimScrollPage(it)))
                 },
+                onOptimizeRenderChange = {
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.OptimizeRender(it)))
+                },
                 onClickImgWayChange = {
-                    scope.launch { readSettingsRepository.setClickImgWay(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.ClickImgWay(it)))
                 },
                 onOpenClickRegionalConfig = onOpenClickRegionalConfig,
                 onDisableReturnKeyChange = {
-                    scope.launch { readSettingsRepository.setDisableReturnKey(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.DisableReturnKey(it)))
                 },
                 onOpenPageKeyConfig = onOpenPageKeyConfig,
                 onExpandTextMenuChange = {
-                    scope.launch { readSettingsRepository.setExpandTextMenu(it) }
+                    onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.ExpandTextMenu(it)))
                 },
                 onShowReadTitleAdditionChange = {
                     onIntent(ReadBookIntent.UpdateConfig(ConfigUpdate.ShowReadTitleAddition(it)))
@@ -294,6 +292,7 @@ private fun OtherSettings(
     onAutoChangeSourceChange: (Boolean) -> Unit,
     onSelectTextChange: (Boolean) -> Unit,
     onNoAnimScrollPageChange: (Boolean) -> Unit,
+    onOptimizeRenderChange: (Boolean) -> Unit,
     onClickImgWayChange: (String) -> Unit,
     onOpenClickRegionalConfig: () -> Unit,
     onDisableReturnKeyChange: (Boolean) -> Unit,
@@ -329,6 +328,11 @@ private fun OtherSettings(
         checked = preferences.noAnimScrollPage,
         onCheckedChange = onNoAnimScrollPageChange,
     )
+    TinySwitchSettingItem(
+        title = stringResource(R.string.enable_optimize_render),
+        checked = preferences.optimizeRender,
+        onCheckedChange = onOptimizeRenderChange,
+    )
     TinyDropdownSettingItem(
         title = stringResource(R.string.click_image_way),
         selectedValue = preferences.clickImgWay,

+ 30 - 100
app/src/main/java/io/legado/app/ui/config/readConfig/ReadConfig.kt

@@ -96,6 +96,7 @@ object ReadConfig {
         optimizeRender = preferences.optimizeRender
         adaptSpecialStyle = preferences.adaptSpecialStyle
         useUnderline = preferences.useUnderline
+        keepLight = preferences.keepLight
         brightnessVwPos = preferences.brightnessVwPos
         readBrightness = preferences.readBrightness
         brightnessAuto = preferences.brightnessAuto
@@ -110,6 +111,7 @@ object ReadConfig {
         clickActionBC = preferences.clickActionBC
         clickActionBR = preferences.clickActionBR
         screenOrientation = preferences.screenOrientation
+        readBodyToLh = preferences.readBodyToLh
         noAnimScrollPage = preferences.noAnimScrollPage
         tocUiUseReplace = preferences.tocUiUseReplace
         tocCountWords = preferences.tocCountWords
@@ -123,6 +125,9 @@ object ReadConfig {
         mouseWheelPage = preferences.mouseWheelPage
         paddingDisplayCutouts = preferences.paddingDisplayCutouts
         pageTouchSlop = preferences.pageTouchSlop
+        selectText = preferences.selectText
+        disableReturnKey = preferences.disableReturnKey
+        expandTextMenu = preferences.expandTextMenu
         showReadTitleAddition = preferences.showReadTitleAddition
         titleBarMode = preferences.titleBarMode
         menuAlpha = preferences.menuAlpha
@@ -144,15 +149,9 @@ object ReadConfig {
         true
     )
 
-    var screenOrientation by prefDelegate(
-        PreferKey.screenOrientation,
-        "0"
-    )
+    var screenOrientation: String = "0"
 
-    var keepLight by prefDelegate(
-        PreferKey.keepLight,
-        "0"
-    )
+    var keepLight: String = "0"
 
     var hideStatusBar by prefDelegate(
         PreferKey.hideStatusBar,
@@ -164,25 +163,13 @@ object ReadConfig {
         false
     )
 
-    var paddingDisplayCutouts by prefDelegate(
-        PreferKey.paddingDisplayCutouts,
-        false
-    )
+    var paddingDisplayCutouts: Boolean = false
 
-    var titleBarMode by prefDelegate(
-        PreferKey.titleBarMode,
-        "1"
-    )
+    var titleBarMode: String = "1"
 
-    var menuAlpha by prefDelegate(
-        PreferKey.menuAlpha,
-        100
-    )
+    var menuAlpha: Int = 100
 
-    var readBodyToLh by prefDelegate(
-        PreferKey.readBodyToLh,
-        true
-    )
+    var readBodyToLh: Boolean = true
 
     var defaultSourceChangeAll by prefDelegate(
         PreferKey.defaultSourceChangeAll,
@@ -199,10 +186,7 @@ object ReadConfig {
         true
     )
 
-    var adaptSpecialStyle by prefDelegate(
-        PreferKey.adaptSpecialStyle,
-        true
-    )
+    var adaptSpecialStyle: Boolean = true
 
     var useZhLayout by prefDelegate(
         PreferKey.useZhLayout,
@@ -229,100 +213,46 @@ object ReadConfig {
         false
     )
 
-    var useUnderline by prefDelegate(
-        PreferKey.useUnderline,
-        false
-    )
+    var useUnderline: Boolean = false
 
-    var readSliderMode by prefDelegate(
-        PreferKey.readSliderMode,
-        "0"
-    )
+    var readSliderMode: String = "0"
 
-    var doubleHorizontalPage by prefDelegate(
-        PreferKey.doublePageHorizontal,
-        "0"
-    )
+    var doubleHorizontalPage: String = "0"
 
-    var progressBarBehavior by prefDelegate(
-        PreferKey.progressBarBehavior,
-        "page"
-    )
+    var progressBarBehavior: String = "page"
 
-    var mouseWheelPage by prefDelegate(
-        PreferKey.mouseWheelPage,
-        true
-    )
+    var mouseWheelPage: Boolean = true
 
-    var volumeKeyPage by prefDelegate(
-        PreferKey.volumeKeyPage,
-        true
-    )
+    var volumeKeyPage: Boolean = true
 
-    var volumeKeyPageOnPlay by prefDelegate(
-        PreferKey.volumeKeyPageOnPlay,
-        true
-    )
+    var volumeKeyPageOnPlay: Boolean = true
 
-    var keyPageOnLongPress by prefDelegate(
-        PreferKey.keyPageOnLongPress,
-        false
-    )
+    var keyPageOnLongPress: Boolean = false
 
     var pageTouchSlop by prefDelegate(
         PreferKey.pageTouchSlop,
         0
     )
 
-    var sliderVibrator by prefDelegate(
-        PreferKey.sliderVibrator,
-        false
-    )
+    var sliderVibrator: Boolean = false
 
-    var selectVibrator by prefDelegate(
-        PreferKey.selectVibrator,
-        false
-    )
+    var selectVibrator: Boolean = false
 
-    var autoChangeSource by prefDelegate(
-        PreferKey.autoChangeSource,
-        true
-    )
+    var autoChangeSource: Boolean = true
 
-    var selectText by prefDelegate(
-        PreferKey.selectText,
-        true
-    )
+    var selectText: Boolean = true
 
-    var noAnimScrollPage by prefDelegate(
-        PreferKey.noAnimScrollPage,
-        false
-    )
+    var noAnimScrollPage: Boolean = false
 
-    var clickImgWay by prefDelegate(
-        PreferKey.clickImgWay,
-        "2"
-    )
+    var clickImgWay: String = "2"
 
-    var optimizeRender by prefDelegate(
-        PreferKey.optimizeRender,
-        false
-    )
+    var optimizeRender: Boolean = false
 
-    var disableReturnKey by prefDelegate(
-        PreferKey.disableReturnKey,
-        false
-    )
+    var disableReturnKey: Boolean = false
 
-    var expandTextMenu by prefDelegate(
-        PreferKey.expandTextMenu,
-        false
-    )
+    var expandTextMenu: Boolean = false
 
-    var showReadTitleAddition by prefDelegate(
-        PreferKey.showReadTitleAddition,
-        true
-    )
+    var showReadTitleAddition: Boolean = true
 
     var clickActionTL by prefDelegate(
         PreferKey.clickActionTL,

+ 25 - 0
app/src/main/java/io/legado/app/ui/config/readConfig/ReadConfigViewModel.kt

@@ -28,10 +28,12 @@ class ReadConfigViewModel(
         viewModelScope.launch {
             when (intent) {
                 is ReadConfigIntent.ScreenOrientationChanged -> {
+                    ReadConfig.screenOrientation = intent.value
                     readSettingsRepository.setScreenOrientation(intent.value)
                 }
 
                 is ReadConfigIntent.KeepLightChanged -> {
+                    ReadConfig.keepLight = intent.value
                     readSettingsRepository.setKeepLight(intent.value)
                 }
 
@@ -48,19 +50,24 @@ class ReadConfigViewModel(
                 }
 
                 is ReadConfigIntent.PaddingDisplayCutoutsChanged -> {
+                    ReadConfig.paddingDisplayCutouts = intent.value
                     readSettingsRepository.setPaddingDisplayCutouts(intent.value)
                 }
 
                 is ReadConfigIntent.TitleBarModeChanged -> {
+                    ReadConfig.titleBarMode = intent.value
                     readSettingsRepository.setTitleBarMode(intent.value)
                 }
 
                 is ReadConfigIntent.MenuAlphaChanged -> {
+                    ReadConfig.menuAlpha = intent.value
                     readSettingsRepository.setMenuAlpha(intent.value)
                     postEvent(EventBus.UPDATE_READ_ACTION_BAR, true)
                 }
 
                 is ReadConfigIntent.ReadBodyToLhChanged -> {
+                    ReadConfig.readBodyToLh = intent.value
+                    ReadBookConfig.readBodyToLh = intent.value
                     readSettingsRepository.setReadBodyToLh(intent.value)
                 }
 
@@ -79,6 +86,7 @@ class ReadConfigViewModel(
                 }
 
                 is ReadConfigIntent.AdaptSpecialStyleChanged -> {
+                    ReadConfig.adaptSpecialStyle = intent.value
                     readSettingsRepository.setAdaptSpecialStyle(intent.value)
                 }
 
@@ -97,37 +105,45 @@ class ReadConfigViewModel(
                 }
 
                 is ReadConfigIntent.UseUnderlineChanged -> {
+                    ReadConfig.useUnderline = intent.value
                     readSettingsRepository.setUseUnderline(intent.value)
                 }
 
                 is ReadConfigIntent.ReadSliderModeChanged -> {
+                    ReadConfig.readSliderMode = intent.value
                     readSettingsRepository.setReadSliderMode(intent.value)
                     postEvent(EventBus.UPDATE_READ_ACTION_BAR, true)
                 }
 
                 is ReadConfigIntent.DoubleHorizontalPageChanged -> {
+                    ReadConfig.doubleHorizontalPage = intent.value
                     readSettingsRepository.setDoubleHorizontalPage(intent.value)
                     upLayout()
                 }
 
                 is ReadConfigIntent.ProgressBarBehaviorChanged -> {
+                    ReadConfig.progressBarBehavior = intent.value
                     readSettingsRepository.setProgressBarBehavior(intent.value)
                     postEvent(EventBus.UP_SEEK_BAR, true)
                 }
 
                 is ReadConfigIntent.MouseWheelPageChanged -> {
+                    ReadConfig.mouseWheelPage = intent.value
                     readSettingsRepository.setMouseWheelPage(intent.value)
                 }
 
                 is ReadConfigIntent.VolumeKeyPageChanged -> {
+                    ReadConfig.volumeKeyPage = intent.value
                     readSettingsRepository.setVolumeKeyPage(intent.value)
                 }
 
                 is ReadConfigIntent.VolumeKeyPageOnPlayChanged -> {
+                    ReadConfig.volumeKeyPageOnPlay = intent.value
                     readSettingsRepository.setVolumeKeyPageOnPlay(intent.value)
                 }
 
                 is ReadConfigIntent.KeyPageOnLongPressChanged -> {
+                    ReadConfig.keyPageOnLongPress = intent.value
                     readSettingsRepository.setKeyPageOnLongPress(intent.value)
                 }
 
@@ -137,18 +153,22 @@ class ReadConfigViewModel(
                 }
 
                 is ReadConfigIntent.SliderVibratorChanged -> {
+                    ReadConfig.sliderVibrator = intent.value
                     readSettingsRepository.setSliderVibrator(intent.value)
                 }
 
                 is ReadConfigIntent.SelectVibratorChanged -> {
+                    ReadConfig.selectVibrator = intent.value
                     readSettingsRepository.setSelectVibrator(intent.value)
                 }
 
                 is ReadConfigIntent.AutoChangeSourceChanged -> {
+                    ReadConfig.autoChangeSource = intent.value
                     readSettingsRepository.setAutoChangeSource(intent.value)
                 }
 
                 is ReadConfigIntent.SelectTextChanged -> {
+                    ReadConfig.selectText = intent.value
                     readSettingsRepository.setSelectText(intent.value)
                 }
 
@@ -158,23 +178,28 @@ class ReadConfigViewModel(
                 }
 
                 is ReadConfigIntent.ClickImgWayChanged -> {
+                    ReadConfig.clickImgWay = intent.value
                     readSettingsRepository.setClickImgWay(intent.value)
                 }
 
                 is ReadConfigIntent.OptimizeRenderChanged -> {
+                    ReadConfig.optimizeRender = intent.value
                     readSettingsRepository.setOptimizeRender(intent.value)
                     upStyle()
                 }
 
                 is ReadConfigIntent.DisableReturnKeyChanged -> {
+                    ReadConfig.disableReturnKey = intent.value
                     readSettingsRepository.setDisableReturnKey(intent.value)
                 }
 
                 is ReadConfigIntent.ExpandTextMenuChanged -> {
+                    ReadConfig.expandTextMenu = intent.value
                     readSettingsRepository.setExpandTextMenu(intent.value)
                 }
 
                 is ReadConfigIntent.ShowReadTitleAdditionChanged -> {
+                    ReadConfig.showReadTitleAddition = intent.value
                     readSettingsRepository.setShowReadTitleAddition(intent.value)
                     postEvent(EventBus.UPDATE_READ_ACTION_BAR, true)
                 }