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
ad694826
Commit
ad694826
authored
Oct 17, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
79c9e404
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
224 additions
and
178 deletions
+224
-178
DocumentFragment.kt
...om/base/pdfviewerscannerwhite/ui/main/DocumentFragment.kt
+2
-0
DocumentPageFragment.kt
...ase/pdfviewerscannerwhite/ui/main/DocumentPageFragment.kt
+15
-5
fragment_document.xml
app/src/main/res/layout/fragment_document.xml
+193
-173
fragment_document_page.xml
app/src/main/res/layout/fragment_document_page.xml
+13
-0
dimens.xml
app/src/main/res/values/dimens.xml
+1
-0
No files found.
app/src/main/java/com/base/pdfviewerscannerwhite/ui/main/DocumentFragment.kt
View file @
ad694826
...
...
@@ -262,6 +262,7 @@ class DocumentFragment(
uiMode
=
UI_MODE_SEARCH
(
requireActivity
()
as
MainActivity
).
callback
.
isEnabled
=
true
binding
.
card
.
elevation
=
0f
binding
.
tvTittle
.
visibility
=
View
.
INVISIBLE
binding
.
ivPaixu
.
visibility
=
View
.
INVISIBLE
binding
.
ivXuanze
.
visibility
=
View
.
INVISIBLE
...
...
@@ -281,6 +282,7 @@ class DocumentFragment(
uiMode
=
UI_MODE_NORMAL
(
requireActivity
()
as
MainActivity
).
callback
.
isEnabled
=
false
binding
.
card
.
elevation
=
resources
.
getDimension
(
R
.
dimen
.
dp_5
)
binding
.
editSearch
.
visibility
=
View
.
INVISIBLE
binding
.
flFanhui
.
visibility
=
View
.
INVISIBLE
binding
.
flSearch
.
visibility
=
View
.
INVISIBLE
...
...
app/src/main/java/com/base/pdfviewerscannerwhite/ui/main/DocumentPageFragment.kt
View file @
ad694826
...
...
@@ -61,10 +61,15 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu
super
.
setListener
()
binding
.
swipeRefreshLayout
.
setOnRefreshListener
{
binding
.
swipeRefreshLayout
.
isRefreshing
=
true
refreshData
()
binding
.
llEmpty
.
visibility
=
View
.
INVISIBLE
binding
.
progressBar
.
visibility
=
View
.
VISIBLE
binding
.
progressBar
.
isIndeterminate
=
true
refreshData
(
false
)
lifecycleScope
.
launch
(
Dispatchers
.
Main
)
{
delay
(
15
00
)
delay
(
9
00
)
binding
.
swipeRefreshLayout
.
isRefreshing
=
false
binding
.
progressBar
.
visibility
=
View
.
GONE
binding
.
llEmpty
.
isVisible
=
isEmpty
}
}
}
...
...
@@ -75,7 +80,10 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu
refreshData
()
}
fun
refreshData
()
=
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
var
isEmpty
:
Boolean
=
false
fun
refreshData
(
showEmpty
:
Boolean
=
true
)
=
lifecycleScope
.
launch
(
Dispatchers
.
IO
)
{
isEmpty
=
false
if
(
isInitialized
&&
!
isHidden
&&
!
MainPresenter
.
mainRefreshData
)
{
LogEx
.
logDebug
(
TAG
,
"type=$type refreshData dataType=$dataType"
)
val
mainActivity
=
(
requireActivity
()
as
MainActivity
?)
...
...
@@ -95,14 +103,16 @@ class DocumentPageFragment() : BaseFragment<FragmentDocumentPageBinding>(), Docu
}
launch
(
Dispatchers
.
Main
)
{
if
(
showEmpty
)
{
binding
.
llEmpty
.
isVisible
=
arrayList
.
isEmpty
()
}
val
flag
=
AdmobHelper
.
isShowRvNativeAd
()
LogEx
.
logDebug
(
TAG
,
"isShowRvNativeAd flag=$flag"
)
if
(
arrayList
.
isEmpty
())
{
isEmpty
=
true
binding
.
flAd
.
visibility
=
View
.
VISIBLE
if
(
flag
)
{
AdmobNativeUtils
.
showNativeAd
(
requireActivity
(),
binding
.
flAd
,
R
.
layout
.
layout_admob_document
)
}
...
...
app/src/main/res/layout/fragment_document.xml
View file @
ad694826
...
...
@@ -5,6 +5,17 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.cardview.widget.CardView
android:id=
"@+id/card"
app:cardElevation=
"5dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toTopOf=
"parent"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_top"
android:layout_width=
"match_parent"
...
...
@@ -113,7 +124,7 @@
<LinearLayout
android:id=
"@+id/ll_main_content"
android:layout_width=
"match_parent"
android:layout_height=
"0dp
"
android:layout_height=
"wrap_content
"
android:orientation=
"vertical"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/cl_top"
>
...
...
@@ -123,7 +134,8 @@
android:id=
"@+id/cl_tabLayout"
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:background=
"#00000000"
>
android:background=
"#00000000"
tools:ignore=
"UselessParent"
>
<com.angcyo.tablayout.DslTabLayout
android:id=
"@+id/tabLayout_document"
...
...
@@ -198,13 +210,21 @@
</FrameLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
<androidx.viewpager2.widget.ViewPager2
android:id=
"@+id/viewPager2"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
android:layout_marginTop=
"5dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/card"
/>
</LinearLayout>
<FrameLayout
android:id=
"@+id/fl_search"
...
...
@@ -213,7 +233,7 @@
android:background=
"@color/white"
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/c
l_top
"
>
app:layout_constraintTop_toBottomOf=
"@id/c
ard
"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_search"
...
...
app/src/main/res/layout/fragment_document_page.xml
View file @
ad694826
...
...
@@ -4,6 +4,7 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
tools:context=
".ui.main.DocumentPageFragment"
>
<LinearLayout
...
...
@@ -11,6 +12,18 @@
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<ProgressBar
android:indeterminateDuration=
"1600"
android:id=
"@+id/progressBar"
style=
"@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:indeterminate=
"true"
android:indeterminateBehavior=
"cycle"
android:indeterminateTint=
"#00B8DE"
android:indeterminateTintMode=
"src_atop"
android:visibility=
"gone"
/>
<FrameLayout
android:id=
"@+id/fl_ad"
android:layout_width=
"match_parent"
...
...
app/src/main/res/values/dimens.xml
View file @
ad694826
...
...
@@ -5,4 +5,5 @@
<dimen
name=
"dp_200"
>
200dp
</dimen>
<dimen
name=
"dp_146"
>
146dp
</dimen>
<dimen
name=
"dp_345"
>
345dp
</dimen>
<dimen
name=
"dp_5"
>
5dp
</dimen>
</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