pull/32/head
kunfei 5 years ago
parent e2d7351a40
commit ebe9703445
  1. 8
      app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt
  2. 13
      app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt

@ -5,7 +5,6 @@ import android.view.KeyEvent
import android.view.Menu
import android.view.MenuItem
import androidx.lifecycle.Observer
import io.legado.app.App
import io.legado.app.R
import io.legado.app.base.VMBaseActivity
import io.legado.app.constant.Bus
@ -69,8 +68,6 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea
}
}
private fun initView() {
tv_chapter_name.onClick {
@ -87,11 +84,6 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_rea
}
override fun setNightTheme() {
putPrefBoolean("isNightTheme", !isNightTheme)
App.INSTANCE.applyDayNight()
}
override fun skipPreChapter() {
}

@ -7,12 +7,10 @@ import android.view.animation.AnimationUtils
import android.widget.FrameLayout
import android.widget.SeekBar
import androidx.core.view.isVisible
import io.legado.app.App
import io.legado.app.R
import io.legado.app.constant.Bus
import io.legado.app.utils.invisible
import io.legado.app.utils.isNightTheme
import io.legado.app.utils.postEvent
import io.legado.app.utils.visible
import io.legado.app.utils.*
import kotlinx.android.synthetic.main.view_read_menu.view.*
import org.jetbrains.anko.sdk27.listeners.onClick
@ -138,7 +136,10 @@ class ReadMenu : FrameLayout {
fabReplaceRule.onClick { callback?.openReplaceRule() }
//夜间模式
fabNightTheme.onClick { callback?.setNightTheme() }
fabNightTheme.onClick {
context.putPrefBoolean("isNightTheme", !context.isNightTheme)
App.INSTANCE.applyDayNight()
}
//上一章
tv_pre.onClick { callback?.skipPreChapter() }
@ -174,8 +175,6 @@ class ReadMenu : FrameLayout {
fun autoPage()
fun setNightTheme()
fun skipPreChapter()
fun skipNextChapter()

Loading…
Cancel
Save