|
@@ -1,12 +1,12 @@
|
|
|
package com.kdanmobile.reader
|
|
|
|
|
|
-import androidx.lifecycle.LiveData
|
|
|
-import androidx.lifecycle.MutableLiveData
|
|
|
-import androidx.lifecycle.ViewModel
|
|
|
import android.content.Context
|
|
|
import android.graphics.Color
|
|
|
import android.net.Uri
|
|
|
import androidx.core.content.ContextCompat
|
|
|
+import androidx.lifecycle.LiveData
|
|
|
+import androidx.lifecycle.MutableLiveData
|
|
|
+import androidx.lifecycle.ViewModel
|
|
|
import com.kdanmobile.kmpdfkit.annotation.Annotation
|
|
|
import com.kdanmobile.kmpdfkit.annotation.bean.*
|
|
|
import com.kdanmobile.kmpdfkit.annotation.link.listener.OnLinkInfoChangeListener
|
|
@@ -221,7 +221,7 @@ class ReaderViewModel(
|
|
|
|
|
|
private fun openPdfFileImp(context: Context, password: String, requestPassword: Runnable, type: String?): OpenFileResult {
|
|
|
file = File(uri.path)
|
|
|
- val factory = KMPDFFactory.open(context, uri, type) ?: return OpenFileResult.FAILED
|
|
|
+ val factory = MyKMPDFFactory.open(context, uri) ?: return OpenFileResult.FAILED
|
|
|
readerModel.initKMPDFFactory(factory, uri.path, password)
|
|
|
kmpdfFactory?.also {
|
|
|
fileNameLiveData.postValue(it.fileName)
|