pull/457/head
gedoor 4 years ago
parent 345b549ce1
commit 7588bf0c1e
  1. 10
      app/src/main/java/io/legado/app/help/AppConfig.kt
  2. 1
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt
  3. 4
      app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt
  4. 3
      app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt
  5. 2
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt

@ -10,9 +10,8 @@ import io.legado.app.utils.*
@Suppress("MemberVisibilityCanBePrivate") @Suppress("MemberVisibilityCanBePrivate")
object AppConfig { object AppConfig {
var isEInkMode: Boolean = false var isEInkMode: Boolean = false
var clickAllNext: Boolean = false val isGooglePlay: Boolean
var isGooglePlay: Boolean val isCoolApk: Boolean
var isCoolApk: Boolean
var replaceEnableDefault: Boolean = true var replaceEnableDefault: Boolean = true
val sysElevation = App.INSTANCE.resources.getDimension(R.dimen.design_appbar_elevation).toInt() val sysElevation = App.INSTANCE.resources.getDimension(R.dimen.design_appbar_elevation).toInt()
@ -24,7 +23,6 @@ object AppConfig {
fun upConfig() { fun upConfig() {
upEInkMode() upEInkMode()
upClickAllNext()
upReplaceEnableDefault() upReplaceEnableDefault()
} }
@ -103,10 +101,6 @@ object AppConfig {
App.INSTANCE.putPrefInt(PreferKey.ttsSpeechRate, value) App.INSTANCE.putPrefInt(PreferKey.ttsSpeechRate, value)
} }
fun upClickAllNext() {
clickAllNext = App.INSTANCE.getPrefBoolean(PreferKey.clickAllNext, false)
}
var chineseConverterType: Int var chineseConverterType: Int
get() = App.INSTANCE.getPrefInt(PreferKey.chineseConverterType) get() = App.INSTANCE.getPrefInt(PreferKey.chineseConverterType)
set(value) { set(value) {

@ -154,6 +154,7 @@ object ReadBookConfig {
} }
} }
val clickTurnPage get() = App.INSTANCE.getPrefBoolean(PreferKey.clickTurnPage, true) val clickTurnPage get() = App.INSTANCE.getPrefBoolean(PreferKey.clickTurnPage, true)
val clickAllNext get() = App.INSTANCE.getPrefBoolean(PreferKey.clickAllNext, false)
val textFullJustify get() = App.INSTANCE.getPrefBoolean(PreferKey.textFullJustify, true) val textFullJustify get() = App.INSTANCE.getPrefBoolean(PreferKey.textFullJustify, true)
val textBottomJustify get() = App.INSTANCE.getPrefBoolean(PreferKey.textBottomJustify, true) val textBottomJustify get() = App.INSTANCE.getPrefBoolean(PreferKey.textBottomJustify, true)
var hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar) var hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar)

@ -12,7 +12,6 @@ import io.legado.app.R
import io.legado.app.base.BasePreferenceFragment import io.legado.app.base.BasePreferenceFragment
import io.legado.app.constant.EventBus import io.legado.app.constant.EventBus
import io.legado.app.constant.PreferKey import io.legado.app.constant.PreferKey
import io.legado.app.help.AppConfig
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.bottomBackground import io.legado.app.lib.theme.bottomBackground
@ -118,9 +117,6 @@ class MoreConfigDialog : DialogFragment() {
PreferKey.showBrightnessView -> { PreferKey.showBrightnessView -> {
postEvent(PreferKey.showBrightnessView, "") postEvent(PreferKey.showBrightnessView, "")
} }
PreferKey.clickAllNext -> {
AppConfig.upClickAllNext()
}
} }
} }

@ -10,7 +10,6 @@ import android.util.AttributeSet
import android.view.MotionEvent import android.view.MotionEvent
import android.view.ViewConfiguration import android.view.ViewConfiguration
import android.widget.FrameLayout import android.widget.FrameLayout
import io.legado.app.help.AppConfig
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.service.help.ReadBook import io.legado.app.service.help.ReadBook
@ -249,7 +248,7 @@ class PageView(context: Context, attrs: AttributeSet) :
callBack.clickCenter() callBack.clickCenter()
} }
} else if (ReadBookConfig.clickTurnPage) { } else if (ReadBookConfig.clickTurnPage) {
if (startX > width / 2 || AppConfig.clickAllNext) { if (startX > width / 2 || ReadBookConfig.clickAllNext) {
pageDelegate?.nextPageByAnim(defaultAnimationSpeed) pageDelegate?.nextPageByAnim(defaultAnimationSpeed)
} else { } else {
pageDelegate?.prevPageByAnim(defaultAnimationSpeed) pageDelegate?.prevPageByAnim(defaultAnimationSpeed)

@ -118,7 +118,7 @@ abstract class HorizontalPageDelegate(pageView: PageView) : PageDelegate(pageVie
abortAnim() abortAnim()
if (!hasNext()) return if (!hasNext()) return
setDirection(Direction.NEXT) setDirection(Direction.NEXT)
pageView.setTouchPoint(viewWidth.toFloat(), 0f) pageView.setTouchPoint(viewWidth.toFloat(), 0f, false)
onAnimStart(animationSpeed) onAnimStart(animationSpeed)
} }

Loading…
Cancel
Save