Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
B
Browser 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
Browser White
Commits
c822423f
Commit
c822423f
authored
Aug 23, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
dc98af32
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
DialogViews.kt
...c/main/java/com/base/browserwhite/ui/views/DialogViews.kt
+12
-1
dialog_download_video.xml
app/src/main/res/layout/dialog_download_video.xml
+3
-3
dimens.xml
app/src/main/res/values/dimens.xml
+1
-0
No files found.
app/src/main/java/com/base/browserwhite/ui/views/DialogViews.kt
View file @
c822423f
...
...
@@ -25,7 +25,8 @@ import com.base.browserwhite.databinding.DialogMyAccountBinding
import
com.base.browserwhite.databinding.DialogPermissonOpenBinding
import
com.base.browserwhite.databinding.DialogSearchEngineBinding
import
com.base.browserwhite.ui.adapter.DownloadAdapter
import
com.base.browserwhite.ui.views.DialogViews.showMyAccountDialog
import
com.base.browserwhite.utils.LogEx
import
com.base.browserwhite.utils.XmlEx.inflate
import
com.google.android.material.bottomsheet.BottomSheetBehavior
import
com.google.android.material.bottomsheet.BottomSheetDialog
...
...
@@ -221,6 +222,7 @@ object DialogViews {
}
fun
Context
.
showDownloadVideoDialog
(
list
:
List
<
DownloadBean
>)
{
val
TAG
=
"DownloadVideoDialog"
val
dialog
=
BottomSheetDialog
(
this
)
val
binding
=
DialogDownloadVideoBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
dialog
.
setContentView
(
binding
.
root
)
...
...
@@ -236,6 +238,15 @@ object DialogViews {
val
adapter
=
DownloadAdapter
()
binding
.
rv
.
adapter
=
adapter
adapter
.
submitList
(
list
)
val
itemHeight
=
resources
.
getDimensionPixelOffset
(
R
.
dimen
.
dp_97
)
LogEx
.
logDebug
(
TAG
,
"itemHeight=$itemHeight"
)
if
(
list
.
size
>
3
)
{
val
recyclerViewHeight
:
Int
=
3
*
itemHeight
binding
.
rv
.
layoutParams
.
height
=
recyclerViewHeight
binding
.
rv
.
requestLayout
()
}
}
}
\ No newline at end of file
app/src/main/res/layout/dialog_download_video.xml
View file @
c822423f
...
...
@@ -44,12 +44,12 @@
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv"
android:layout_width=
"match_parent"
android:layout_height=
"300dp"
android:layout_marginTop=
"16dp"
android:maxHeight=
"300dp"
android:layout_height=
"wrap_content"
android:layout_marginVertical=
"16dp"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_download_dir"
tools:itemCount=
"3"
tools:listitem=
"@layout/item_download_card"
/>
...
...
app/src/main/res/values/dimens.xml
View file @
c822423f
...
...
@@ -12,4 +12,5 @@
<dimen
name=
"dp_335"
>
335dp
</dimen>
<dimen
name=
"dp_9"
>
9dp
</dimen>
<dimen
name=
"dp_5"
>
5dp
</dimen>
<dimen
name=
"dp_97"
>
97dp
</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