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")
object AppConfig {
var isEInkMode: Boolean = false
var clickAllNext: Boolean = false
var isGooglePlay: Boolean
var isCoolApk: Boolean
val isGooglePlay: Boolean
val isCoolApk: Boolean
var replaceEnableDefault: Boolean = true
val sysElevation = App.INSTANCE.resources.getDimension(R.dimen.design_appbar_elevation).toInt()
@ -24,7 +23,6 @@ object AppConfig {
fun upConfig() {
upEInkMode()
upClickAllNext()
upReplaceEnableDefault()
}
@ -103,10 +101,6 @@ object AppConfig {
App.INSTANCE.putPrefInt(PreferKey.ttsSpeechRate, value)
}
fun upClickAllNext() {
clickAllNext = App.INSTANCE.getPrefBoolean(PreferKey.clickAllNext, false)
}
var chineseConverterType: Int
get() = App.INSTANCE.getPrefInt(PreferKey.chineseConverterType)
set(value) {

@ -154,6 +154,7 @@ object ReadBookConfig {
}
}
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 textBottomJustify get() = App.INSTANCE.getPrefBoolean(PreferKey.textBottomJustify, true)
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.constant.EventBus
import io.legado.app.constant.PreferKey
import io.legado.app.help.AppConfig
import io.legado.app.help.ReadBookConfig
import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.bottomBackground
@ -118,9 +117,6 @@ class MoreConfigDialog : DialogFragment() {
PreferKey.showBrightnessView -> {
postEvent(PreferKey.showBrightnessView, "")
}
PreferKey.clickAllNext -> {
AppConfig.upClickAllNext()
}
}
}

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

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

Loading…
Cancel
Save