Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
P
PDF Viewer Scanner White
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 Viewer Scanner White
Commits
325b8d4a
Commit
325b8d4a
authored
Sep 20, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
e935f3b4
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
30 deletions
+45
-30
DocumentBean.kt
.../java/com/base/pdfviewerscannerwhite/bean/DocumentBean.kt
+1
-1
DocumentAdapter.kt
.../base/pdfviewerscannerwhite/ui/adapter/DocumentAdapter.kt
+36
-28
PdfSelectActivity.kt
...dfviewerscannerwhite/ui/document/pdf/PdfSelectActivity.kt
+8
-1
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/bean/DocumentBean.kt
View file @
325b8d4a
...
@@ -8,7 +8,7 @@ data class DocumentBean(
...
@@ -8,7 +8,7 @@ data class DocumentBean(
val
type
:
String
=
""
,
val
type
:
String
=
""
,
var
isBookmarked
:
Boolean
=
false
var
isBookmarked
:
Boolean
=
false
)
{
)
{
var
showSelect
:
Boolean
=
false
var
uiType
:
Int
=
0
//0首页模式 1合并选择模式 2拆分模式
var
isSelect
:
Boolean
=
false
var
isSelect
:
Boolean
=
false
companion
object
{
companion
object
{
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/adapter/DocumentAdapter.kt
View file @
325b8d4a
...
@@ -35,18 +35,8 @@ class DocumentAdapter : BaseQuickAdapter<DocumentBean, DocumentAdapter.DocumentV
...
@@ -35,18 +35,8 @@ class DocumentAdapter : BaseQuickAdapter<DocumentBean, DocumentAdapter.DocumentV
binding
.
tvName
.
text
=
file
.
name
binding
.
tvName
.
text
=
file
.
name
binding
.
tvInfo
.
text
=
file
.
lastModified
().
toFormatTime
()
+
" "
+
file
.
length
().
toFormatSize
()
binding
.
tvInfo
.
text
=
file
.
lastModified
().
toFormatTime
()
+
" "
+
file
.
length
().
toFormatSize
()
if
(
item
.
showSelect
)
{
when
(
item
.
uiType
)
{
binding
.
flMore
.
visibility
=
View
.
INVISIBLE
0
->
{
binding
.
flBookmark
.
visibility
=
View
.
INVISIBLE
binding
.
flSelect
.
visibility
=
View
.
VISIBLE
binding
.
ivSelector
.
isSelected
=
item
.
isSelect
binding
.
flSelect
.
setOnClickListener
{
item
.
isSelect
=
!
item
.
isSelect
notifyItemChanged
(
position
,
"aaa"
)
selectAction
?.
invoke
(
items
.
filter
{
it
.
isSelect
}.
size
)
}
}
else
{
binding
.
flSelect
.
visibility
=
View
.
GONE
binding
.
flSelect
.
visibility
=
View
.
GONE
binding
.
flMore
.
visibility
=
View
.
VISIBLE
binding
.
flMore
.
visibility
=
View
.
VISIBLE
binding
.
flBookmark
.
visibility
=
View
.
VISIBLE
binding
.
flBookmark
.
visibility
=
View
.
VISIBLE
...
@@ -70,6 +60,24 @@ class DocumentAdapter : BaseQuickAdapter<DocumentBean, DocumentAdapter.DocumentV
...
@@ -70,6 +60,24 @@ class DocumentAdapter : BaseQuickAdapter<DocumentBean, DocumentAdapter.DocumentV
}
}
}
}
1
->
{
binding
.
flMore
.
visibility
=
View
.
INVISIBLE
binding
.
flBookmark
.
visibility
=
View
.
INVISIBLE
binding
.
flSelect
.
visibility
=
View
.
VISIBLE
binding
.
ivSelector
.
isSelected
=
item
.
isSelect
binding
.
flSelect
.
setOnClickListener
{
item
.
isSelect
=
!
item
.
isSelect
notifyItemChanged
(
position
,
"aaa"
)
selectAction
?.
invoke
(
items
.
filter
{
it
.
isSelect
}.
size
)
}
}
2
->
{
binding
.
flBookmark
.
visibility
=
View
.
GONE
binding
.
flMore
.
visibility
=
View
.
INVISIBLE
}
}
binding
.
root
.
setOnClickListener
{
binding
.
root
.
setOnClickListener
{
itemClick
?.
invoke
(
item
)
itemClick
?.
invoke
(
item
)
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/document/pdf/PdfSelectActivity.kt
View file @
325b8d4a
...
@@ -5,6 +5,7 @@ import android.content.Intent
...
@@ -5,6 +5,7 @@ import android.content.Intent
import
android.view.View
import
android.view.View
import
androidx.lifecycle.lifecycleScope
import
androidx.lifecycle.lifecycleScope
import
com.base.pdfviewerscannerwhite.bean.ConstObject.DO_MERGE_PDF
import
com.base.pdfviewerscannerwhite.bean.ConstObject.DO_MERGE_PDF
import
com.base.pdfviewerscannerwhite.bean.ConstObject.DO_SPLIT_PDF
import
com.base.pdfviewerscannerwhite.bean.DocumentBean
import
com.base.pdfviewerscannerwhite.bean.DocumentBean
import
com.base.pdfviewerscannerwhite.databinding.ActivityPdfSelectBinding
import
com.base.pdfviewerscannerwhite.databinding.ActivityPdfSelectBinding
import
com.base.pdfviewerscannerwhite.helper.BaseActivity
import
com.base.pdfviewerscannerwhite.helper.BaseActivity
...
@@ -48,6 +49,9 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>(), DocumentView
...
@@ -48,6 +49,9 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>(), DocumentView
@SuppressLint
(
"SetTextI18n"
)
@SuppressLint
(
"SetTextI18n"
)
private
fun
initAdapter
()
{
private
fun
initAdapter
()
{
adapter
=
DocumentAdapter
()
adapter
=
DocumentAdapter
()
adapter
.
itemClick
=
{
}
adapter
.
selectAction
=
{
adapter
.
selectAction
=
{
if
(
it
==
0
)
{
if
(
it
==
0
)
{
binding
.
tvSelectTip
.
visibility
=
View
.
INVISIBLE
binding
.
tvSelectTip
.
visibility
=
View
.
INVISIBLE
...
@@ -64,7 +68,10 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>(), DocumentView
...
@@ -64,7 +68,10 @@ class PdfSelectActivity : BaseActivity<ActivityPdfSelectBinding>(), DocumentView
override
fun
refreshDocumentRv
(
documentList
:
List
<
DocumentBean
>)
{
override
fun
refreshDocumentRv
(
documentList
:
List
<
DocumentBean
>)
{
super
.
refreshDocumentRv
(
documentList
)
super
.
refreshDocumentRv
(
documentList
)
if
(
doWhat
==
DO_MERGE_PDF
)
{
if
(
doWhat
==
DO_MERGE_PDF
)
{
documentList
.
map
{
it
.
showSelect
=
true
}
documentList
.
map
{
it
.
uiType
=
1
}
}
if
(
doWhat
==
DO_SPLIT_PDF
)
{
documentList
.
map
{
it
.
uiType
=
2
}
}
}
adapter
.
submitList
(
documentList
)
adapter
.
submitList
(
documentList
)
}
}
...
...
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