|
|
@ -13,6 +13,7 @@ import android.content.pm.ActivityInfo; |
|
|
|
import android.graphics.BitmapFactory; |
|
|
|
import android.graphics.BitmapFactory; |
|
|
|
import android.graphics.Color; |
|
|
|
import android.graphics.Color; |
|
|
|
import android.net.Uri; |
|
|
|
import android.net.Uri; |
|
|
|
|
|
|
|
import android.os.Build; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Handler; |
|
|
|
import android.os.Handler; |
|
|
|
import android.speech.tts.TextToSpeech; |
|
|
|
import android.speech.tts.TextToSpeech; |
|
|
@ -421,7 +422,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe |
|
|
|
pagePos = pos; |
|
|
|
pagePos = pos; |
|
|
|
saveLastChapterReadPosition(); |
|
|
|
saveLastChapterReadPosition(); |
|
|
|
} |
|
|
|
} |
|
|
|
mHandler.post(()->{ |
|
|
|
mHandler.post(() -> { |
|
|
|
screenOffTimerStart(); |
|
|
|
screenOffTimerStart(); |
|
|
|
initMenu(); |
|
|
|
initMenu(); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -1065,7 +1066,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe |
|
|
|
* 保存最后阅读章节的进度 |
|
|
|
* 保存最后阅读章节的进度 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void saveLastChapterReadPosition() { |
|
|
|
public void saveLastChapterReadPosition() { |
|
|
|
if (!StringHelper.isEmpty(mBook.getId()) && mPageLoader.getPageStatus() == PageLoader.STATUS_FINISH) { |
|
|
|
if (mBook != null && !StringHelper.isEmpty(mBook.getId()) && mPageLoader.getPageStatus() == PageLoader.STATUS_FINISH) { |
|
|
|
mBook.setLastReadPosition(pagePos); |
|
|
|
mBook.setLastReadPosition(pagePos); |
|
|
|
mBook.setHisttoryChapterNum(chapterPos); |
|
|
|
mBook.setHisttoryChapterNum(chapterPos); |
|
|
|
mBookService.updateEntity(mBook); |
|
|
|
mBookService.updateEntity(mBook); |
|
|
@ -1384,6 +1385,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe |
|
|
|
private void changeNightAndDaySetting(boolean isNight) { |
|
|
|
private void changeNightAndDaySetting(boolean isNight) { |
|
|
|
mSetting.setDayStyle(!isNight); |
|
|
|
mSetting.setDayStyle(!isNight); |
|
|
|
SysManager.saveSetting(mSetting); |
|
|
|
SysManager.saveSetting(mSetting); |
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= 31) { |
|
|
|
toggleMenu(true); |
|
|
|
toggleMenu(true); |
|
|
|
mHandler.postDelayed(() -> { |
|
|
|
mHandler.postDelayed(() -> { |
|
|
|
Intent intent = new Intent(this, ReadActivity.class); |
|
|
|
Intent intent = new Intent(this, ReadActivity.class); |
|
|
@ -1400,12 +1402,15 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe |
|
|
|
App.getApplication().setNightTheme(isNight); |
|
|
|
App.getApplication().setNightTheme(isNight); |
|
|
|
startActivity(intent); |
|
|
|
startActivity(intent); |
|
|
|
}, mBottomOutAnim.getDuration()); |
|
|
|
}, mBottomOutAnim.getDuration()); |
|
|
|
/*mHandler.postDelayed(() -> { |
|
|
|
} else { |
|
|
|
|
|
|
|
App.getApplication().setNightTheme(isNight); |
|
|
|
|
|
|
|
mHandler.postDelayed(() -> { |
|
|
|
AppCompatActivity activity = ActivityManage.getByClass(this.getClass()); |
|
|
|
AppCompatActivity activity = ActivityManage.getByClass(this.getClass()); |
|
|
|
if (activity != null) { |
|
|
|
if (activity != null) { |
|
|
|
BaseDialog.initActivityContext(activity); |
|
|
|
BaseDialog.initActivityContext(activity); |
|
|
|
} |
|
|
|
} |
|
|
|
}, 1000);*/ |
|
|
|
}, 1000); |
|
|
|
|
|
|
|
} |
|
|
|
//mPageLoader.setPageStyle(!isCurDayStyle);
|
|
|
|
//mPageLoader.setPageStyle(!isCurDayStyle);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|