Commit b09b9b7a authored by wanglei's avatar wanglei

...

parent cd845150
...@@ -19,6 +19,7 @@ import com.base.pdfviewerscannerwhite.helper.MyApplication ...@@ -19,6 +19,7 @@ import com.base.pdfviewerscannerwhite.helper.MyApplication
import com.base.pdfviewerscannerwhite.ui.main.DocumentAdapter import com.base.pdfviewerscannerwhite.ui.main.DocumentAdapter
import com.base.pdfviewerscannerwhite.ui.main.DocumentPresenter import com.base.pdfviewerscannerwhite.ui.main.DocumentPresenter
import com.base.pdfviewerscannerwhite.ui.main.DocumentView import com.base.pdfviewerscannerwhite.ui.main.DocumentView
import com.base.pdfviewerscannerwhite.ui.main.MainActivity.Companion.jumpDocument
import com.base.pdfviewerscannerwhite.ui.view.PdfDialog.showPdfPwdDialog import com.base.pdfviewerscannerwhite.ui.view.PdfDialog.showPdfPwdDialog
import com.base.pdfviewerscannerwhite.utils.LogEx import com.base.pdfviewerscannerwhite.utils.LogEx
...@@ -101,9 +102,23 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>(), DocumentView ...@@ -101,9 +102,23 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>(), DocumentView
adapter = DocumentAdapter(this) adapter = DocumentAdapter(this)
adapter.itemClick = { adapter.itemClick = {
if (doWhat == DO_SPLIT_PDF) { if (doWhat == DO_SPLIT_PDF) {
if (it.state == 0) {
startActivity(Intent(this, PdfSplitActivity::class.java).apply { startActivity(Intent(this, PdfSplitActivity::class.java).apply {
putExtra("path", it.path) putExtra("path", it.path)
}) })
} else {
showPdfPwdDialog(
state = it.state,
path = it.path,
isCheckPwd = true,
verificationAction = { pwd ->
startActivity(Intent(this, PdfSplitActivity::class.java).apply {
putExtra("path", it.path)
putExtra("pwd", pwd)
})
})
}
} }
if (doWhat == DO_LOCK_PDF) { if (doWhat == DO_LOCK_PDF) {
showPdfPwdDialog(state = it.state, path = it.path, encryptionAction = { showPdfPwdDialog(state = it.state, path = it.path, encryptionAction = {
......
...@@ -64,9 +64,12 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu ...@@ -64,9 +64,12 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu
fun refreshData() = lifecycleScope.launch(Dispatchers.IO) { fun refreshData() = lifecycleScope.launch(Dispatchers.IO) {
if (isInitialized && !isHidden && !MainPresenter.mainRefreshData) { if (isInitialized && !isHidden && !MainPresenter.mainRefreshData) {
LogEx.logDebug(TAG, "type=$type refreshData dataType=$dataType") LogEx.logDebug(TAG, "type=$type refreshData dataType=$dataType")
val list = val mainActivity = (requireActivity() as MainActivity?)
(requireActivity() as MainActivity).mainPresenter.getDataByType(type, dataType) val documentFragment = (parentFragment as DocumentFragment?)
val dataType = (parentFragment as DocumentFragment).dataType if (mainActivity == null || documentFragment == null) return@launch
val list = mainActivity.mainPresenter.getDataByType(type, dataType)
val dataType = documentFragment.dataType
val arrayList = arrayListOf<DocumentBean>() val arrayList = arrayListOf<DocumentBean>()
......
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