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
d2274f86
Commit
d2274f86
authored
Sep 23, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
76c2e1cc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
9 deletions
+8
-9
MyApplication.kt
...va/com/base/pdfviewerscannerwhite/helper/MyApplication.kt
+2
-3
PdfActivity.kt
...base/pdfviewerscannerwhite/ui/document/pdf/PdfActivity.kt
+0
-1
PdfPagerAdapter.kt
.../pdfviewerscannerwhite/ui/document/pdf/PdfPagerAdapter.kt
+0
-1
DocumentFragment.kt
...om/base/pdfviewerscannerwhite/ui/main/DocumentFragment.kt
+0
-1
DialogView.kt
...java/com/base/pdfviewerscannerwhite/ui/view/DialogView.kt
+6
-3
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/helper/MyApplication.kt
View file @
d2274f86
...
@@ -5,6 +5,7 @@ import android.app.Application
...
@@ -5,6 +5,7 @@ import android.app.Application
import
android.text.TextUtils
import
android.text.TextUtils
import
com.base.pdfviewerscannerwhite.utils.AppPreferences
import
com.base.pdfviewerscannerwhite.utils.AppPreferences
import
com.base.pdfviewerscannerwhite.utils.LogEx
import
com.base.pdfviewerscannerwhite.utils.LogEx
import
com.tom_roush.pdfbox.android.PDFBoxResourceLoader
import
java.util.UUID
import
java.util.UUID
...
@@ -25,6 +26,7 @@ class MyApplication : Application() {
...
@@ -25,6 +26,7 @@ class MyApplication : Application() {
context
=
this
context
=
this
initUUid
()
initUUid
()
initApp
()
initApp
()
PDFBoxResourceLoader
.
init
(
applicationContext
)
}
}
private
fun
initUUid
()
{
private
fun
initUUid
()
{
...
@@ -44,7 +46,4 @@ class MyApplication : Application() {
...
@@ -44,7 +46,4 @@ class MyApplication : Application() {
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfActivity.kt
View file @
d2274f86
...
@@ -37,7 +37,6 @@ import java.io.File
...
@@ -37,7 +37,6 @@ import java.io.File
class
PdfActivity
:
BaseActivity
<
ActivityPdfBinding
>(),
PdfView
{
class
PdfActivity
:
BaseActivity
<
ActivityPdfBinding
>(),
PdfView
{
private
val
TAG
=
"PdfActivity"
private
val
TAG
=
"PdfActivity"
private
lateinit
var
pdfPresenter
:
PdfPresenter
private
lateinit
var
pdfPresenter
:
PdfPresenter
private
lateinit
var
pdfPageAdapter
:
PdfPagerAdapter
private
lateinit
var
pdfPageAdapter
:
PdfPagerAdapter
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfPagerAdapter.kt
View file @
d2274f86
...
@@ -102,7 +102,6 @@ class PdfPagerAdapter(
...
@@ -102,7 +102,6 @@ class PdfPagerAdapter(
}
}
}
}
}
}
}
}
}
}
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/main/DocumentFragment.kt
View file @
d2274f86
...
@@ -52,7 +52,6 @@ class DocumentFragment() : BaseFragment<FragmentDocumentBinding>(), DocumentView
...
@@ -52,7 +52,6 @@ class DocumentFragment() : BaseFragment<FragmentDocumentBinding>(), DocumentView
if
(
item
.
state
==
0
)
{
if
(
item
.
state
==
0
)
{
startActivity
(
Intent
(
requireContext
(),
PdfActivity
::
class
.
java
).
apply
{
startActivity
(
Intent
(
requireContext
(),
PdfActivity
::
class
.
java
).
apply
{
putExtra
(
"path"
,
item
.
path
)
putExtra
(
"path"
,
item
.
path
)
// putExtra("uri", item.uri.toString())
})
})
}
}
if
(
item
.
state
==
1
)
{
if
(
item
.
state
==
1
)
{
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/view/DialogView.kt
View file @
d2274f86
...
@@ -238,11 +238,12 @@ object DialogView {
...
@@ -238,11 +238,12 @@ object DialogView {
dialog
.
dismiss
()
dialog
.
dismiss
()
}
}
binding
.
tvConfirm
.
setOnClickListener
{
binding
.
tvConfirm
.
setOnClickListener
{
dialog
.
dismiss
()
firstDialog
?.
dismiss
()
val
pwd
=
binding
.
edit
.
text
.
toString
()
val
pwd
=
binding
.
edit
.
text
.
toString
()
if
(!
isCheckPwd
)
{
if
(!
isCheckPwd
)
{
dialog
.
dismiss
()
firstDialog
?.
dismiss
()
if
(
state
==
0
)
{
if
(
state
==
0
)
{
PdfBoxUtils
.
setPassword
(
path
,
pwd
,
pwd
)
PdfBoxUtils
.
setPassword
(
path
,
pwd
,
pwd
)
toast
(
"Success Encryption"
)
toast
(
"Success Encryption"
)
...
@@ -254,11 +255,13 @@ object DialogView {
...
@@ -254,11 +255,13 @@ object DialogView {
encryptionAction
?.
invoke
()
encryptionAction
?.
invoke
()
}
}
}
else
{
}
else
{
val
result
=
PdfBoxUtils
.
checkPwd
(
this
,
path
,
pwd
,
uri
.
toString
()
)
val
result
=
PdfBoxUtils
.
checkPwd
(
this
,
path
,
pwd
,
uri
)
if
(!
result
)
{
if
(!
result
)
{
binding
.
tvErrorTip
.
visibility
=
View
.
VISIBLE
binding
.
tvErrorTip
.
visibility
=
View
.
VISIBLE
return
@setOnClickListener
return
@setOnClickListener
}
}
dialog
.
dismiss
()
firstDialog
?.
dismiss
()
verificationAction
?.
invoke
(
pwd
)
verificationAction
?.
invoke
(
pwd
)
}
}
...
...
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