|
|
@ -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,28 +1385,32 @@ 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); |
|
|
|
toggleMenu(true); |
|
|
|
if (Build.VERSION.SDK_INT >= 31) { |
|
|
|
mHandler.postDelayed(() -> { |
|
|
|
toggleMenu(true); |
|
|
|
Intent intent = new Intent(this, ReadActivity.class); |
|
|
|
mHandler.postDelayed(() -> { |
|
|
|
if (aBooks != null) { |
|
|
|
Intent intent = new Intent(this, ReadActivity.class); |
|
|
|
intent.putExtra(APPCONST.SOURCE_INDEX, mSourceDialog.getSourceIndex()); |
|
|
|
if (aBooks != null) { |
|
|
|
BitIntentDataManager.getInstance().putData(intent, aBooks); |
|
|
|
intent.putExtra(APPCONST.SOURCE_INDEX, mSourceDialog.getSourceIndex()); |
|
|
|
} else { |
|
|
|
BitIntentDataManager.getInstance().putData(intent, aBooks); |
|
|
|
BitIntentDataManager.getInstance().putData(intent, mBook); |
|
|
|
} else { |
|
|
|
} |
|
|
|
BitIntentDataManager.getInstance().putData(intent, mBook); |
|
|
|
if (!isCollected) { |
|
|
|
} |
|
|
|
intent.putExtra("isCollected", false); |
|
|
|
if (!isCollected) { |
|
|
|
} |
|
|
|
intent.putExtra("isCollected", false); |
|
|
|
exit(); |
|
|
|
} |
|
|
|
|
|
|
|
exit(); |
|
|
|
|
|
|
|
App.getApplication().setNightTheme(isNight); |
|
|
|
|
|
|
|
startActivity(intent); |
|
|
|
|
|
|
|
}, mBottomOutAnim.getDuration()); |
|
|
|
|
|
|
|
} else { |
|
|
|
App.getApplication().setNightTheme(isNight); |
|
|
|
App.getApplication().setNightTheme(isNight); |
|
|
|
startActivity(intent); |
|
|
|
mHandler.postDelayed(() -> { |
|
|
|
}, mBottomOutAnim.getDuration()); |
|
|
|
AppCompatActivity activity = ActivityManage.getByClass(this.getClass()); |
|
|
|
/*mHandler.postDelayed(() -> { |
|
|
|
if (activity != null) { |
|
|
|
AppCompatActivity activity = ActivityManage.getByClass(this.getClass()); |
|
|
|
BaseDialog.initActivityContext(activity); |
|
|
|
if (activity != null) { |
|
|
|
} |
|
|
|
BaseDialog.initActivityContext(activity); |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
}, 1000);*/ |
|
|
|
|
|
|
|
//mPageLoader.setPageStyle(!isCurDayStyle);
|
|
|
|
//mPageLoader.setPageStyle(!isCurDayStyle);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|