Explorar o código

Downgrade SDK to 1.0.8.6 2019-04-29 androidx 64bit

cooperku_kdanmobile %!s(int64=5) %!d(string=hai) anos
pai
achega
a9fb3d484f

BIN=BIN
KMPDFSDK/arm64-v8a/libkmpdf.so


BIN=BIN
KMPDFSDK/armeabi-v7a/libkmpdf.so


BIN=BIN
KMPDFSDK/armeabi/libkmpdf.so


BIN=BIN
KMPDFSDK/kmpdfkit-1.0.8.9 2019-08-29 androidx.aar


BIN=BIN
KMPDFSDK/mips/libkmpdf.so


BIN=BIN
KMPDFSDK/mips64/libkmpdf.so


BIN=BIN
KMPDFSDK/x86/libkmpdf.so


BIN=BIN
KMPDFSDK/x86_64/libkmpdf.so


+ 1 - 1
build.gradle

@@ -51,6 +51,6 @@ dependencies {
 
     testImplementation 'junit:junit:4.12'
 
-    api(name: 'kmpdfkit-1.0.8.9 2019-08-29 androidx', ext: 'aar')
+    api(name: 'kmpdfkit-1.0.8.6 2019-04-29 androidx', ext: 'aar')
     implementation project(path: ':KdanBaseModule')
 }

BIN=BIN
libs/kmpdfkit-1.0.8.9 2019-08-29 androidx.aar


+ 22 - 33
src/main/java/com/kdanmobile/reader/ReaderActivity.kt

@@ -18,7 +18,6 @@ import android.view.*
 import android.view.animation.AnimationUtils
 import android.widget.*
 import com.kdanmobile.base.KdanBaseActivity
-import com.kdanmobile.kmpdfkit.pdfcommon.IKMReaderViewCallback
 import com.kdanmobile.kmpdfkit.pdfcommon.KMPDFReaderView
 import com.kdanmobile.kmpdfkit.pdfcommon.PDFInfo
 import com.kdanmobile.reader.Utils.applyConstraintSet
@@ -463,45 +462,35 @@ abstract class ReaderActivity :
                 }
                 return super.onTouchEvent(motionEvent)
             }
-        }.apply {
-            setIKMReaderViewCallback(object : IKMReaderViewCallback {
-                override fun onMoveToChild(pageIndex: Int) {
-                    viewModel.setPageIndex(pageIndex)
-                }
 
-                override fun onScrolling() {
-                    val isEditMode = viewModel.annotationModeLiveData.value != ReaderViewModel.AnnotationMode.NONE
-                    val isCopyMode = viewModel.isCopyModeLiveData.value != false
+            override fun onMoveToChild(pageIndex: Int) {
+                viewModel.setPageIndex(pageIndex)
+            }
 
-                    if (!isEditMode && !isCopyMode && !isHideToolbar) {
-                        hideAllToolbars()
-                        isHideToolbar = true
-                    }
-                    isHidePdfPage = isEditMode || isCopyMode
-                }
+            override fun onScrolling() {
+                val isEditMode = viewModel.annotationModeLiveData.value != ReaderViewModel.AnnotationMode.NONE
+                val isCopyMode = viewModel.isCopyModeLiveData.value != false
 
-                override fun onTapMainDocArea() {
-                    if (viewModel.annotationEitModeLiveData.value == ReaderViewModel.AnnotationEitMode.FORMTEXT_MODIFY) {
-                        return
-                    }
-                    when (isHideToolbar) {
-                        true -> {
-                            showAllToolbars()
-                            viewModel.clearSelection()
-                        }
-                        false -> hideAllToolbars()
-                    }
-                    isHideToolbar = !isHideToolbar
+                if (!isEditMode && !isCopyMode && !isHideToolbar) {
+                    hideAllToolbars()
+                    isHideToolbar = true
                 }
+                isHidePdfPage = isEditMode || isCopyMode
+            }
 
-                override fun onRecordLastJumpPageNum(p0: Int) {
-                    // Do nothing
+            override fun onTapMainDocArea() {
+                if (viewModel.annotationEitModeLiveData.value == ReaderViewModel.AnnotationEitMode.FORMTEXT_MODIFY) {
+                    return
                 }
-
-                override fun onEndScroll() {
-                    // Do nothing
+                when (isHideToolbar) {
+                    true -> {
+                        showAllToolbars()
+                        viewModel.clearSelection()
+                    }
+                    false -> hideAllToolbars()
                 }
-            })
+                isHideToolbar = !isHideToolbar
+            }
         }
         viewModel.setReaderView(readerView)
         if (!filePath.isNullOrEmpty()) {

+ 1 - 1
src/main/java/com/kdanmobile/reader/ReaderViewModel.kt

@@ -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) ?: return OpenFileResult.FAILED
+        val factory = KMPDFFactory.open(context, uri, type) ?: return OpenFileResult.FAILED
         readerModel.initKMPDFFactory(factory, uri.path, password)
         kmpdfFactory?.also {
             fileNameLiveData.postValue(it.fileName)

+ 1 - 1
src/main/java/com/kdanmobile/reader/screen/view/SearchView.kt

@@ -395,7 +395,7 @@ class SearchView: RelativeLayout, View.OnClickListener, LeftToolbarView {
                                     for (w in chars[bIndex][lIndex]) {
                                         if (w.isEmpty()) continue
                                         for (c in w) {
-                                            builder.append(c.chars)
+                                            builder.append(c.c)
                                         }
                                     }
                                 }