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); }