Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
pdf all 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
pdf all reader
Commits
3fc5c003
Commit
3fc5c003
authored
Nov 15, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
bf517a8e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
12 deletions
+26
-12
DocumentActivity.kt
...ase/pdfreaderallpdfreader/ui/document/DocumentActivity.kt
+9
-4
MainActivity.kt
...va/com/base/pdfreaderallpdfreader/ui/main/MainActivity.kt
+6
-2
HomeFragment.kt
...m/base/pdfreaderallpdfreader/ui/main/home/HomeFragment.kt
+2
-1
PdfSelectActivity.kt
...om/base/pdfreaderallpdfreader/ui/pdf/PdfSelectActivity.kt
+4
-5
strings.xml
app/src/main/res/values/strings.xml
+5
-0
No files found.
app/src/main/java/com/base/pdfreaderallpdfreader/ui/document/DocumentActivity.kt
View file @
3fc5c003
...
...
@@ -22,6 +22,7 @@ import com.base.pdfreaderallpdfreader.utils.BarUtils
class
DocumentActivity
:
BaseActivity
<
ActivityDocumentBinding
>()
{
private
lateinit
var
documentViewModel
:
DocumentViewModel
private
var
tittle
:
String
?
=
null
override
val
binding
:
ActivityDocumentBinding
by
lazy
{
ActivityDocumentBinding
.
inflate
(
layoutInflater
)
...
...
@@ -55,13 +56,17 @@ class DocumentActivity : BaseActivity<ActivityDocumentBinding>() {
binding
.
root
.
updatePadding
(
top
=
BarUtils
.
getStatusBarHeight
())
initTab
=
intent
.
extras
?.
getInt
(
"initTab"
)
tittle
=
intent
.
extras
?.
getString
(
"tittle"
)
documentViewModel
=
ViewModelProvider
(
this
)[
DocumentViewModel
::
class
.
java
]
val
spannableString
=
SpannableString
(
this
.
getString
(
R
.
string
.
pdf_reader
))
spannableString
.
setSpan
(
ForegroundColorSpan
(
Color
.
parseColor
(
"#E20001"
)),
0
,
3
,
Spannable
.
SPAN_INCLUSIVE_INCLUSIVE
)
binding
.
tvTittle
.
text
=
spannableString
if
(
tittle
!=
null
)
{
binding
.
tvTittle
.
text
=
tittle
}
else
{
val
spannableString
=
SpannableString
(
this
.
getString
(
R
.
string
.
pdf_reader
))
spannableString
.
setSpan
(
ForegroundColorSpan
(
Color
.
parseColor
(
"#E20001"
)),
0
,
3
,
Spannable
.
SPAN_INCLUSIVE_INCLUSIVE
)
binding
.
tvTittle
.
text
=
spannableString
}
initViewPager2
()
initTabLayout
()
...
...
app/src/main/java/com/base/pdfreaderallpdfreader/ui/main/MainActivity.kt
View file @
3fc5c003
...
...
@@ -4,6 +4,7 @@ import android.Manifest
import
android.content.Intent
import
android.graphics.Color
import
android.net.Uri
import
android.os.Build
import
android.text.Spannable
import
android.text.SpannableString
import
android.text.style.ForegroundColorSpan
...
...
@@ -38,6 +39,7 @@ import com.base.pdfreaderallpdfreader.utils.PdfBoxUtils.checkPdfEncryption
import
com.base.pdfreaderallpdfreader.utils.PermissionUtils.checkNotificationPermission
import
com.base.pdfreaderallpdfreader.utils.PermissionUtils.checkStorePermission
import
com.base.pdfreaderallpdfreader.utils.ShortcutUtils.addDeskShortCut
import
com.base.pdfreaderallpdfreader.utils.ToastUtils.toast
import
com.base.pdfreaderallpdfreader.utils.updateMediaStore
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
...
...
@@ -78,7 +80,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
})
}
else
{
toast
(
"can't get file"
)
}
}
...
...
@@ -100,7 +102,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
if
(!
flag
)
{
showNotificationDialog
(
launcher
)
}
else
{
launcher
.
launch
(
arrayOf
(
Manifest
.
permission
.
POST_NOTIFICATIONS
))
{}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
TIRAMISU
)
{
launcher
.
launch
(
arrayOf
(
Manifest
.
permission
.
POST_NOTIFICATIONS
))
{}
}
}
}
...
...
app/src/main/java/com/base/pdfreaderallpdfreader/ui/main/home/HomeFragment.kt
View file @
3fc5c003
...
...
@@ -9,6 +9,7 @@ import android.view.ViewGroup
import
androidx.fragment.app.Fragment
import
androidx.lifecycle.ViewModelProvider
import
androidx.lifecycle.lifecycleScope
import
com.base.pdfreaderallpdfreader.R
import
com.base.pdfreaderallpdfreader.bean.ConstObject.DO_LOCK_PDF
import
com.base.pdfreaderallpdfreader.bean.ConstObject.DO_SPLIT_PDF
import
com.base.pdfreaderallpdfreader.databinding.FragmentHomeBinding
...
...
@@ -17,7 +18,6 @@ import com.base.pdfreaderallpdfreader.ui.main.MainActivity
import
com.base.pdfreaderallpdfreader.ui.main.getPdfFastSize
import
com.base.pdfreaderallpdfreader.ui.pdf.PdfActivity
import
com.base.pdfreaderallpdfreader.ui.pdf.PdfSelectActivity
import
com.base.pdfreaderallpdfreader.ui.view.MainDialog.showStoragePermission
import
com.base.pdfreaderallpdfreader.utils.PermissionUtils.checkStorePermission
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
...
...
@@ -56,6 +56,7 @@ class HomeFragment : Fragment() {
binding
.
llEditPdf
.
setOnClickListener
{
startActivity
(
Intent
(
requireContext
(),
DocumentActivity
::
class
.
java
).
apply
{
putExtra
(
"initTab"
,
1
)
putExtra
(
"tittle"
,
getString
(
R
.
string
.
select_for_edit_pdf
))
})
}
binding
.
llMergePdf
.
setOnClickListener
{
...
...
app/src/main/java/com/base/pdfreaderallpdfreader/ui/pdf/PdfSelectActivity.kt
View file @
3fc5c003
...
...
@@ -67,25 +67,24 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>() {
when
(
doWhat
)
{
DO_SPLIT_PDF
->
{
binding
.
tvBtnNext
.
visibility
=
View
.
GONE
binding
.
tvSelectTip
.
text
=
getString
(
R
.
string
.
select_a_project
)
binding
.
tvSelectTip
.
text
=
getString
(
R
.
string
.
select_a_project
_split
)
getPdfData
(
2
)
}
DO_MERGE_PDF
->
{
binding
.
tvSelectTip
.
text
=
getString
(
R
.
string
.
select_a_project
)
binding
.
tvSelectTip
.
text
=
getString
(
R
.
string
.
select_a_project
_merge
)
getPdfData
(
1
)
}
DO_LOCK_PDF
->
{
binding
.
tvBtnNext
.
visibility
=
View
.
GONE
binding
.
tvSelectTip
.
text
=
getString
(
R
.
string
.
select_a_project
)
binding
.
tvSelectTip
.
text
=
getString
(
R
.
string
.
select_a_project
_lock
)
getPdfData
(
3
)
}
DO_UNLOCK_PDF
->
{
binding
.
tvBtnNext
.
visibility
=
View
.
GONE
binding
.
tvSelectTip
.
text
=
getString
(
R
.
string
.
select_a_project
)
binding
.
tvSelectTip
.
text
=
getString
(
R
.
string
.
select_a_project
_unlock
)
getPdfData
(
3
)
}
...
...
app/src/main/res/values/strings.xml
View file @
3fc5c003
...
...
@@ -108,6 +108,11 @@
<string
name=
"notification_enable_tips"
>
Enabling notification permissions will allow you to receive future notification promptly and display unique message banners
</string>
<string
name=
"enable_notifications"
>
Enable notifications
</string>
<string
name=
"not_open"
>
Not open
</string>
<string
name=
"select_for_edit_pdf"
>
Select PDF for edite
</string>
<string
name=
"select_a_project_split"
>
Select a project for split
</string>
<string
name=
"select_a_project_merge"
>
Select projects for merge
</string>
<string
name=
"select_a_project_lock"
>
Select a project to lock
</string>
<string
name=
"select_a_project_unlock"
>
Select a project to unlock
</string>
</resources>
\ No newline at end of file
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