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
8b511dac
Commit
8b511dac
authored
Aug 26, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
e0ea35f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
5 deletions
+19
-5
DownloadAdapter.kt
...base/browserwhite/ui/activity/download/DownloadAdapter.kt
+7
-0
WebDownloadManagerActivity.kt
...rwhite/ui/activity/download/WebDownloadManagerActivity.kt
+10
-4
activity_media_video_detail.xml
app/src/main/res/layout/activity_media_video_detail.xml
+2
-1
No files found.
app/src/main/java/com/base/browserwhite/ui/activity/download/DownloadAdapter.kt
View file @
8b511dac
...
...
@@ -36,6 +36,7 @@ class DownloadAdapter : BaseQuickAdapter<DownloadBean, DownloadAdapter.DownloadV
var
downloadAction
:
(()
->
Unit
)?
=
null
var
moreAction
:
((
archView
:
View
,
item
:
DownloadBean
)
->
Unit
)?
=
null
var
itemClick
:
((
path
:
String
)
->
Unit
)?
=
null
override
fun
onBindViewHolder
(
holder
:
DownloadViewHolder
,
position
:
Int
,
item
:
DownloadBean
?)
{
...
...
@@ -115,6 +116,12 @@ class DownloadAdapter : BaseQuickAdapter<DownloadBean, DownloadAdapter.DownloadV
binding
.
flMore
.
setOnClickListener
{
moreAction
?.
invoke
(
it
,
item
)
}
binding
.
root
.
setOnClickListener
{
if
(
item
.
status
!=
FileDownloadStatus
.
completed
)
{
return
@setOnClickListener
}
itemClick
?.
invoke
(
item
.
path
)
}
}
else
{
when
(
item
.
status
)
{
FileDownloadStatus
.
completed
->
{
...
...
app/src/main/java/com/base/browserwhite/ui/activity/download/WebDownloadManagerActivity.kt
View file @
8b511dac
...
...
@@ -9,6 +9,8 @@ import androidx.core.view.updatePadding
import
com.base.browserwhite.bean.DownloadBean
import
com.base.browserwhite.databinding.ActivityWebDownloadManagerBinding
import
com.base.browserwhite.ui.activity.BaseActivity
import
com.base.browserwhite.ui.activity.mediabrowser.MediaBrowserActivity
import
com.base.browserwhite.ui.activity.mediabrowser.MediaVideoDetailActivity
import
com.base.browserwhite.ui.views.DialogViews.showDeleteTipDialog
import
com.base.browserwhite.ui.views.DialogViews.showGerPermission
import
com.base.browserwhite.ui.views.DialogViews.showMediaMoreDialog
...
...
@@ -45,10 +47,9 @@ class WebDownloadManagerActivity : BaseActivity<ActivityWebDownloadManagerBindin
showMediaMoreDialog
(
archView
,
deleteAction
=
{
showDeleteTipDialog
{
adapter
.
items
.
forEach
{
LogEx
.
logDebug
(
TAG
,
"${it.isTime} ${it.time.toFormatTime()} ${it.path}"
)
}
// adapter.items.forEach {
// LogEx.logDebug(TAG, "${it.isTime} ${it.time.toFormatTime()} ${it.path}")
// }
runCatching
{
File
(
item
.
path
).
delete
()
saveDeleteJson
(
item
)
...
...
@@ -62,6 +63,11 @@ class WebDownloadManagerActivity : BaseActivity<ActivityWebDownloadManagerBindin
shareAction
(
uri
,
"video/*"
)
})
}
adapter
.
itemClick
=
{
path
->
startActivity
(
Intent
(
this
,
MediaVideoDetailActivity
::
class
.
java
).
apply
{
putExtra
(
"uri"
,
path
)
})
}
binding
.
rv
.
adapter
=
adapter
if
(
checkStorePermission
())
{
...
...
app/src/main/res/layout/activity_media_video_detail.xml
View file @
8b511dac
...
...
@@ -49,7 +49,8 @@
<androidx.media3.ui.PlayerView
android:id=
"@+id/playerView"
android:layout_width=
"match_parent"
android:layout_height=
"300dp"
android:layout_height=
"match_parent"
android:layout_marginVertical=
"120dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
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