Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner White ago
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kuxulei
PDF Viewer Scanner White ago
Commits
a3547387
Commit
a3547387
authored
Oct 15, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
b4831f0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
21 deletions
+25
-21
MainPresenter.kt
...a/com/base/pdfviewerscannerwhite/ui/main/MainPresenter.kt
+17
-15
PdfDialog.kt
.../java/com/base/pdfviewerscannerwhite/ui/view/PdfDialog.kt
+8
-6
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/ui/main/MainPresenter.kt
View file @
a3547387
...
...
@@ -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
->
}
}
}
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/view/PdfDialog.kt
View file @
a3547387
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment