|
@@ -2349,6 +2349,7 @@ class ReadBookViewModel(
|
|
|
is ConfigUpdate.TipFooterLeft -> ReadBookConfig.tipFooterLeft = update.value
|
|
is ConfigUpdate.TipFooterLeft -> ReadBookConfig.tipFooterLeft = update.value
|
|
|
is ConfigUpdate.TipFooterMiddle -> ReadBookConfig.tipFooterMiddle = update.value
|
|
is ConfigUpdate.TipFooterMiddle -> ReadBookConfig.tipFooterMiddle = update.value
|
|
|
is ConfigUpdate.TipFooterRight -> ReadBookConfig.tipFooterRight = update.value
|
|
is ConfigUpdate.TipFooterRight -> ReadBookConfig.tipFooterRight = update.value
|
|
|
|
|
+ is ConfigUpdate.HeaderFont -> ReadBookConfig.headerFont = update.path
|
|
|
is ConfigUpdate.HeaderFontSize -> ReadBookConfig.headerFontSize = update.value
|
|
is ConfigUpdate.HeaderFontSize -> ReadBookConfig.headerFontSize = update.value
|
|
|
is ConfigUpdate.TipHeaderColor -> ReadBookConfig.tipHeaderColor = update.color
|
|
is ConfigUpdate.TipHeaderColor -> ReadBookConfig.tipHeaderColor = update.color
|
|
|
is ConfigUpdate.TipFooterColor -> ReadBookConfig.tipFooterColor = update.color
|
|
is ConfigUpdate.TipFooterColor -> ReadBookConfig.tipFooterColor = update.color
|
|
@@ -2722,27 +2723,32 @@ class ReadBookViewModel(
|
|
|
|
|
|
|
|
// --- Display toggles ---
|
|
// --- Display toggles ---
|
|
|
is ConfigUpdate.PaddingDisplayCutouts -> {
|
|
is ConfigUpdate.PaddingDisplayCutouts -> {
|
|
|
|
|
+ ReadConfig.paddingDisplayCutouts = update.value
|
|
|
viewModelScope.launch {
|
|
viewModelScope.launch {
|
|
|
readSettingsRepository.setPaddingDisplayCutouts(update.value)
|
|
readSettingsRepository.setPaddingDisplayCutouts(update.value)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
is ConfigUpdate.TitleBarMode -> {
|
|
is ConfigUpdate.TitleBarMode -> {
|
|
|
|
|
+ ReadConfig.titleBarMode = update.value
|
|
|
viewModelScope.launch {
|
|
viewModelScope.launch {
|
|
|
readSettingsRepository.setTitleBarMode(update.value)
|
|
readSettingsRepository.setTitleBarMode(update.value)
|
|
|
}
|
|
}
|
|
|
postEvent(EventBus.UPDATE_READ_ACTION_BAR, true)
|
|
postEvent(EventBus.UPDATE_READ_ACTION_BAR, true)
|
|
|
}
|
|
}
|
|
|
is ConfigUpdate.TextFullJustify -> {
|
|
is ConfigUpdate.TextFullJustify -> {
|
|
|
|
|
+ ReadBookConfig.textFullJustify = update.value
|
|
|
viewModelScope.launch {
|
|
viewModelScope.launch {
|
|
|
readSettingsRepository.setTextFullJustify(update.value)
|
|
readSettingsRepository.setTextFullJustify(update.value)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
is ConfigUpdate.TextBottomJustify -> {
|
|
is ConfigUpdate.TextBottomJustify -> {
|
|
|
|
|
+ ReadBookConfig.textBottomJustify = update.value
|
|
|
viewModelScope.launch {
|
|
viewModelScope.launch {
|
|
|
readSettingsRepository.setTextBottomJustify(update.value)
|
|
readSettingsRepository.setTextBottomJustify(update.value)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
is ConfigUpdate.AdaptSpecialStyle -> {
|
|
is ConfigUpdate.AdaptSpecialStyle -> {
|
|
|
|
|
+ ReadConfig.adaptSpecialStyle = update.value
|
|
|
viewModelScope.launch {
|
|
viewModelScope.launch {
|
|
|
readSettingsRepository.setAdaptSpecialStyle(update.value)
|
|
readSettingsRepository.setAdaptSpecialStyle(update.value)
|
|
|
}
|
|
}
|
|
@@ -2760,6 +2766,7 @@ class ReadBookViewModel(
|
|
|
postEvent(PreferKey.showBrightnessView, "")
|
|
postEvent(PreferKey.showBrightnessView, "")
|
|
|
}
|
|
}
|
|
|
is ConfigUpdate.UseUnderlineGlobal -> {
|
|
is ConfigUpdate.UseUnderlineGlobal -> {
|
|
|
|
|
+ ReadConfig.useUnderline = update.value
|
|
|
viewModelScope.launch {
|
|
viewModelScope.launch {
|
|
|
readSettingsRepository.setUseUnderline(update.value)
|
|
readSettingsRepository.setUseUnderline(update.value)
|
|
|
}
|
|
}
|
|
@@ -2782,12 +2789,14 @@ class ReadBookViewModel(
|
|
|
ReadBook.loadContent(false)
|
|
ReadBook.loadContent(false)
|
|
|
}
|
|
}
|
|
|
is ConfigUpdate.ProgressBarBehavior -> {
|
|
is ConfigUpdate.ProgressBarBehavior -> {
|
|
|
|
|
+ ReadConfig.progressBarBehavior = update.value
|
|
|
viewModelScope.launch {
|
|
viewModelScope.launch {
|
|
|
readSettingsRepository.setProgressBarBehavior(update.value)
|
|
readSettingsRepository.setProgressBarBehavior(update.value)
|
|
|
}
|
|
}
|
|
|
_uiState.update { it.copy(styleConfig = buildStyleConfig()) }
|
|
_uiState.update { it.copy(styleConfig = buildStyleConfig()) }
|
|
|
}
|
|
}
|
|
|
is ConfigUpdate.NoAnimScrollPage -> {
|
|
is ConfigUpdate.NoAnimScrollPage -> {
|
|
|
|
|
+ ReadConfig.noAnimScrollPage = update.value
|
|
|
viewModelScope.launch {
|
|
viewModelScope.launch {
|
|
|
readSettingsRepository.setNoAnimScrollPage(update.value)
|
|
readSettingsRepository.setNoAnimScrollPage(update.value)
|
|
|
}
|
|
}
|
|
@@ -2807,6 +2816,14 @@ class ReadBookViewModel(
|
|
|
readSettingsRepository.setAutoReadSpeed(update.value)
|
|
readSettingsRepository.setAutoReadSpeed(update.value)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ // --- Chinese converter ---
|
|
|
|
|
+ is ConfigUpdate.ChineseConverterType -> {
|
|
|
|
|
+ ReadConfig.chineseConverterType = update.value
|
|
|
|
|
+ viewModelScope.launch {
|
|
|
|
|
+ readSettingsRepository.setChineseConverterType(update.value)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Notify rendering layer
|
|
// Notify rendering layer
|