|
|
@ -81,9 +81,14 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
override val isInitFinish: Boolean get() = viewModel.isInitFinish |
|
|
|
override val isInitFinish: Boolean get() = viewModel.isInitFinish |
|
|
|
override val isScroll: Boolean get() = binding.readView.isScroll |
|
|
|
override val isScroll: Boolean get() = binding.readView.isScroll |
|
|
|
private val mHandler = Handler(Looper.getMainLooper()) |
|
|
|
private val mHandler = Handler(Looper.getMainLooper()) |
|
|
|
private val keepScreenRunnable: Runnable = |
|
|
|
private val keepScreenRunnable = Runnable { keepScreenOn(window, false) } |
|
|
|
Runnable { keepScreenOn(window, false) } |
|
|
|
private val autoPageRunnable = Runnable { autoPagePlus() } |
|
|
|
private val autoPageRunnable: Runnable = Runnable { autoPagePlus() } |
|
|
|
private val backupRunnable = Runnable { |
|
|
|
|
|
|
|
if (!BuildConfig.DEBUG) { |
|
|
|
|
|
|
|
ReadBook.uploadProgress() |
|
|
|
|
|
|
|
Backup.autoBack(this) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
override var autoPageProgress = 0 |
|
|
|
override var autoPageProgress = 0 |
|
|
|
override var isAutoPage = false |
|
|
|
override var isAutoPage = false |
|
|
|
private var screenTimeOut: Long = 0 |
|
|
|
private var screenTimeOut: Long = 0 |
|
|
@ -129,6 +134,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
|
|
|
|
|
|
|
|
override fun onPause() { |
|
|
|
override fun onPause() { |
|
|
|
super.onPause() |
|
|
|
super.onPause() |
|
|
|
|
|
|
|
mHandler.removeCallbacks(backupRunnable) |
|
|
|
ReadBook.saveRead() |
|
|
|
ReadBook.saveRead() |
|
|
|
timeBatteryReceiver?.let { |
|
|
|
timeBatteryReceiver?.let { |
|
|
|
unregisterReceiver(it) |
|
|
|
unregisterReceiver(it) |
|
|
@ -571,6 +577,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
launch { |
|
|
|
launch { |
|
|
|
binding.readMenu.setSeekPage(ReadBook.durPageIndex()) |
|
|
|
binding.readMenu.setSeekPage(ReadBook.durPageIndex()) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
mHandler.postDelayed(backupRunnable, 600000) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|