Resolve #865
This commit is contained in:
1 parent
a6c204e444
commit
f51e585d8d
5 files changed
+9
-1
No files matched your search
@@ -117,6 +117,9 @@ class ArchivePageLoader(context: Context, uri: Uri, passwdFlow: Flow<String>) :
|
||||
return size != 0
|
||||
}
|
||||
|
||||
override val isReady: Boolean
|
||||
get() = size != 0
|
||||
|
||||
override fun onCancelRequest(index: Int) {
|
||||
mJobMap[index]?.cancel()
|
||||
}
|
||||
|
||||
@@ -100,6 +100,9 @@ class EhPageLoader(private val mGalleryInfo: GalleryInfo) : PageLoader2(), OnSpi
|
||||
return mSpiderQueen.awaitReady()
|
||||
}
|
||||
|
||||
override val isReady: Boolean
|
||||
get() = mSpiderQueen.isReady
|
||||
|
||||
override fun onCancelRequest(index: Int) {
|
||||
mSpiderQueen.cancelRequest(index)
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ class SpiderQueen private constructor(val galleryInfo: GalleryInfo) : CoroutineS
|
||||
}
|
||||
|
||||
private var downloadMode = false
|
||||
private val isReady
|
||||
val isReady
|
||||
get() = this::mSpiderInfo.isInitialized && this::mPageStateArray.isInitialized
|
||||
|
||||
@Synchronized
|
||||
|
||||
@@ -320,6 +320,7 @@ class ReaderActivity : EhActivity() {
|
||||
}
|
||||
|
||||
fun setGallery() {
|
||||
if (mGalleryProvider?.isReady != true) return
|
||||
// TODO: Not well place to call it
|
||||
dialog.dismiss()
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ abstract class PageLoader {
|
||||
private val mPreloads = MathUtils.clamp(com.hippo.ehviewer.Settings.getPreloadImage(), 0, 100)
|
||||
|
||||
abstract suspend fun awaitReady(): Boolean
|
||||
abstract val isReady: Boolean
|
||||
|
||||
abstract fun start()
|
||||
|
||||
|
||||
Reference in new issue
Block a user