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
473e0762
Commit
473e0762
authored
Jun 12, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...提交部分ui...
parent
68f0c62e
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
44 additions
and
11 deletions
+44
-11
build.gradle
app/build.gradle
+2
-0
proguard-rules.pro
app/proguard-rules.pro
+3
-1
PdfBrowserActivity.kt
...va/com/base/superpdfreader/activity/PdfBrowserActivity.kt
+17
-6
DocumentAdapter.kt
...n/java/com/base/superpdfreader/adapter/DocumentAdapter.kt
+7
-1
DocumentBean.kt
...rc/main/java/com/base/superpdfreader/bean/DocumentBean.kt
+1
-0
DocumentDetailDialog.kt
...java/com/base/superpdfreader/view/DocumentDetailDialog.kt
+3
-1
activity_pdf_browser.xml
app/src/main/res/layout/activity_pdf_browser.xml
+7
-0
gradle.properties
gradle.properties
+2
-1
settings.gradle
settings.gradle
+2
-1
No files found.
app/build.gradle
View file @
473e0762
...
@@ -57,5 +57,7 @@ dependencies {
...
@@ -57,5 +57,7 @@ dependencies {
implementation
'com.github.bumptech.glide:glide:4.16.0'
implementation
'com.github.bumptech.glide:glide:4.16.0'
//pdf浏览
//pdf浏览
//https://github.com/DImuthuUpe/AndroidPdfViewer
implementation
'com.github.barteksc:android-pdf-viewer:2.8.2'
implementation
'com.github.barteksc:pdfium-android:1.7.1'
implementation
'com.github.barteksc:pdfium-android:1.7.1'
}
}
\ No newline at end of file
app/proguard-rules.pro
View file @
473e0762
...
@@ -19,3 +19,5 @@
...
@@ -19,3 +19,5 @@
# If you keep the line number information, uncomment this to
# If you keep the line number information, uncomment this to
# hide the original source file name.
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
-
keep
class
com
.
shockwave
.
**
\ No newline at end of file
app/src/main/java/com/base/superpdfreader/activity/PdfBrowserActivity.kt
View file @
473e0762
package
com.base.superpdfreader.activity
package
com.base.superpdfreader.activity
import
android.os.Bundle
import
androidx.activity.enableEdgeToEdge
import
androidx.appcompat.app.AppCompatActivity
import
androidx.core.view.ViewCompat
import
androidx.core.view.WindowInsetsCompat
import
com.base.superpdfreader.R
import
com.base.superpdfreader.databinding.ActivityPdfBrowserBinding
import
com.base.superpdfreader.databinding.ActivityPdfBrowserBinding
import
com.base.superpdfreader.helps.BaseActivity
import
com.base.superpdfreader.helps.BaseActivity
import
com.github.barteksc.pdfviewer.scroll.DefaultScrollHandle
import
java.io.File
class
PdfBrowserActivity
:
BaseActivity
<
ActivityPdfBrowserBinding
>()
{
class
PdfBrowserActivity
:
BaseActivity
<
ActivityPdfBrowserBinding
>()
{
var
pageNumber
=
0
override
val
binding
:
ActivityPdfBrowserBinding
by
lazy
{
override
val
binding
:
ActivityPdfBrowserBinding
by
lazy
{
ActivityPdfBrowserBinding
.
inflate
(
layoutInflater
)
ActivityPdfBrowserBinding
.
inflate
(
layoutInflater
)
}
}
override
fun
initView
()
{
override
fun
initView
()
{
val
path
=
intent
.
extras
?.
getString
(
"Path"
)
?:
""
val
file
=
File
(
path
)
if
(
file
.
exists
())
{
binding
.
pdfview
.
fromFile
(
file
)
.
defaultPage
(
pageNumber
)
.
enableAnnotationRendering
(
true
)
.
scrollHandle
(
object
:
DefaultScrollHandle
(
this
)
{})
.
spacing
(
10
)
.
onPageError
{
page
,
t
->
}
.
load
()
}
}
}
}
}
\ No newline at end of file
app/src/main/java/com/base/superpdfreader/adapter/DocumentAdapter.kt
View file @
473e0762
...
@@ -46,7 +46,13 @@ class DocumentAdapter(val itemClick: (bean: DocumentBean) -> Unit) : RecyclerVie
...
@@ -46,7 +46,13 @@ class DocumentAdapter(val itemClick: (bean: DocumentBean) -> Unit) : RecyclerVie
list
.
forEach
{
file
->
list
.
forEach
{
file
->
val
flag
=
hasData
.
add
(
file
)
val
flag
=
hasData
.
add
(
file
)
if
(
flag
)
{
if
(
flag
)
{
val
bean
=
DocumentBean
(
drawable
,
file
.
name
,
file
.
lastModified
(),
file
.
length
(),
type
)
val
bean
=
DocumentBean
(
drawable
,
file
.
name
,
file
.
lastModified
(),
file
.
length
(),
file
.
absolutePath
,
type
)
docList
.
add
(
bean
)
docList
.
add
(
bean
)
}
}
}
}
...
...
app/src/main/java/com/base/superpdfreader/bean/DocumentBean.kt
View file @
473e0762
...
@@ -10,6 +10,7 @@ data class DocumentBean(
...
@@ -10,6 +10,7 @@ data class DocumentBean(
val
name
:
String
=
""
,
val
name
:
String
=
""
,
val
time
:
Long
=
0
,
val
time
:
Long
=
0
,
val
size
:
Long
=
0
,
val
size
:
Long
=
0
,
val
path
:
String
=
""
,
val
type
:
String
=
""
,
val
type
:
String
=
""
,
)
{
)
{
@SuppressLint
(
"SimpleDateFormat"
)
@SuppressLint
(
"SimpleDateFormat"
)
...
...
app/src/main/java/com/base/superpdfreader/view/DocumentDetailDialog.kt
View file @
473e0762
...
@@ -68,7 +68,9 @@ object DocumentDetailDialog {
...
@@ -68,7 +68,9 @@ object DocumentDetailDialog {
}
}
}
}
binding
.
llOpen
.
setOnClickListener
{
binding
.
llOpen
.
setOnClickListener
{
startActivity
(
Intent
(
this
,
PdfBrowserActivity
::
class
.
java
))
startActivity
(
Intent
(
this
,
PdfBrowserActivity
::
class
.
java
).
apply
{
putExtra
(
"Path"
,
bean
.
path
)
})
}
}
}
}
}
}
\ No newline at end of file
app/src/main/res/layout/activity_pdf_browser.xml
View file @
473e0762
...
@@ -7,10 +7,17 @@
...
@@ -7,10 +7,17 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".activity.PdfBrowserActivity"
>
tools:context=
".activity.PdfBrowserActivity"
>
<com.github.barteksc.pdfviewer.PDFView
android:id=
"@+id/pdfview"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/ll_tools"
android:id=
"@+id/ll_tools"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
app:layout_constraintTop_toTopOf=
"parent"
>
app:layout_constraintTop_toTopOf=
"parent"
>
<LinearLayout
<LinearLayout
...
...
gradle.properties
View file @
473e0762
...
@@ -21,3 +21,4 @@ kotlin.code.style=official
...
@@ -21,3 +21,4 @@ kotlin.code.style=official
# resources declared in the library itself and none from the library's dependencies,
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass
=
true
android.nonTransitiveRClass
=
true
android.enableJetifier
=
true
\ No newline at end of file
settings.gradle
View file @
473e0762
...
@@ -14,8 +14,9 @@ pluginManagement {
...
@@ -14,8 +14,9 @@ pluginManagement {
dependencyResolutionManagement
{
dependencyResolutionManagement
{
repositoriesMode
.
set
(
RepositoriesMode
.
FAIL_ON_PROJECT_REPOS
)
repositoriesMode
.
set
(
RepositoriesMode
.
FAIL_ON_PROJECT_REPOS
)
repositories
{
repositories
{
google
()
mavenCentral
()
mavenCentral
()
google
()
jcenter
()
maven
{
url
'https://jitpack.io'
}
maven
{
url
'https://jitpack.io'
}
maven
{
url
"https://android-sdk.is.com"
}
maven
{
url
"https://android-sdk.is.com"
}
maven
{
url
"https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"
}
maven
{
url
"https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea"
}
...
...
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