优化 EPUB 翻页与后台分页刷新
This commit is contained in:
@@ -763,6 +763,14 @@ public class RDReaderView: UIView {
|
||||
guard let safePageNum = clampedPageNumber(pageNum) else { return }
|
||||
switch currentDisplayType {
|
||||
case .pageCurl:
|
||||
if !animated, safePageNum == currentPage, !detectPageViewControllerFault(pageViewController) {
|
||||
RDReaderTapDebug.log(
|
||||
"ReaderView.transitionToPage",
|
||||
"skip same page page=\(safePageNum) animated=\(animated)"
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
let request = PageTransitionRequest(pageNum: safePageNum, animated: animated)
|
||||
if shouldQueuePageTransition(request) {
|
||||
return
|
||||
@@ -823,6 +831,7 @@ public class RDReaderView: UIView {
|
||||
}
|
||||
|
||||
public func reloadData() {
|
||||
invalidatePageCaches()
|
||||
switchReaderDisplayType(currentDisplayType)
|
||||
topToolView = resolvedTopChromeView()
|
||||
bottomToolView = resolvedBottomChromeView()
|
||||
@@ -830,8 +839,9 @@ public class RDReaderView: UIView {
|
||||
|
||||
public func reloadPageCountOnly() {
|
||||
if currentDisplayType == .pageCurl {
|
||||
if !isPageCurlTransitioning, currentPage >= 0, numberOfPages() > 0 {
|
||||
transitionToPage(pageNum: currentPage, animated: false)
|
||||
let totalPages = numberOfPages()
|
||||
if !isPageCurlTransitioning, currentPage >= totalPages, totalPages > 0 {
|
||||
transitionToPage(pageNum: totalPages - 1, animated: false)
|
||||
}
|
||||
} else {
|
||||
collectionView.reloadData()
|
||||
|
||||
Reference in New Issue
Block a user