Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
S
Super PDF Reader
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
wanglei
Super PDF Reader
Commits
9964ecd4
Commit
9964ecd4
authored
Jun 27, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...提交部分功能...
parent
3ad487b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
PdfBrowserActivity.kt
...va/com/base/superpdfreader/activity/PdfBrowserActivity.kt
+4
-2
DialogViews.kt
...src/main/java/com/base/superpdfreader/view/DialogViews.kt
+12
-10
No files found.
app/src/main/java/com/base/superpdfreader/activity/PdfBrowserActivity.kt
View file @
9964ecd4
...
...
@@ -52,8 +52,10 @@ class PdfBrowserActivity : BaseActivity<ActivityPdfBrowserBinding>() {
finishToMain
()
},
ok
=
{
password
->
var
pdDocument
:
PDDocument
?
=
null
runCatching
{
pdDocument
=
PDDocument
.
load
(
file
,
password
)
pdDocument
=
try
{
PDDocument
.
load
(
file
,
password
)
}
catch
(
e
:
Exception
)
{
null
}
if
(
pdDocument
!=
null
)
{
dialog
?.
dismiss
()
...
...
app/src/main/java/com/base/superpdfreader/view/DialogViews.kt
View file @
9964ecd4
...
...
@@ -120,26 +120,28 @@ object DialogViews {
val
dialog
=
AlertDialog
.
Builder
(
this
)
.
setView
(
view
)
.
setPositiveButton
(
"OK"
)
{
dialog
,
which
->
val
pwd
=
binding
.
editPassword
.
text
.
toString
()
if
(
pwd
.
isEmpty
())
{
Toast
.
makeText
(
this
,
"Password cannot be empty"
,
Toast
.
LENGTH_SHORT
).
show
()
return
@setPositiveButton
}
ok
.
invoke
(
pwd
)
}.
setNegativeButton
(
"CANCEL"
)
.
setPositiveButton
(
"OK"
,
null
)
.
setNegativeButton
(
"CANCEL"
)
{
dialog
,
which
->
dialog
.
dismiss
()
cancel
.
invoke
()
}.
create
()
dialog
.
setCancelable
(
false
)
dialog
.
setCanceledOnTouchOutside
(
false
)
dialog
.
show
()
val
pButton
=
dialog
.
getButton
(
AlertDialog
.
BUTTON_POSITIVE
)
val
nButton
=
dialog
.
getButton
(
AlertDialog
.
BUTTON_NEGATIVE
)
pButton
.
setOnClickListener
{
val
pwd
=
binding
.
editPassword
.
text
.
toString
()
if
(
pwd
.
isEmpty
())
{
Toast
.
makeText
(
this
,
"Password cannot be empty"
,
Toast
.
LENGTH_SHORT
).
show
()
return
@setOnClickListener
}
ok
.
invoke
(
pwd
)
}
pButton
.
textSize
=
16f
pButton
.
setTextColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_pdf
))
nButton
.
textSize
=
16f
...
...
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