Commit a3547387 authored by wanglei's avatar wanglei

...

parent b4831f0d
......@@ -340,25 +340,27 @@ class MainPresenter(
}
fun starGmsScan(activity: Activity) {
val options =
GmsDocumentScannerOptions.Builder()
.setScannerMode(GmsDocumentScannerOptions.SCANNER_MODE_BASE)
.setResultFormats(GmsDocumentScannerOptions.RESULT_FORMAT_PDF)
.setGalleryImportAllowed(true)
runCatching {
val options =
GmsDocumentScannerOptions.Builder()
.setScannerMode(GmsDocumentScannerOptions.SCANNER_MODE_BASE)
.setResultFormats(GmsDocumentScannerOptions.RESULT_FORMAT_PDF)
.setGalleryImportAllowed(true)
options.setScannerMode(GmsDocumentScannerOptions.SCANNER_MODE_FULL)
options.setScannerMode(GmsDocumentScannerOptions.SCANNER_MODE_FULL)
val pageLimit = 1
options.setPageLimit(pageLimit)
val pageLimit = 1
options.setPageLimit(pageLimit)
GmsDocumentScanning.getClient(options.build())
.getStartScanIntent(activity)
.addOnSuccessListener { intentSender: IntentSender ->
scannerLauncher.launch(IntentSenderRequest.Builder(intentSender).build())
}
.addOnFailureListener { e: Exception ->
}
GmsDocumentScanning.getClient(options.build())
.getStartScanIntent(activity)
.addOnSuccessListener { intentSender: IntentSender ->
scannerLauncher.launch(IntentSenderRequest.Builder(intentSender).build())
}
.addOnFailureListener { e: Exception ->
}
}
}
......
......@@ -166,12 +166,14 @@ object PdfDialog {
}
binding.llShare.setOnClickListener {
dialog.dismiss()
val pkg = this.packageName
LogEx.logDebug("showPdfMoreDialog", "pkg=$pkg")
val uri = FileProvider.getUriForFile(
this, this.packageName + ".provider", File(pafPath)
)
startActivity(Intent.createChooser(IntentShareUtils.sharePdfIntent(uri), "Share PDF"))
runCatching {
val pkg = this.packageName
LogEx.logDebug("showPdfMoreDialog", "pkg=$pkg")
val uri = FileProvider.getUriForFile(
this, this.packageName + ".provider", File(pafPath)
)
startActivity(Intent.createChooser(IntentShareUtils.sharePdfIntent(uri), "Share PDF"))
}
}
binding.llPrint.setOnClickListener {
val uri = FileProvider.getUriForFile(
......
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