Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Jan 25, 2025
1 parent b3447e7 commit 173815c
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,6 @@ class ReadBookActivity : BaseReadBookActivity(),
upSystemUiVisibility()
if (hasFocus) {
binding.readMenu.upBrightnessState()
} else if (!menuLayoutIsVisible) {
ReadBook.cancelPreDownloadTask()
}
}

Expand All @@ -323,6 +321,12 @@ class ReadBookActivity : BaseReadBookActivity(),
binding.readView.upStatusBar()
}

override fun onTopResumedActivityChanged(isTopResumedActivity: Boolean) {
if (!isTopResumedActivity) {
ReadBook.cancelPreDownloadTask()
}
}

@SuppressLint("UnspecifiedRegisterReceiverFlag")
override fun onResume() {
super.onResume()
Expand Down Expand Up @@ -358,7 +362,6 @@ class ReadBookActivity : BaseReadBookActivity(),
autoPageStop()
backupJob?.cancel()
ReadBook.saveRead()
ReadBook.cancelPreDownloadTask()
unregisterReceiver(timeBatteryReceiver)
upSystemUiVisibility()
if (!BuildConfig.DEBUG) {
Expand Down

0 comments on commit 173815c

Please sign in to comment.