From 6c723feb2766e832e3465595fa944538213d7d8a Mon Sep 17 00:00:00 2001 From: fengyuecanzhu <1021300691@qq.com> Date: Fri, 7 Jan 2022 14:08:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DMIUI13=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E5=88=87=E6=8D=A2=E6=97=A5=E5=A4=9C=E9=97=B4?= =?UTF-8?q?=E9=97=AA=E9=80=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xyz/fycz/myreader/base/BaseActivity.java | 9 --------- .../myreader/ui/activity/ReadActivity.java | 20 +++++++++++++++++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/xyz/fycz/myreader/base/BaseActivity.java b/app/src/main/java/xyz/fycz/myreader/base/BaseActivity.java index e98cc99..5896d4f 100644 --- a/app/src/main/java/xyz/fycz/myreader/base/BaseActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/base/BaseActivity.java @@ -41,7 +41,6 @@ public abstract class BaseActivity extends SwipeBackActivity { protected Toolbar mToolbar; - private int curNightMode; /****************************abstract area*************************************/ /** * 绑定视图 @@ -154,9 +153,6 @@ public abstract class BaseActivity extends SwipeBackActivity { @Override protected void onResume() { super.onResume(); - if (isThemeChange()) { - recreate(); - } } @Override @@ -174,17 +170,12 @@ public abstract class BaseActivity extends SwipeBackActivity { public void initTheme() { //if (isNightTheme()) { //setTheme(R.style.AppNightTheme); - curNightMode = AppCompatDelegate.getDefaultNightMode(); /*} else { //curNightMode = false; //setTheme(R.style.AppDayTheme); }*/ } - protected boolean isThemeChange() { - return curNightMode != AppCompatDelegate.getDefaultNightMode(); - } - /**************************used method area*******************************************/ protected void startActivity(Class activity) { diff --git a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java index b9bcdb1..7064b1e 100644 --- a/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java +++ b/app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java @@ -653,6 +653,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe } } , (dialog, which) -> { + isCollected = false; mBookService.deleteBookById(mBook.getId()); exit(); }); @@ -1392,13 +1393,28 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe private void changeNightAndDaySetting(boolean isNight) { mSetting.setDayStyle(!isNight); SysManager.saveSetting(mSetting); - App.getApplication().setNightTheme(isNight); + toggleMenu(true); mHandler.postDelayed(() -> { + Intent intent = new Intent(this, ReadActivity.class); + if (aBooks != null) { + intent.putExtra(APPCONST.SOURCE_INDEX, mSourceDialog.getSourceIndex()); + BitIntentDataManager.getInstance().putData(intent, aBooks); + } else { + BitIntentDataManager.getInstance().putData(intent, mBook); + } + if (!isCollected) { + intent.putExtra("isCollected", false); + } + exit(); + App.getApplication().setNightTheme(isNight); + startActivity(intent); + }, mBottomOutAnim.getDuration()); + /*mHandler.postDelayed(() -> { AppCompatActivity activity = ActivityManage.getByClass(this.getClass()); if (activity != null) { BaseDialog.initActivityContext(activity); } - }, 1000); + }, 1000);*/ //mPageLoader.setPageStyle(!isCurDayStyle); }