Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
Pdf one 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 one Reader
Commits
2fa2ebf2
Commit
2fa2ebf2
authored
Nov 15, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
684634b7
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
84 additions
and
29 deletions
+84
-29
HomeUIBean.kt
app/src/main/java/com/base/pdfoneread/bean/HomeUIBean.kt
+1
-0
DocumentActivity.kt
.../java/com/base/pdfoneread/ui/document/DocumentActivity.kt
+15
-3
DocumentEx.kt
...c/main/java/com/base/pdfoneread/ui/document/DocumentEx.kt
+52
-25
HomeFragment.kt
...src/main/java/com/base/pdfoneread/ui/main/HomeFragment.kt
+9
-1
MainActivity.kt
...src/main/java/com/base/pdfoneread/ui/main/MainActivity.kt
+4
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+2
-0
h_pdf_directories.png
app/src/main/res/mipmap-xxhdpi/h_pdf_directories.png
+0
-0
h_pdf_favorites.png
app/src/main/res/mipmap-xxhdpi/h_pdf_favorites.png
+0
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/com/base/pdfoneread/bean/HomeUIBean.kt
View file @
2fa2ebf2
...
@@ -25,6 +25,7 @@ data class HomeUIBean(
...
@@ -25,6 +25,7 @@ data class HomeUIBean(
const
val
KEY_WORD
=
"key_word"
const
val
KEY_WORD
=
"key_word"
const
val
KEY_EXCEL
=
"key_excel"
const
val
KEY_EXCEL
=
"key_excel"
const
val
KEY_PPT
=
"key_ppt"
const
val
KEY_PPT
=
"key_ppt"
const
val
KEY_FAVORITES
=
"key_favorites"
const
val
KEY_IMAGE_TO_PDF
=
"key_image_to_pdf"
const
val
KEY_IMAGE_TO_PDF
=
"key_image_to_pdf"
const
val
KEY_MERGE_PDF
=
"key_merge_pdf"
const
val
KEY_MERGE_PDF
=
"key_merge_pdf"
...
...
app/src/main/java/com/base/pdfoneread/ui/document/DocumentActivity.kt
View file @
2fa2ebf2
...
@@ -14,6 +14,7 @@ import com.base.pdfoneread.R
...
@@ -14,6 +14,7 @@ import com.base.pdfoneread.R
import
com.base.pdfoneread.bean.DocumentBean
import
com.base.pdfoneread.bean.DocumentBean
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_ALL
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_ALL
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_EXCEL
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_EXCEL
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_FAVORITE
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_PDF
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_PDF
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_PPT
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_PPT
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_WORD
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_WORD
...
@@ -128,7 +129,12 @@ class DocumentActivity : BaseActivity<ActivityDocumentBinding>(), DialogCallBack
...
@@ -128,7 +129,12 @@ class DocumentActivity : BaseActivity<ActivityDocumentBinding>(), DialogCallBack
TYPE_PPT
->
{
TYPE_PPT
->
{
binding
.
tvTittle
.
text
=
getString
(
R
.
string
.
ppt_files
)
binding
.
tvTittle
.
text
=
getString
(
R
.
string
.
ppt_files
)
}
}
TYPE_FAVORITE
->
{
binding
.
tvTittle
.
text
=
getString
(
R
.
string
.
favorite
)
}
}
}
}
}
override
fun
initListener
()
{
override
fun
initListener
()
{
...
@@ -250,11 +256,15 @@ class DocumentActivity : BaseActivity<ActivityDocumentBinding>(), DialogCallBack
...
@@ -250,11 +256,15 @@ class DocumentActivity : BaseActivity<ActivityDocumentBinding>(), DialogCallBack
GlobalPptList
GlobalPptList
}
}
TYPE_FAVORITE
->
{
getGlobalAllList
().
filter
{
it
.
isBookmarked
}
}
else
->
getGlobalAllList
()
else
->
getGlobalAllList
()
}
}
runOnUI
(
list
,
true
)
runOnUI
(
list
)
}
}
private
fun
initData
()
=
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
private
fun
initData
()
=
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
...
@@ -265,15 +275,17 @@ class DocumentActivity : BaseActivity<ActivityDocumentBinding>(), DialogCallBack
...
@@ -265,15 +275,17 @@ class DocumentActivity : BaseActivity<ActivityDocumentBinding>(), DialogCallBack
TYPE_WORD
->
getWordDocument
(
context
)
TYPE_WORD
->
getWordDocument
(
context
)
TYPE_EXCEL
->
getExcelDocument
(
context
)
TYPE_EXCEL
->
getExcelDocument
(
context
)
TYPE_PPT
->
getPptDocument
(
context
)
TYPE_PPT
->
getPptDocument
(
context
)
TYPE_FAVORITE
->
getAllDocument
(
context
).
filter
{
it
.
isBookmarked
}
else
->
getAllDocument
(
context
)
else
->
getAllDocument
(
context
)
}
}
runOnUI
(
list
)
runOnUI
(
list
)
}
}
private
fun
runOnUI
(
list
:
List
<
DocumentBean
>,
isPreload
:
Boolean
=
false
)
{
private
fun
runOnUI
(
list
:
List
<
DocumentBean
>)
{
LogEx
.
logDebug
(
TAG
,
"runOnUI list size=${list.size}"
)
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
if
(
list
.
isEmpty
())
{
if
(
list
.
isEmpty
())
{
if
(
is
Preload
)
{
if
(
is
DocumentRefreshing
.
get
()
)
{
binding
.
swipeRefreshLayout
.
isRefreshing
=
true
binding
.
swipeRefreshLayout
.
isRefreshing
=
true
}
else
{
}
else
{
binding
.
llEmpty
.
visibility
=
View
.
VISIBLE
binding
.
llEmpty
.
visibility
=
View
.
VISIBLE
...
...
app/src/main/java/com/base/pdfoneread/ui/document/DocumentEx.kt
View file @
2fa2ebf2
...
@@ -38,8 +38,12 @@ import java.io.IOException
...
@@ -38,8 +38,12 @@ import java.io.IOException
import
java.util.concurrent.CopyOnWriteArrayList
import
java.util.concurrent.CopyOnWriteArrayList
import
java.util.concurrent.atomic.AtomicBoolean
import
java.util.concurrent.atomic.AtomicBoolean
//发送刷新结束
var
isRefreshOver
:
MutableSharedFlow
<
Boolean
>
=
MutableSharedFlow
()
var
isRefreshOver
:
MutableSharedFlow
<
Boolean
>
=
MutableSharedFlow
()
//标识刷新中
var
isDocumentRefreshing
=
AtomicBoolean
(
false
)
/**
/**
* 全局数据数据
* 全局数据数据
*/
*/
...
@@ -137,9 +141,11 @@ fun getPPtDemo(context: Context): DocumentBean {
...
@@ -137,9 +141,11 @@ fun getPPtDemo(context: Context): DocumentBean {
return
demoDocumentBean
return
demoDocumentBean
}
}
@Synchronized
@Synchronized
fun
getAllDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
fun
getAllDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
isDocumentRefreshing
.
set
(
true
)
context
.
upDateDemoStore
()
context
.
upDateDemoStore
()
if
(!
ConstObject
.
haveSaveDemo
)
{
if
(!
ConstObject
.
haveSaveDemo
)
{
context
.
saveAssetsFile
()
context
.
saveAssetsFile
()
...
@@ -159,12 +165,12 @@ fun getAllDocument(context: Context): MutableList<DocumentBean> {
...
@@ -159,12 +165,12 @@ fun getAllDocument(context: Context): MutableList<DocumentBean> {
)
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
bookList
=
SpStringUtils
.
getSpStringList
(
BOOKMARK_KEY
)
val
documentList
=
list
.
map
{
val
documentList
=
list
.
map
{
val
documentBean
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
getDocumentType
(
it
))
val
documentBean
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
getDocumentType
(
it
))
when
(
documentBean
.
type
)
{
when
(
documentBean
.
type
)
{
TYPE_PDF
->
{
TYPE_PDF
->
{
context
.
pdfCheck
(
documentBean
)
context
.
pdfCheck
(
documentBean
)
GlobalPdfList
.
add
(
deepCopy
(
documentBean
))
GlobalPdfList
.
add
(
deepCopy
(
documentBean
))
}
}
...
@@ -182,6 +188,7 @@ fun getAllDocument(context: Context): MutableList<DocumentBean> {
...
@@ -182,6 +188,7 @@ fun getAllDocument(context: Context): MutableList<DocumentBean> {
}
}
}
}
documentBean
.
isBookmarked
=
bookList
.
contains
(
it
.
path
)
documentBean
documentBean
}
}
...
@@ -208,23 +215,13 @@ fun getAllDocument(context: Context): MutableList<DocumentBean> {
...
@@ -208,23 +215,13 @@ fun getAllDocument(context: Context): MutableList<DocumentBean> {
GlobalPdfList
.
add
(
0
,
pdfDemo
)
GlobalPdfList
.
add
(
0
,
pdfDemo
)
}
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
isDocumentRefreshing
.
set
(
false
)
return
new
return
new
}
}
fun
getPdfFastSize
(
context
:
Context
):
Int
{
@Synchronized
val
selectionArgs
=
arrayOf
(
MIME_TYPE_PDF
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
var
size
=
list
.
size
val
pdfDemo
=
getPdfDemo
(
context
)
if
(
File
(
pdfDemo
.
path
).
exists
())
{
size
+=
1
}
return
size
}
fun
getPdfDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
fun
getPdfDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
isDocumentRefreshing
.
set
(
true
)
if
(!
ConstObject
.
haveSaveDemo
)
{
if
(!
ConstObject
.
haveSaveDemo
)
{
context
.
saveAssetsFile
()
context
.
saveAssetsFile
()
ConstObject
.
haveSaveDemo
=
true
ConstObject
.
haveSaveDemo
=
true
...
@@ -235,10 +232,12 @@ fun getPdfDocument(context: Context): MutableList<DocumentBean> {
...
@@ -235,10 +232,12 @@ fun getPdfDocument(context: Context): MutableList<DocumentBean> {
MIME_TYPE_PDF
MIME_TYPE_PDF
)
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
bookList
=
SpStringUtils
.
getSpStringList
(
BOOKMARK_KEY
)
val
documentList
=
list
.
map
{
val
documentList
=
list
.
map
{
val
documentBean
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
TYPE_PDF
)
val
documentBean
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
TYPE_PDF
)
context
.
pdfCheck
(
documentBean
)
context
.
pdfCheck
(
documentBean
)
GlobalPdfList
.
add
(
deepCopy
(
documentBean
))
GlobalPdfList
.
add
(
deepCopy
(
documentBean
))
documentBean
.
isBookmarked
=
bookList
.
contains
(
it
.
path
)
documentBean
documentBean
}
}
val
new
=
documentList
.
toMutableList
()
val
new
=
documentList
.
toMutableList
()
...
@@ -248,10 +247,13 @@ fun getPdfDocument(context: Context): MutableList<DocumentBean> {
...
@@ -248,10 +247,13 @@ fun getPdfDocument(context: Context): MutableList<DocumentBean> {
GlobalPdfList
.
add
(
0
,
deepCopy
(
pdfDemo
))
GlobalPdfList
.
add
(
0
,
deepCopy
(
pdfDemo
))
}
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
isDocumentRefreshing
.
set
(
false
)
return
new
return
new
}
}
@Synchronized
fun
getWordDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
fun
getWordDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
isDocumentRefreshing
.
set
(
true
)
if
(!
ConstObject
.
haveSaveDemo
)
{
if
(!
ConstObject
.
haveSaveDemo
)
{
context
.
saveAssetsFile
()
context
.
saveAssetsFile
()
ConstObject
.
haveSaveDemo
=
true
ConstObject
.
haveSaveDemo
=
true
...
@@ -262,10 +264,12 @@ fun getWordDocument(context: Context): MutableList<DocumentBean> {
...
@@ -262,10 +264,12 @@ fun getWordDocument(context: Context): MutableList<DocumentBean> {
MIME_TYPE_DOCX
,
MIME_TYPE_DOCX
,
)
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
bookList
=
SpStringUtils
.
getSpStringList
(
BOOKMARK_KEY
)
val
documentList
=
list
.
map
{
val
documentList
=
list
.
map
{
val
document
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
TYPE_WORD
)
val
documentBean
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
TYPE_WORD
)
GlobalWordList
.
add
(
deepCopy
(
document
))
GlobalWordList
.
add
(
deepCopy
(
documentBean
))
document
documentBean
.
isBookmarked
=
bookList
.
contains
(
it
.
path
)
documentBean
}
}
val
new
=
documentList
.
toMutableList
()
val
new
=
documentList
.
toMutableList
()
val
wordDemo
=
getWordDemo
(
context
)
val
wordDemo
=
getWordDemo
(
context
)
...
@@ -274,10 +278,13 @@ fun getWordDocument(context: Context): MutableList<DocumentBean> {
...
@@ -274,10 +278,13 @@ fun getWordDocument(context: Context): MutableList<DocumentBean> {
GlobalWordList
.
add
(
0
,
deepCopy
(
wordDemo
))
GlobalWordList
.
add
(
0
,
deepCopy
(
wordDemo
))
}
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
isDocumentRefreshing
.
set
(
false
)
return
new
return
new
}
}
@Synchronized
fun
getExcelDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
fun
getExcelDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
isDocumentRefreshing
.
set
(
true
)
if
(!
ConstObject
.
haveSaveDemo
)
{
if
(!
ConstObject
.
haveSaveDemo
)
{
context
.
saveAssetsFile
()
context
.
saveAssetsFile
()
ConstObject
.
haveSaveDemo
=
true
ConstObject
.
haveSaveDemo
=
true
...
@@ -289,10 +296,12 @@ fun getExcelDocument(context: Context): MutableList<DocumentBean> {
...
@@ -289,10 +296,12 @@ fun getExcelDocument(context: Context): MutableList<DocumentBean> {
MIME_TYPE_XLSX
,
MIME_TYPE_XLSX
,
)
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
bookList
=
SpStringUtils
.
getSpStringList
(
BOOKMARK_KEY
)
val
documentList
=
list
.
map
{
val
documentList
=
list
.
map
{
val
document
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
TYPE_EXCEL
)
val
documentBean
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
TYPE_EXCEL
)
GlobalExcelList
.
add
(
deepCopy
(
document
))
GlobalExcelList
.
add
(
deepCopy
(
documentBean
))
document
documentBean
.
isBookmarked
=
bookList
.
contains
(
it
.
path
)
documentBean
}
}
val
new
=
documentList
.
toMutableList
()
val
new
=
documentList
.
toMutableList
()
val
excelDemo
=
getExcelDemo
(
context
)
val
excelDemo
=
getExcelDemo
(
context
)
...
@@ -301,10 +310,13 @@ fun getExcelDocument(context: Context): MutableList<DocumentBean> {
...
@@ -301,10 +310,13 @@ fun getExcelDocument(context: Context): MutableList<DocumentBean> {
GlobalExcelList
.
add
(
0
,
deepCopy
(
excelDemo
))
GlobalExcelList
.
add
(
0
,
deepCopy
(
excelDemo
))
}
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
isDocumentRefreshing
.
set
(
false
)
return
new
return
new
}
}
@Synchronized
fun
getPptDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
fun
getPptDocument
(
context
:
Context
):
MutableList
<
DocumentBean
>
{
isDocumentRefreshing
.
set
(
true
)
if
(!
ConstObject
.
haveSaveDemo
)
{
if
(!
ConstObject
.
haveSaveDemo
)
{
context
.
saveAssetsFile
()
context
.
saveAssetsFile
()
ConstObject
.
haveSaveDemo
=
true
ConstObject
.
haveSaveDemo
=
true
...
@@ -315,10 +327,12 @@ fun getPptDocument(context: Context): MutableList<DocumentBean> {
...
@@ -315,10 +327,12 @@ fun getPptDocument(context: Context): MutableList<DocumentBean> {
MIME_TYPE_PPTX
,
MIME_TYPE_PPTX
,
)
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
val
bookList
=
SpStringUtils
.
getSpStringList
(
BOOKMARK_KEY
)
val
documentList
=
list
.
map
{
val
documentList
=
list
.
map
{
val
document
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
TYPE_PPT
)
val
documentBean
=
DocumentBean
(
it
.
path
,
uri
=
it
.
uri
,
type
=
TYPE_PPT
)
GlobalPptList
.
add
(
deepCopy
(
document
))
GlobalPptList
.
add
(
deepCopy
(
documentBean
))
document
documentBean
.
isBookmarked
=
bookList
.
contains
(
it
.
path
)
documentBean
}
}
val
new
=
documentList
.
toMutableList
()
val
new
=
documentList
.
toMutableList
()
val
pptDemo
=
getPPtDemo
(
context
)
val
pptDemo
=
getPPtDemo
(
context
)
...
@@ -327,10 +341,10 @@ fun getPptDocument(context: Context): MutableList<DocumentBean> {
...
@@ -327,10 +341,10 @@ fun getPptDocument(context: Context): MutableList<DocumentBean> {
GlobalPptList
.
add
(
0
,
deepCopy
(
pptDemo
))
GlobalPptList
.
add
(
0
,
deepCopy
(
pptDemo
))
}
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
appScope
.
launch
{
isRefreshOver
.
emit
(
true
)
}
isDocumentRefreshing
.
set
(
false
)
return
new
return
new
}
}
fun
recentFilter
(
recentList
:
List
<
String
>,
documentBean
:
DocumentBean
)
{
fun
recentFilter
(
recentList
:
List
<
String
>,
documentBean
:
DocumentBean
)
{
val
findLastTime
=
recentList
.
filter
{
it
.
contains
(
documentBean
.
path
)
}.
map
{
val
findLastTime
=
recentList
.
filter
{
it
.
contains
(
documentBean
.
path
)
}.
map
{
it
.
split
(
"_/_"
)[
1
].
toLong
()
it
.
split
(
"_/_"
)[
1
].
toLong
()
...
@@ -386,4 +400,17 @@ fun getRvAdList(list: List<DocumentBean>): List<DocumentBean> {
...
@@ -386,4 +400,17 @@ fun getRvAdList(list: List<DocumentBean>): List<DocumentBean> {
return
arrayList
return
arrayList
}
}
return
list
return
list
}
fun
getPdfFastSize
(
context
:
Context
):
Int
{
val
selectionArgs
=
arrayOf
(
MIME_TYPE_PDF
)
val
list
=
context
.
getMediaFile
(
selectionArgs
=
selectionArgs
)
var
size
=
list
.
size
val
pdfDemo
=
getPdfDemo
(
context
)
if
(
File
(
pdfDemo
.
path
).
exists
())
{
size
+=
1
}
return
size
}
}
\ No newline at end of file
app/src/main/java/com/base/pdfoneread/ui/main/HomeFragment.kt
View file @
2fa2ebf2
...
@@ -16,6 +16,7 @@ import com.base.pdfoneread.bean.ConstObject.DO_SPLIT_PDF
...
@@ -16,6 +16,7 @@ import com.base.pdfoneread.bean.ConstObject.DO_SPLIT_PDF
import
com.base.pdfoneread.bean.ConstObject.DO_UNLOCK_PDF
import
com.base.pdfoneread.bean.ConstObject.DO_UNLOCK_PDF
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_ALL
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_ALL
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_EXCEL
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_EXCEL
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_FAVORITE
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_PDF
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_PDF
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_PPT
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_PPT
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_WORD
import
com.base.pdfoneread.bean.DocumentBean.Companion.TYPE_WORD
...
@@ -23,6 +24,7 @@ import com.base.pdfoneread.databinding.FragmentHomeBinding
...
@@ -23,6 +24,7 @@ import com.base.pdfoneread.databinding.FragmentHomeBinding
import
com.base.pdfoneread.bean.HomeUIBean
import
com.base.pdfoneread.bean.HomeUIBean
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_ALL
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_ALL
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_EXCEL
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_EXCEL
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_FAVORITES
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_IMAGE_PDF
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_IMAGE_PDF
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_IMAGE_TO_PDF
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_IMAGE_TO_PDF
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_LOCK_PDF
import
com.base.pdfoneread.bean.HomeUIBean.Companion.KEY_LOCK_PDF
...
@@ -45,7 +47,6 @@ import com.base.pdfoneread.ui.document.GlobalWordList
...
@@ -45,7 +47,6 @@ import com.base.pdfoneread.ui.document.GlobalWordList
import
com.base.pdfoneread.ui.document.getAllDocument
import
com.base.pdfoneread.ui.document.getAllDocument
import
com.base.pdfoneread.ui.document.getDocumentAppDir
import
com.base.pdfoneread.ui.document.getDocumentAppDir
import
com.base.pdfoneread.ui.document.getGlobalAllList
import
com.base.pdfoneread.ui.document.getGlobalAllList
import
com.base.pdfoneread.ui.pdf.PdfActivity
import
com.base.pdfoneread.ui.pdf.PdfSelectActivity
import
com.base.pdfoneread.ui.pdf.PdfSelectActivity
import
com.base.pdfoneread.ui.views.NameDialog.showDocumentRenameDialog
import
com.base.pdfoneread.ui.views.NameDialog.showDocumentRenameDialog
import
com.base.pdfoneread.utils.LogEx
import
com.base.pdfoneread.utils.LogEx
...
@@ -151,6 +152,12 @@ class HomeFragment() : Fragment() {
...
@@ -151,6 +152,12 @@ class HomeFragment() : Fragment() {
activity
?.
let
{
viewModel
.
starGmsScan
(
it
)
}
activity
?.
let
{
viewModel
.
starGmsScan
(
it
)
}
}
}
KEY_FAVORITES
->
{
requireContext
().
startActivity
(
Intent
(
requireContext
(),
DocumentActivity
::
class
.
java
).
apply
{
putExtra
(
"type"
,
TYPE_FAVORITE
)
})
}
KEY_MERGE_PDF
->
{
KEY_MERGE_PDF
->
{
activity
?.
let
{
PdfSelectActivity
.
jumpSelect
(
it
,
DO_MERGE_PDF
)
}
activity
?.
let
{
PdfSelectActivity
.
jumpSelect
(
it
,
DO_MERGE_PDF
)
}
}
}
...
@@ -269,6 +276,7 @@ class HomeFragment() : Fragment() {
...
@@ -269,6 +276,7 @@ class HomeFragment() : Fragment() {
HomeUIBean
(
KEY_WORD
,
R
.
mipmap
.
h_pdf_word
,
"Word"
),
HomeUIBean
(
KEY_WORD
,
R
.
mipmap
.
h_pdf_word
,
"Word"
),
HomeUIBean
(
KEY_EXCEL
,
R
.
mipmap
.
h_pdf_excel
,
"Excel"
),
HomeUIBean
(
KEY_EXCEL
,
R
.
mipmap
.
h_pdf_excel
,
"Excel"
),
HomeUIBean
(
KEY_PPT
,
R
.
mipmap
.
h_pdf_ppt
,
"PPT"
),
HomeUIBean
(
KEY_PPT
,
R
.
mipmap
.
h_pdf_ppt
,
"PPT"
),
HomeUIBean
(
KEY_FAVORITES
,
R
.
mipmap
.
h_pdf_favorites
,
"Favorites"
),
HomeUIBean
(
uiType
=
UI_TYPE_TITTLE
).
apply
{
HomeUIBean
(
uiType
=
UI_TYPE_TITTLE
).
apply
{
isTittle
=
true
isTittle
=
true
...
...
app/src/main/java/com/base/pdfoneread/ui/main/MainActivity.kt
View file @
2fa2ebf2
...
@@ -154,6 +154,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
...
@@ -154,6 +154,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
disSelectTab
()
disSelectTab
()
binding
.
ivRecent
.
isSelected
=
true
binding
.
ivRecent
.
isSelected
=
true
binding
.
tvRecent
.
isSelected
=
true
binding
.
tvRecent
.
isSelected
=
true
binding
.
flRvMode
.
visibility
=
View
.
INVISIBLE
binding
.
flSearch
.
visibility
=
View
.
VISIBLE
binding
.
tvTittle
.
text
=
resources
.
getString
(
R
.
string
.
recent
)
binding
.
tvTittle
.
text
=
resources
.
getString
(
R
.
string
.
recent
)
...
@@ -168,6 +170,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
...
@@ -168,6 +170,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
disSelectTab
()
disSelectTab
()
binding
.
ivSetting
.
isSelected
=
true
binding
.
ivSetting
.
isSelected
=
true
binding
.
tvSetting
.
isSelected
=
true
binding
.
tvSetting
.
isSelected
=
true
binding
.
flRvMode
.
visibility
=
View
.
INVISIBLE
binding
.
flSearch
.
visibility
=
View
.
INVISIBLE
binding
.
tvTittle
.
text
=
resources
.
getString
(
R
.
string
.
settings
)
binding
.
tvTittle
.
text
=
resources
.
getString
(
R
.
string
.
settings
)
if
(
getNavCurrentFragment
()
!
is
SettingFragment
)
{
if
(
getNavCurrentFragment
()
!
is
SettingFragment
)
{
...
...
app/src/main/res/layout/activity_main.xml
View file @
2fa2ebf2
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
android:layout_marginVertical=
"24dp"
android:layout_marginVertical=
"24dp"
android:layout_marginStart=
"24dp"
android:layout_marginStart=
"24dp"
android:textColor=
"@color/black"
android:textColor=
"@color/black"
android:textSize=
"20sp"
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
...
...
app/src/main/res/mipmap-xxhdpi/h_pdf_directories.png
0 → 100644
View file @
2fa2ebf2
11.4 KB
app/src/main/res/mipmap-xxhdpi/h_pdf_favorites.png
0 → 100644
View file @
2fa2ebf2
7.41 KB
app/src/main/res/values/strings.xml
View file @
2fa2ebf2
...
@@ -75,5 +75,6 @@
...
@@ -75,5 +75,6 @@
<string
name=
"thanks_feedback"
>
Thanks for your feedback.
</string>
<string
name=
"thanks_feedback"
>
Thanks for your feedback.
</string>
<string
name=
"rate_tip"
>
We are working hard for a better\nuser experience.\nWe\'d greatly appreciate if you\ncan rate us.
</string>
<string
name=
"rate_tip"
>
We are working hard for a better\nuser experience.\nWe\'d greatly appreciate if you\ncan rate us.
</string>
<string
name=
"send"
>
Send
</string>
<string
name=
"send"
>
Send
</string>
<string
name=
"favorite"
>
Favorite
</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