Commit abb45d9e authored by wanglei's avatar wanglei

...

parent e0748597
......@@ -92,9 +92,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
pdfPresenter.password = pwd
pdfPageAdapter.setPassword(pwd)
createPdfUI()
binding.root.postDelayed({
pdfPresenter.iniPdfPage(path, uri)
}, 500)
muPDFCore?.countPages()?.let { pdfPresenter.iniPdfPage(it) }
SpStringUtils.addSpString(LAST_VIEW_KEY, "${path}_${System.currentTimeMillis()}")
} else {
toast("unknown error")
......@@ -102,9 +100,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
}
} else {
createPdfUI()
binding.root.postDelayed({
pdfPresenter.iniPdfPage(path, uri)
}, 500)
muPDFCore?.countPages()?.let { pdfPresenter.iniPdfPage(it) }
SpStringUtils.addSpString(LAST_VIEW_KEY, "${path}_${System.currentTimeMillis()}")
}
......@@ -240,7 +236,7 @@ class PdfActivity : BaseActivity<ActivityPdfBinding>(), PdfView {
}
binding.verticalSeekbar.setOnReleaseListener { progress ->
LogEx.logDebug(TAG, "progress=$progress")
val total = muPDFCore?.countPages()?:0
val total = muPDFCore?.countPages() ?: 0
val pageIndex = total - 1 - progress
binding.mupdfReaderView.displayedViewIndex = pageIndex
......
......@@ -53,6 +53,14 @@ class PdfPresenter(
pdfView?.initPdfPageRv(list)
}
fun iniPdfPage(pageCount: Int) {
val list = arrayListOf<PdfPageBean>()
repeat(pageCount) {
list.add(PdfPageBean(it))
}
pdfView?.initPdfPageRv(list)
}
fun splitPdf(
srcPath: String,
......
......@@ -234,6 +234,7 @@ class DocumentFragment(
}
@SuppressLint("SetTextI18n")
fun changeSearchUI(show: Boolean) {
if (show) {
uiMode = UI_MODE_SEARCH
......@@ -243,7 +244,8 @@ class DocumentFragment(
binding.ivPaixu.visibility = View.INVISIBLE
binding.ivXuanze.visibility = View.INVISIBLE
binding.llMainContent.visibility = View.INVISIBLE
binding.llEmpty.visibility=View.INVISIBLE
binding.llEmpty.visibility = View.INVISIBLE
binding.editSearch.setText("")
binding.flFanhui.visibility = View.VISIBLE
binding.editSearch.visibility = View.VISIBLE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment