Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_vedio
Commits
098ce575
Commit
098ce575
authored
Jul 19, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加追剧页长按删除功能
parent
832f4751
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
29 deletions
+45
-29
MainActivity.kt
...ain/java/com/xinfu/helivideo/ui/activitys/MainActivity.kt
+6
-0
WatchRecordAdapter.kt
...java/com/xinfu/helivideo/ui/adapter/WatchRecordAdapter.kt
+1
-1
FollowVideoFragment.kt
...va/com/xinfu/helivideo/ui/fragment/FollowVideoFragment.kt
+14
-7
RecommendFragment.kt
...java/com/xinfu/helivideo/ui/fragment/RecommendFragment.kt
+8
-5
item_follow.xml
video/app/src/main/res/layout/item_follow.xml
+4
-3
item_follow_empty.xml
video/app/src/main/res/layout/item_follow_empty.xml
+12
-13
No files found.
video/app/src/main/java/com/xinfu/helivideo/ui/activitys/MainActivity.kt
View file @
098ce575
...
...
@@ -309,6 +309,12 @@ class MainActivity : BaseActivity(), View.OnClickListener {
}
}
fun
hideEditView
(
show
:
Boolean
)
{
recommendFragment
?.
let
{
(
it
as
RecommendFragment
).
hideEditView
(
show
)
}
}
fun
showEdit
(
isEdit
:
Boolean
)
{
if
(
isEdit
)
{
ll_edit
.
visibility
=
View
.
VISIBLE
...
...
video/app/src/main/java/com/xinfu/helivideo/ui/adapter/WatchRecordAdapter.kt
View file @
098ce575
...
...
@@ -53,7 +53,7 @@ class WatchRecordAdapter :
* @return
*/
fun
isItemHeader
(
position
:
Int
):
Boolean
{
if
(
data
.
size
==
0
)
return
false
if
(
data
.
size
==
0
||
position
>=
data
.
size
)
return
false
return
if
(
position
==
0
)
{
true
}
else
{
...
...
video/app/src/main/java/com/xinfu/helivideo/ui/fragment/FollowVideoFragment.kt
View file @
098ce575
...
...
@@ -61,6 +61,12 @@ class FollowVideoFragment : BaseFragment(), FollowView {
followAdapter
=
FollowAdapter
(
requireActivity
())
followAdapter
?.
setEmptyView
(
emptyView
)
followAdapter
?.
setNewInstance
(
datas
)
followAdapter
?.
setOnItemLongClickListener
{
adapter
,
view
,
position
->
datas
[
position
].
isChecked
=
true
followAdapter
?.
setEditStyle
(
true
)
showEditView
(
false
)
return
@setOnItemLongClickListener
false
}
followAdapter
?.
setOnItemClickListener
{
adapter
,
view
,
position
->
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
...
...
@@ -79,23 +85,24 @@ class FollowVideoFragment : BaseFragment(), FollowView {
followPresenter
.
detachView
()
}
fun
isListEmpty
():
Boolean
{
return
datas
.
isEmpty
()
}
private
fun
showEditView
(
show
:
Boolean
)
{
(
requireActivity
()
as
MainActivity
).
showEditView
(
show
)
}
private
fun
hideEditView
(
hide
:
Boolean
)
{
(
requireActivity
()
as
MainActivity
).
hideEditView
(
hide
)
}
override
fun
getCollectListSuc
(
bannerList
:
BannerList
)
{
datas
.
clear
()
if
(
bannerList
.
list
.
isNotEmpty
())
{
datas
.
addAll
(
bannerList
.
list
)
followAdapter
?.
setNewInstance
(
datas
)
showEditView
(
true
)
}
else
{
hideEditView
(
true
)
}
showEditView
(
true
)
followAdapter
?.
setEditStyle
(
false
)
// followAdapter?.notifyDataSetChanged()
}
override
fun
getCollectListFail
()
{
...
...
@@ -104,7 +111,7 @@ class FollowVideoFragment : BaseFragment(), FollowView {
override
fun
cancelCollectSuc
()
{
followPresenter
.
getCollectList
()
(
requireActivity
()
as
MainActivity
).
showEdit
(
fals
e
)
(
requireActivity
()
as
MainActivity
).
showEdit
View
(
tru
e
)
}
override
fun
cancelCollectFail
()
{
...
...
video/app/src/main/java/com/xinfu/helivideo/ui/fragment/RecommendFragment.kt
View file @
098ce575
...
...
@@ -70,11 +70,6 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
updateTab
(
tab
,
true
,
mSelectTabIndex
)
if
(
mSelectTabIndex
==
0
)
{
changeBottomTabColor
(
false
)
if
((
fragments
[
0
]
as
FollowVideoFragment
).
isListEmpty
())
{
iv_edit
.
visibility
=
View
.
GONE
}
else
{
iv_edit
.
visibility
=
View
.
VISIBLE
}
}
else
{
changeBottomTabColor
(
true
)
iv_edit
.
visibility
=
View
.
GONE
...
...
@@ -205,6 +200,14 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
(
fragments
[
0
]
as
FollowVideoFragment
).
delete
()
}
fun
hideEditView
(
hide
:
Boolean
)
{
if
(
hide
)
{
iv_edit
.
visibility
=
View
.
GONE
}
else
{
iv_edit
.
visibility
=
View
.
VISIBLE
}
}
override
fun
onHiddenChanged
(
hidden
:
Boolean
)
{
super
.
onHiddenChanged
(
hidden
)
if
(
mSelectTabIndex
==
0
)
return
...
...
video/app/src/main/res/layout/item_follow.xml
View file @
098ce575
...
...
@@ -2,10 +2,10 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"wrap_content"
android:layout_
marginBottom=
"10dp
"
android:layout_
height=
"wrap_content
"
android:layout_marginLeft=
"3dp"
android:layout_marginRight=
"3dp"
android:layout_
height=
"wrap_content
"
>
android:layout_
marginBottom=
"10dp
"
>
<ImageView
android:id=
"@+id/image_iv"
...
...
@@ -70,8 +70,9 @@
android:background=
"@null"
android:button=
"@null"
android:drawableEnd=
"@drawable/selector_cb"
android:paddingTop=
"10dp"
android:paddingEnd=
"6dp"
android:paddingBottom=
"1
9
0dp"
/>
android:paddingBottom=
"1
8
0dp"
/>
</FrameLayout>
...
...
video/app/src/main/res/layout/item_follow_empty.xml
View file @
098ce575
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<TextView
android:id=
"@+id/info_tv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginBottom=
"20dp"
android:text=
"暂无在追剧"
android:textColor=
"@color/gray"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
android:textColor=
"@color/gray"
/>
<Button
android:id=
"@+id/btn"
android:layout_width=
"120dp"
android:layout_height=
"40dp"
android:layout_marginTop=
"10dp"
android:layout_gravity=
"center"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/shape_red"
android:elevation=
"2dp"
android:text=
"去剧场"
android:textColor=
"@color/white"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/info_tv"
/>
android:textColor=
"@color/white"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
</FrameLayout>
\ 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