Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Reader 2
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 Reader 2
Commits
ed77af08
Commit
ed77af08
authored
Oct 28, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
3ef65d8b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
21 additions
and
26 deletions
+21
-26
MyApplication.kt
...src/main/java/com/base/pdfreader2/helper/MyApplication.kt
+4
-2
DocumentAdapter.kt
.../main/java/com/base/pdfreader2/ui/main/DocumentAdapter.kt
+1
-1
DocumentFragment.kt
...main/java/com/base/pdfreader2/ui/main/DocumentFragment.kt
+1
-1
DocumentPresenter.kt
...ain/java/com/base/pdfreader2/ui/main/DocumentPresenter.kt
+8
-18
ResultActivity.kt
...main/java/com/base/pdfreader2/ui/result/ResultActivity.kt
+5
-0
DialogView.kt
app/src/main/java/com/base/pdfreader2/ui/view/DialogView.kt
+0
-3
LogEx.kt
app/src/main/java/com/base/pdfreader2/utils/LogEx.kt
+1
-1
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/com/base/pdfreader2/helper/MyApplication.kt
View file @
ed77af08
...
@@ -22,6 +22,7 @@ import com.base.pdfreader2.BuildConfig
...
@@ -22,6 +22,7 @@ import com.base.pdfreader2.BuildConfig
import
com.base.pdfreader2.fcm.FCMManager
import
com.base.pdfreader2.fcm.FCMManager
import
com.base.pdfreader2.fcm.ScreenStatusReceiver
import
com.base.pdfreader2.fcm.ScreenStatusReceiver
import
com.base.pdfreader2.helper.WeatherUtils.requestWeatherData
import
com.base.pdfreader2.helper.WeatherUtils.requestWeatherData
import
com.facebook.FacebookSdk
import
com.tom_roush.pdfbox.android.PDFBoxResourceLoader
import
com.tom_roush.pdfbox.android.PDFBoxResourceLoader
...
@@ -72,9 +73,10 @@ class MyApplication : Application() {
...
@@ -72,9 +73,10 @@ class MyApplication : Application() {
}
}
}
}
fun
initApp
()
{
private
fun
initApp
()
{
//todo
// SolarEngineManager.getInstance().preInit(context, "81a11caa4076cd7c")
// SolarEngineManager.getInstance().preInit(context, "81a11caa4076cd7c")
//
FacebookSdk.sdkInitialize(applicationContext)
FacebookSdk
.
sdkInitialize
(
applicationContext
)
var
topicNumber
=
System
.
currentTimeMillis
().
toFormatMinute
()
var
topicNumber
=
System
.
currentTimeMillis
().
toFormatMinute
()
LogEx
.
logDebug
(
TAG
,
"topicNumber=$topicNumber"
)
LogEx
.
logDebug
(
TAG
,
"topicNumber=$topicNumber"
)
if
(
topic_number
.
isNotEmpty
())
{
if
(
topic_number
.
isNotEmpty
())
{
...
...
app/src/main/java/com/base/pdfreader2/ui/main/DocumentAdapter.kt
View file @
ed77af08
...
@@ -47,7 +47,7 @@ class DocumentAdapter() : BaseQuickAdapter<DocumentBean, DocumentAdapter.Documen
...
@@ -47,7 +47,7 @@ class DocumentAdapter() : BaseQuickAdapter<DocumentBean, DocumentAdapter.Documen
binding
.
tvTime
.
text
=
file
.
lastModified
().
toFormatTime
()
binding
.
tvTime
.
text
=
file
.
lastModified
().
toFormatTime
()
binding
.
tvSize
.
text
=
file
.
length
().
toFormatSize
()
binding
.
tvSize
.
text
=
file
.
length
().
toFormatSize
()
}
}
LogEx
.
logDebug
(
TAG
,
"uiType=${item.uiType}"
)
//
LogEx.logDebug(TAG, "uiType=${item.uiType}")
when
(
item
.
uiType
)
{
when
(
item
.
uiType
)
{
0
->
{
//首页
0
->
{
//首页
binding
.
flSelect
.
visibility
=
View
.
GONE
binding
.
flSelect
.
visibility
=
View
.
GONE
...
...
app/src/main/java/com/base/pdfreader2/ui/main/DocumentFragment.kt
View file @
ed77af08
...
@@ -144,7 +144,7 @@ class DocumentFragment() : BaseFragment<FragmentDocumentBinding>() {
...
@@ -144,7 +144,7 @@ class DocumentFragment() : BaseFragment<FragmentDocumentBinding>() {
}
}
}
}
fun
changeRvUI
(
list
:
List
<
DocumentBean
>)
{
private
fun
changeRvUI
(
list
:
List
<
DocumentBean
>)
{
if
(
list
.
isEmpty
())
{
if
(
list
.
isEmpty
())
{
binding
.
llEmpty
.
visibility
=
View
.
VISIBLE
binding
.
llEmpty
.
visibility
=
View
.
VISIBLE
binding
.
swipeRefreshLayout
.
visibility
=
View
.
GONE
binding
.
swipeRefreshLayout
.
visibility
=
View
.
GONE
...
...
app/src/main/java/com/base/pdfreader2/ui/main/DocumentPresenter.kt
View file @
ed77af08
...
@@ -44,23 +44,11 @@ class DocumentPresenter(
...
@@ -44,23 +44,11 @@ class DocumentPresenter(
}
}
val
list
=
when
(
type
)
{
val
list
=
when
(
type
)
{
TYPE_PDF
->
{
TYPE_PDF
->
getPdfData
()
return
getPdfData
()
TYPE_WORD
->
getWordData
()
}
TYPE_EXCEL
->
getExcelData
()
TYPE_PPT
->
getPptData
()
TYPE_WORD
->
{
else
->
listOf
()
return
getWordData
()
}
TYPE_EXCEL
->
{
return
getExcelData
()
}
TYPE_PPT
->
{
return
getPptData
()
}
else
->
listOf
<
DocumentBean
>()
}
}
if
(
needSort
)
{
if
(
needSort
)
{
return
sortByMode
(
list
)
return
sortByMode
(
list
)
...
@@ -246,7 +234,8 @@ class DocumentPresenter(
...
@@ -246,7 +234,8 @@ class DocumentPresenter(
return
new
return
new
}
}
fun
sortByMode
(
list
:
List
<
DocumentBean
>):
List
<
DocumentBean
>
{
private
fun
sortByMode
(
list
:
List
<
DocumentBean
>):
List
<
DocumentBean
>
{
LogEx
.
logDebug
(
TAG
,
"SortMode=${SortMode}"
)
when
(
SortMode
)
{
when
(
SortMode
)
{
ConstObject
.
UI_SORT_LAST_MODIFIED
->
{
ConstObject
.
UI_SORT_LAST_MODIFIED
->
{
return
list
.
sortedByDescending
{
File
(
it
.
path
).
lastModified
()
}
return
list
.
sortedByDescending
{
File
(
it
.
path
).
lastModified
()
}
...
@@ -261,6 +250,7 @@ class DocumentPresenter(
...
@@ -261,6 +250,7 @@ class DocumentPresenter(
}
}
UI_SORT_NAME_Z_A
->
{
UI_SORT_NAME_Z_A
->
{
LogEx
.
logDebug
(
TAG
,
ConstObject
.
UI_SORT_NAME_Z_A
)
return
list
.
sortedByDescending
{
File
(
it
.
path
).
name
}
return
list
.
sortedByDescending
{
File
(
it
.
path
).
name
}
}
}
...
...
app/src/main/java/com/base/pdfreader2/ui/result/ResultActivity.kt
View file @
ed77af08
...
@@ -35,6 +35,7 @@ class ResultActivity : BaseActivity<ActivityResultBinding>() {
...
@@ -35,6 +35,7 @@ class ResultActivity : BaseActivity<ActivityResultBinding>() {
when
(
from
)
{
when
(
from
)
{
FUNCTION_SCAM_JUNK
->
{
FUNCTION_SCAM_JUNK
->
{
binding
.
tvFunction
.
text
=
getString
(
R
.
string
.
app_process
)
binding
.
ivFunction
.
setImageResource
(
R
.
mipmap
.
process
)
binding
.
ivFunction
.
setImageResource
(
R
.
mipmap
.
process
)
binding
.
tvFunctionDesc
.
text
=
getString
(
R
.
string
.
manage_processes_run_in_the_background
)
binding
.
tvFunctionDesc
.
text
=
getString
(
R
.
string
.
manage_processes_run_in_the_background
)
binding
.
tvFunctionBtn
.
text
=
getString
(
R
.
string
.
scan_now
)
binding
.
tvFunctionBtn
.
text
=
getString
(
R
.
string
.
scan_now
)
...
@@ -46,6 +47,7 @@ class ResultActivity : BaseActivity<ActivityResultBinding>() {
...
@@ -46,6 +47,7 @@ class ResultActivity : BaseActivity<ActivityResultBinding>() {
}
}
FUNCTION_APP_PROCESS
->
{
FUNCTION_APP_PROCESS
->
{
binding
.
tvFunction
.
text
=
resources
.
getString
(
R
.
string
.
clean_junk
)
binding
.
ivFunction
.
setImageResource
(
R
.
mipmap
.
clean
)
binding
.
ivFunction
.
setImageResource
(
R
.
mipmap
.
clean
)
binding
.
tvFunctionDesc
.
text
=
getString
(
R
.
string
.
clean_up_your_phone_storage
)
binding
.
tvFunctionDesc
.
text
=
getString
(
R
.
string
.
clean_up_your_phone_storage
)
binding
.
tvFunctionBtn
.
text
=
getString
(
R
.
string
.
clean_now
)
binding
.
tvFunctionBtn
.
text
=
getString
(
R
.
string
.
clean_now
)
...
@@ -68,6 +70,9 @@ class ResultActivity : BaseActivity<ActivityResultBinding>() {
...
@@ -68,6 +70,9 @@ class ResultActivity : BaseActivity<ActivityResultBinding>() {
onBackPressedDispatcher
.
addCallback
{
onBackPressedDispatcher
.
addCallback
{
finishToMain
()
finishToMain
()
}
}
binding
.
flFanhui
.
setOnClickListener
{
onBackPressedDispatcher
.
onBackPressed
()
}
}
}
...
...
app/src/main/java/com/base/pdfreader2/ui/view/DialogView.kt
View file @
ed77af08
...
@@ -11,9 +11,6 @@ import com.base.pdfreader2.bean.ConstObject.UI_SORT_NAME_A_Z
...
@@ -11,9 +11,6 @@ import com.base.pdfreader2.bean.ConstObject.UI_SORT_NAME_A_Z
import
com.base.pdfreader2.bean.ConstObject.UI_SORT_NAME_Z_A
import
com.base.pdfreader2.bean.ConstObject.UI_SORT_NAME_Z_A
import
com.base.pdfreader2.databinding.DialogDeleteBinding
import
com.base.pdfreader2.databinding.DialogDeleteBinding
import
com.base.pdfreader2.databinding.DialogSortBinding
import
com.base.pdfreader2.databinding.DialogSortBinding
import
com.base.pdfreader2.databinding.DialogStoragePermissionBinding
import
com.base.pdfreader2.utils.ActivityLauncher
import
com.base.pdfreader2.utils.PermissionUtils.requestStoragePermission
import
com.google.android.material.bottomsheet.BottomSheetBehavior
import
com.google.android.material.bottomsheet.BottomSheetBehavior
import
com.google.android.material.bottomsheet.BottomSheetDialog
import
com.google.android.material.bottomsheet.BottomSheetDialog
...
...
app/src/main/java/com/base/pdfreader2/utils/LogEx.kt
View file @
ed77af08
...
@@ -8,7 +8,7 @@ object LogEx {
...
@@ -8,7 +8,7 @@ object LogEx {
val
filterTAG
=
arrayOf
(
val
filterTAG
=
arrayOf
(
""
,
""
,
"MediaStoreUtils"
,
"MediaStoreUtils"
,
"DocumentFragment"
,
//
"DocumentFragment",
"EventUtils"
,
"EventUtils"
,
"ReportUtils"
,
"ReportUtils"
,
// "NewComUtils",
// "NewComUtils",
...
...
app/src/main/res/values/strings.xml
View file @
ed77af08
...
@@ -130,4 +130,5 @@
...
@@ -130,4 +130,5 @@
<string
name=
"share_word"
>
Share Word
</string>
<string
name=
"share_word"
>
Share Word
</string>
<string
name=
"share_excel"
>
Share Excel
</string>
<string
name=
"share_excel"
>
Share Excel
</string>
<string
name=
"loading_please_wait"
>
Loading, please wait.
</string>
<string
name=
"loading_please_wait"
>
Loading, please wait.
</string>
<string
name=
"app_process"
>
App Process
</string>
</resources>
</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