From ebe970344580bd169efc524f6e6314bb17f78698 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 23 Aug 2019 12:31:42 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/readbook/ReadBookActivity.kt | 8 -------- .../main/java/io/legado/app/ui/readbook/ReadMenu.kt | 13 ++++++------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt index 8067ef255..1e4ace654 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.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(R.layout.activity_rea } } - - private fun initView() { tv_chapter_name.onClick { @@ -87,11 +84,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea } - override fun setNightTheme() { - putPrefBoolean("isNightTheme", !isNightTheme) - App.INSTANCE.applyDayNight() - } - override fun skipPreChapter() { } diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt index 960101dfb..aaba5fda2 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt @@ -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()