|
@@ -18,7 +18,6 @@ import android.view.*
|
|
import android.view.animation.AnimationUtils
|
|
import android.view.animation.AnimationUtils
|
|
import android.widget.*
|
|
import android.widget.*
|
|
import com.kdanmobile.base.KdanBaseActivity
|
|
import com.kdanmobile.base.KdanBaseActivity
|
|
-import com.kdanmobile.kmpdfkit.pdfcommon.IKMReaderViewCallback
|
|
|
|
import com.kdanmobile.kmpdfkit.pdfcommon.KMPDFReaderView
|
|
import com.kdanmobile.kmpdfkit.pdfcommon.KMPDFReaderView
|
|
import com.kdanmobile.kmpdfkit.pdfcommon.PDFInfo
|
|
import com.kdanmobile.kmpdfkit.pdfcommon.PDFInfo
|
|
import com.kdanmobile.reader.Utils.applyConstraintSet
|
|
import com.kdanmobile.reader.Utils.applyConstraintSet
|
|
@@ -463,45 +462,35 @@ abstract class ReaderActivity :
|
|
}
|
|
}
|
|
return super.onTouchEvent(motionEvent)
|
|
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)
|
|
viewModel.setReaderView(readerView)
|
|
if (!filePath.isNullOrEmpty()) {
|
|
if (!filePath.isNullOrEmpty()) {
|