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
f8b20b46
Commit
f8b20b46
authored
Jul 12, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
ba5db096
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
342 additions
and
181 deletions
+342
-181
GlideUtils.kt
...o/app/src/main/java/com/mints/library/utils/GlideUtils.kt
+1
-1
Constant.kt
...pp/src/main/java/com/mints/wisdomclean/common/Constant.kt
+2
-0
LocalVedioManager.kt
...n/java/com/mints/wisdomclean/manager/LocalVedioManager.kt
+8
-1
VedioBean.java
.../main/java/com/mints/wisdomclean/mvp/model/VedioBean.java
+18
-0
FollowPresenter.kt
...a/com/mints/wisdomclean/mvp/presenters/FollowPresenter.kt
+2
-4
RecommendPresenter.kt
...om/mints/wisdomclean/mvp/presenters/RecommendPresenter.kt
+38
-0
VideoPresenter.kt
...va/com/mints/wisdomclean/mvp/presenters/VideoPresenter.kt
+6
-2
RecommendView.kt
...ain/java/com/mints/wisdomclean/mvp/views/RecommendView.kt
+6
-0
LoanService.java
.../src/main/java/com/mints/wisdomclean/net/LoanService.java
+7
-1
MainActivity.kt
...n/java/com/mints/wisdomclean/ui/activitys/MainActivity.kt
+6
-0
FollowAdapter.kt
...in/java/com/mints/wisdomclean/ui/adapter/FollowAdapter.kt
+2
-2
FollowVideoFragment.kt
.../com/mints/wisdomclean/ui/fragment/FollowVideoFragment.kt
+18
-0
RecommendFragment.kt
...va/com/mints/wisdomclean/ui/fragment/RecommendFragment.kt
+36
-2
WatchVideoFragment.kt
...a/com/mints/wisdomclean/ui/fragment/WatchVideoFragment.kt
+50
-123
VideoEpisodeDialog.kt
...va/com/mints/wisdomclean/ui/widgets/VideoEpisodeDialog.kt
+7
-0
DramaApiDetailActivity.kt
...ava/com/mints/wisdomclean/video/DramaApiDetailActivity.kt
+38
-8
DramaTabFragment.kt
...main/java/com/mints/wisdomclean/video/DramaTabFragment.kt
+51
-13
RecommendVideoAdapter.kt
...java/com/mints/wisdomclean/video/RecommendVideoAdapter.kt
+8
-7
VideoActivity.kt
...rc/main/java/com/mints/wisdomclean/video/VideoActivity.kt
+16
-4
VideoAdapter.kt
...src/main/java/com/mints/wisdomclean/video/VideoAdapter.kt
+3
-1
drama_activity_api_detail.xml
video/app/src/main/res/layout/drama_activity_api_detail.xml
+1
-3
item_empty_video.xml
video/app/src/main/res/layout/item_empty_video.xml
+4
-0
item_follow.xml
video/app/src/main/res/layout/item_follow.xml
+14
-9
No files found.
video/app/src/main/java/com/mints/library/utils/GlideUtils.kt
View file @
f8b20b46
...
...
@@ -74,7 +74,7 @@ object GlideUtils {
Glide
.
with
(
mContext
!!
).
load
(
path
).
apply
(
RequestOptions
().
transform
(
CenterCrop
(),
RoundedCorners
(
BubbleUtils
.
dp2px
(
2
0
))
RoundedCorners
(
BubbleUtils
.
dp2px
(
1
0
))
)
).
dontAnimate
().
into
(
mImageView
!!
)
}
...
...
video/app/src/main/java/com/mints/wisdomclean/common/Constant.kt
View file @
f8b20b46
...
...
@@ -5,6 +5,8 @@ object Constant {
const
val
PAGE_SIZE
=
12
const
val
LOCAL_VEDIO
=
"LOCAL_VEDIO"
const
val
VEDIO_BEAN
=
"VEDIO_BEAN"
const
val
VEDIO_NEXT
=
"VEDIO_NEXT"
const
val
VEDIO_THIRD
=
"VEDIO_THIRD"
/**
* 首次弹出权限声明
...
...
video/app/src/main/java/com/mints/wisdomclean/manager/LocalVedioManager.kt
View file @
f8b20b46
...
...
@@ -82,11 +82,18 @@ object LocalVedioManager {
/**
* 根据类型跳转对应视频详情页 [自有或穿山甲]
*/
fun
startVedioDetailActivityForType
(
activity
:
Activity
,
data
:
VedioBean
?)
{
fun
startVedioDetailActivityForType
(
activity
:
Activity
,
data
:
VedioBean
?,
isPlayNext
:
Boolean
=
false
,
isThirdId
:
Boolean
=
false
)
{
if
(
data
?.
createType
==
1
)
{
//自有短剧
val
bundle
=
Bundle
()
bundle
.
putString
(
Constant
.
VEDIO_BEAN
,
JsonUtil
.
toJson
(
data
))
bundle
.
putBoolean
(
Constant
.
VEDIO_NEXT
,
isPlayNext
)
bundle
.
putBoolean
(
Constant
.
VEDIO_THIRD
,
isThirdId
)
readyGo
(
activity
,
VideoActivity
::
class
.
java
,
bundle
)
}
else
{
requestDrama
(
activity
,
data
)
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/model/VedioBean.java
View file @
f8b20b46
...
...
@@ -23,6 +23,24 @@ public class VedioBean implements Serializable {
private
int
vedioId
;
// 视频id,服务器标识
private
String
hot
;
// 播放量
private
int
adGiveVedioNum
;
// 广告解锁数量
private
String
recommendUrl
;
// 推荐视频地址
private
int
recommendIndex
;
// 推荐视频第几集
public
String
getRecommendUrl
()
{
return
recommendUrl
;
}
public
void
setRecommendUrl
(
String
recommendUrl
)
{
this
.
recommendUrl
=
recommendUrl
;
}
public
int
getRecommendIndex
()
{
return
recommendIndex
;
}
public
void
setRecommendIndex
(
int
recommendIndex
)
{
this
.
recommendIndex
=
recommendIndex
;
}
public
int
getAdGiveVedioNum
()
{
return
adGiveVedioNum
;
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/presenters/FollowPresenter.kt
View file @
f8b20b46
...
...
@@ -11,11 +11,9 @@ import java.util.HashMap
class
FollowPresenter
:
BasePresenter
<
FollowView
>()
{
fun
getCollectList
(
videoId
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"videoId"
]
=
videoId
fun
getCollectList
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
collectList
(
vo
),
.
call
(
loanService
.
collectList
(),
object
:
BaseSubscriber
<
BaseResponse
<
BannerList
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/presenters/RecommendPresenter.kt
View file @
f8b20b46
...
...
@@ -4,12 +4,50 @@ import com.google.gson.JsonObject
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
com.mints.wisdomclean.manager.AppHttpManager
import
com.mints.wisdomclean.mvp.model.BannerList
import
com.mints.wisdomclean.mvp.model.BaseResponse
import
com.mints.wisdomclean.mvp.views.RecommendView
import
java.util.HashMap
class
RecommendPresenter
:
BasePresenter
<
RecommendView
>()
{
fun
autoList
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
autoList
(),
object
:
BaseSubscriber
<
BaseResponse
<
BannerList
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
BannerList
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
autoListSuc
(
baseResponse
.
data
)
else
->
{
view
.
autoListFail
()
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
view
.
autoListFail
()
}
})
}
fun
collect
(
videoId
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"videoId"
]
=
videoId
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/presenters/VideoPresenter.kt
View file @
f8b20b46
...
...
@@ -11,9 +11,13 @@ import java.util.HashMap
class
VideoPresenter
:
BasePresenter
<
VideoView
>()
{
fun
getIndexList
(
videoId
:
String
)
{
fun
getIndexList
(
thirdId
:
String
,
csj
:
Boolean
=
false
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"vedioId"
]
=
videoId
if
(
csj
)
{
vo
[
"thirdId"
]
=
thirdId
}
else
{
vo
[
"vedioId"
]
=
thirdId
}
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getIndexList
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
IndexList
>>()
{
...
...
video/app/src/main/java/com/mints/wisdomclean/mvp/views/RecommendView.kt
View file @
f8b20b46
package
com.mints.wisdomclean.mvp.views
import
com.mints.wisdomclean.mvp.model.BannerList
interface
RecommendView
:
BaseView
{
...
...
@@ -9,4 +11,8 @@ interface RecommendView : BaseView {
fun
cancelCollectSuc
()
fun
cancelCollectFail
()
fun
autoListSuc
(
list
:
BannerList
)
fun
autoListFail
()
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/net/LoanService.java
View file @
f8b20b46
...
...
@@ -232,7 +232,7 @@ public interface LoanService {
* @return
*/
@POST
(
"api/vedio/collectList"
)
Observable
<
BaseResponse
<
BannerList
>>
collectList
(
@Body
Map
<
String
,
Object
>
vo
);
Observable
<
BaseResponse
<
BannerList
>>
collectList
();
/**
* 最新一条记录
...
...
@@ -256,6 +256,12 @@ public interface LoanService {
@POST
(
"api/vedio/reportIndex"
)
Observable
<
BaseResponse
<
Object
>>
reportIndex
(
@Body
Map
<
String
,
Object
>
vo
);
/**
* 推荐
*/
@POST
(
"api/vedio/autoList"
)
Observable
<
BaseResponse
<
BannerList
>>
autoList
();
/**
* 默认http工厂
*/
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/activitys/MainActivity.kt
View file @
f8b20b46
...
...
@@ -301,6 +301,12 @@ class MainActivity : BaseActivity(), View.OnClickListener {
}
}
fun
showEditView
(
show
:
Boolean
)
{
recommendFragment
?.
let
{
(
it
as
RecommendFragment
).
showEditView
(
show
)
}
}
fun
showEdit
(
isEdit
:
Boolean
)
{
if
(
isEdit
)
{
ll_edit
.
visibility
=
View
.
VISIBLE
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/adapter/FollowAdapter.kt
View file @
f8b20b46
...
...
@@ -22,10 +22,10 @@ class FollowAdapter(var activity: Activity) :
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
VedioBean
)
{
holder
.
getView
<
View
>(
R
.
id
.
fm_mask
).
visibility
=
if
(
showEdit
)
View
.
VISIBLE
else
View
.
GONE
holder
.
getView
<
TextView
>(
R
.
id
.
title_tv
).
text
=
item
.
title
holder
.
getView
<
TextView
>(
R
.
id
.
info_tv
).
text
=
item
.
scriptName
holder
.
getView
<
TextView
>(
R
.
id
.
info_tv
).
text
=
item
.
vedioDesc
holder
.
getView
<
TextView
>(
R
.
id
.
complete_tv
).
text
=
if
(
item
.
completeStatus
==
0
)
"已完结"
else
"更新中"
GlideUtils
.
loadImageViewNoAnim
(
context
,
item
.
coverImage
,
holder
.
getView
(
R
.
id
.
image_iv
))
GlideUtils
.
loadImageViewNoAnim
2
(
context
,
item
.
coverImage
,
holder
.
getView
(
R
.
id
.
image_iv
))
}
// 设置编辑状态
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/FollowVideoFragment.kt
View file @
f8b20b46
...
...
@@ -6,6 +6,7 @@ import android.view.View
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.GridLayoutManager
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.manager.LocalVedioManager
import
com.mints.wisdomclean.mvp.model.BannerList
import
com.mints.wisdomclean.mvp.model.VedioBean
import
com.mints.wisdomclean.mvp.presenters.FollowPresenter
...
...
@@ -38,6 +39,7 @@ class FollowVideoFragment : BaseFragment(), FollowView {
override
fun
onResume
()
{
super
.
onResume
()
followPresenter
.
getCollectList
()
}
override
fun
initViewsAndEvents
()
{
...
...
@@ -59,6 +61,12 @@ class FollowVideoFragment : BaseFragment(), FollowView {
followAdapter
=
FollowAdapter
(
requireActivity
())
followAdapter
.
setEmptyView
(
emptyView
)
followAdapter
.
setNewInstance
(
datas
)
followAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
datas
[
position
]
)
}
rv_follow
.
adapter
=
followAdapter
}
...
...
@@ -75,15 +83,25 @@ class FollowVideoFragment : BaseFragment(), FollowView {
return
datas
.
isEmpty
()
}
private
fun
showEditView
(
show
:
Boolean
)
{
(
requireActivity
()
as
MainActivity
).
showEditView
(
show
)
}
override
fun
getCollectListSuc
(
bannerList
:
BannerList
)
{
if
(
bannerList
.
list
.
isNotEmpty
())
{
datas
.
clear
()
datas
.
addAll
(
bannerList
.
list
)
followAdapter
.
setNewInstance
(
datas
)
followAdapter
.
notifyDataSetChanged
()
showEditView
(
true
)
}
else
{
showEditView
(
false
)
}
}
override
fun
getCollectListFail
()
{
showEditView
(
false
)
}
override
fun
cancelCollectSuc
()
{
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/RecommendFragment.kt
View file @
f8b20b46
...
...
@@ -10,9 +10,11 @@ import com.google.android.material.tabs.TabLayoutMediator
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.common.AppConfig
import
com.mints.wisdomclean.common.Constant
import
com.mints.wisdomclean.manager.UserManager
import
com.mints.wisdomclean.ui.activitys.MainActivity
import
com.mints.wisdomclean.ui.adapter.RecommendPageAdapter
import
com.mints.wisdomclean.ui.fragment.base.BaseFragment
import
com.mints.wisdomclean.video.DramaTabFragment
import
kotlinx.android.synthetic.main.fragment_recommend.*
/**
...
...
@@ -22,6 +24,8 @@ import kotlinx.android.synthetic.main.fragment_recommend.*
*/
class
RecommendFragment
:
BaseFragment
(),
View
.
OnClickListener
{
private
var
mCurrentNewFlag
=
false
private
var
mSelectTabIndex
=
-
1
private
val
tabsData
=
mutableListOf
<
String
>()
private
val
fragments
=
mutableListOf
<
Fragment
>()
...
...
@@ -37,11 +41,18 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
fragment_recommend
private
fun
initVp2
()
{
mCurrentNewFlag
=
UserManager
.
getInstance
().
newFlag
tabsData
.
add
(
"追剧"
)
tabsData
.
add
(
"推荐"
)
fragments
.
add
(
FollowVideoFragment
.
newInstance
())
fragments
.
add
(
WatchVideoFragment
.
newInstance
())
if
(
mCurrentNewFlag
)
{
fragments
.
add
(
FollowVideoFragment
.
newInstance
())
fragments
.
add
(
WatchVideoFragment
.
newInstance
())
}
else
{
fragments
.
add
(
FollowVideoFragment
.
newInstance
())
fragments
.
add
(
DramaTabFragment
())
}
vpAdapter
=
RecommendPageAdapter
(
fragments
,
this
)
vp2_recommend
.
adapter
=
vpAdapter
...
...
@@ -132,6 +143,21 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
super
.
onResume
()
if
(
AppConfig
.
fragmentClickFlag
==
Constant
.
FRAGMENT_CLICK_TWO
)
{
if
(
mCurrentNewFlag
!=
UserManager
.
getInstance
().
newFlag
)
{
mCurrentNewFlag
=
UserManager
.
getInstance
().
newFlag
if
(
mCurrentNewFlag
)
{
// 匹配用户自有
fragments
.
clear
()
fragments
.
add
(
FollowVideoFragment
.
newInstance
())
fragments
.
add
(
WatchVideoFragment
.
newInstance
())
}
else
{
// 未匹配用户展示穿山甲
fragments
.
clear
()
fragments
.
add
(
FollowVideoFragment
.
newInstance
())
fragments
.
add
(
DramaTabFragment
())
}
vpAdapter
?.
notifyDataSetChanged
()
}
}
}
...
...
@@ -171,6 +197,14 @@ class RecommendFragment : BaseFragment(), View.OnClickListener {
(
requireActivity
()
as
MainActivity
).
showBlack
(
showBlack
)
}
fun
showEditView
(
show
:
Boolean
)
{
if
(
show
)
{
iv_edit
.
visibility
=
View
.
VISIBLE
}
else
{
iv_edit
.
visibility
=
View
.
GONE
}
}
fun
fullChoice
()
{
(
fragments
[
0
]
as
FollowVideoFragment
).
getAdapter
().
fullChoice
()
}
...
...
video/app/src/main/java/com/mints/wisdomclean/ui/fragment/WatchVideoFragment.kt
View file @
f8b20b46
package
com.mints.wisdomclean.ui.fragment
import
android.os.Bundle
import
android.view.LayoutInflater
import
android.view.View
import
androidx.constraintlayout.widget.ConstraintLayout
import
androidx.fragment.app.Fragment
import
androidx.recyclerview.widget.OrientationHelper
import
androidx.recyclerview.widget.RecyclerView
import
cn.jzvd.Jzvd
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.manager.LocalVedioManager
import
com.mints.wisdomclean.mvp.model.BannerList
import
com.mints.wisdomclean.mvp.model.VedioBean
import
com.mints.wisdomclean.mvp.presenters.RecommendPresenter
import
com.mints.wisdomclean.mvp.views.RecommendView
import
com.mints.wisdomclean.ui.fragment.base.BaseFragment
import
com.mints.wisdomclean.video.*
import
kotlinx.android.synthetic.main.fragment_watch_video.
*
import
kotlinx.android.synthetic.main.fragment_watch_video.
recy
/**
* @author Assen
...
...
@@ -31,31 +36,45 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
}
}
private
var
mCurrentPosition
=
-
1
private
var
mCurrentPosition
=
0
lateinit
var
adapter
:
RecommendVideoAdapter
var
videos
=
arrayListOf
<
VideoBean
>()
var
videos
=
arrayListOf
<
VedioBean
>()
override
fun
initViewsAndEvents
()
{
recommendPresenter
.
attachView
(
this
)
initData
()
val
layoutManager
=
RecyViewLayoutManager
(
requireContext
(),
OrientationHelper
.
VERTICAL
)
recy
.
layoutManager
=
layoutManager
adapter
=
RecommendVideoAdapter
(
requireActivity
())
recy
.
adapter
=
adapter
//预加载下一个
adapter
.
setNewInstance
(
videos
)
val
emptyView
=
LayoutInflater
.
from
(
requireContext
()).
inflate
(
R
.
layout
.
item_empty_video
,
null
)
adapter
.
setEmptyView
(
emptyView
)
adapter
.
addChildClickViewIds
(
R
.
id
.
ll_bottom
,
R
.
id
.
ll_collect
)
adapter
.
setOnItemChildClickListener
{
adapter
,
view
,
position
->
when
(
view
.
id
)
{
R
.
id
.
ll_bottom
->
{
val
bundle
=
Bundle
()
readyGo
(
VideoActivity
::
class
.
java
,
bundle
)
videos
[
position
].
seeIndex
++
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
videos
[
position
],
true
)
// val bundle = Bundle()
// readyGo(VideoActivity::class.java, bundle)
}
R
.
id
.
ll_collect
->
{
if
(
videos
[
position
].
collect
==
0
)
{
videos
[
position
].
collect
=
1
recommendPresenter
.
collect
(
""
+
videos
[
position
].
vedioId
)
}
else
{
recommendPresenter
.
cancelCollect
(
""
+
videos
[
position
].
vedioId
)
videos
[
position
].
collect
=
0
}
}
else
->
{}
}
...
...
@@ -63,15 +82,19 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
adapter
.
setOnVideoCompletion
(
object
:
JzvdStdTikTok
.
OnVideoCompletion
{
override
fun
onVideoCompletion
()
{
showToast
(
"即将为您播放下一集"
)
val
bundle
=
Bundle
()
readyGo
(
VideoActivity
::
class
.
java
,
bundle
)
// recy.smoothScrollToPosition(mCurrentPosition + 1)
videos
[
mCurrentPosition
].
seeIndex
++
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
videos
[
mCurrentPosition
],
true
)
}
})
layoutManager
.
setOnViewPagerListener
(
object
:
OnRecyViewListener
{
override
fun
onInitComplete
()
{
mCurrentPosition
=
0
//
mCurrentPosition = 0
//初始化 自动播放
autoPlayVideo
()
...
...
@@ -91,7 +114,6 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
}
if
(
isBottom
)
{
//是最底部,执行加载更多数据
loadData
()
}
autoPlayVideo
()
mCurrentPosition
=
position
...
...
@@ -103,6 +125,8 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
recy
.
addOnChildAttachStateChangeListener
(
object
:
RecyclerView
.
OnChildAttachStateChangeListener
{
override
fun
onChildViewDetachedFromWindow
(
view
:
View
)
{
if
(
view
!
is
ConstraintLayout
)
return
val
jzvd
:
Jzvd
=
view
.
findViewById
(
R
.
id
.
jz_video
)
if
(
jzvd
!=
null
&&
Jzvd
.
CURRENT_JZVD
!=
null
&&
jzvd
.
jzDataSource
.
containsTheUrl
(
Jzvd
.
CURRENT_JZVD
.
jzDataSource
.
currentUrl
)
...
...
@@ -124,6 +148,8 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
override
fun
onResume
()
{
super
.
onResume
()
Jzvd
.
goOnPlayOnResume
()
recommendPresenter
.
autoList
()
}
override
fun
onPause
()
{
...
...
@@ -143,6 +169,7 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
if
(
recy
==
null
||
recy
.
getChildAt
(
0
)
==
null
)
{
return
}
if
(
recy
.
getChildAt
(
0
)
!
is
ConstraintLayout
)
return
val
player
:
JzvdStdTikTok
=
recy
.
getChildAt
(
0
).
findViewById
(
R
.
id
.
jz_video
)
if
(
player
!=
null
)
{
player
.
startVideoAfterPreloading
()
...
...
@@ -150,116 +177,6 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
}
}
//加载
fun
loadData
()
{
videos
.
add
(
VideoBean
(
6
,
"遵义观察 "
,
"https://p9-dy.byteimg.com/aweme/100x100/2e1ce00021ee51a2aacdc.jpeg?from=4010531038"
,
"老伴咱走!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fe10000bloib0nrri6bf7b1k4fg&ratio=720p&line=0"
,
"https://p29-dy.byteimg.com/obj/tos-cn-p-0015/601c6d730167431184c5412e81cd32d1?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
7
,
"BTV养生堂 "
,
"https://p6-dy-ipv6.byteimg.com/aweme/100x100/3151700027839b153b924.jpeg?from=4010531038"
,
"湿气过重,快收藏这个中医调理方!!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f730000bpebr0dqg5balrfhqlog&ratio=720p&line=0"
,
"https://p3-dy-ipv6.byteimg.com/obj/tos-cn-p-0015/0e99f0aca9764e7da53be1096a3bd641_1583136211?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
8
,
"河南都市频道 "
,
"https://p9-dy.byteimg.com/aweme/100x100/312a8000720705660b806.jpeg?from=4010531038"
,
"痛心!手扶梯绞断女童两根手指!带娃搭扶梯的一定要注意了!(上)!"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f250000bgsu5vamac2seo2gp53g&ratio=720p&line=0"
,
"https://p1-dy-ipv6.byteimg.com/obj/160b4000aa3f373bd14cd?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
9
,
"科学小妙招 "
,
"https://p26-dy.byteimg.com/aweme/100x100/312090000434b4dd10244.jpeg?from=4010531038"
,
"不喜欢的衣服扔了可惜,这样改造一下非常酷#生活小妙招 #生活小技巧 #废物利用 @抖音小助手"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fe10000bq2bf7s9hq5lufbuoflg&ratio=720p&line=0"
,
"https://p9-dy.byteimg.com/obj/tos-cn-p-0015/9a6784fcbf9b43849081d7a3388db08d_1585756125?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
10
,
"一起装修网 "
,
"https://p29-dy.byteimg.com/aweme/100x100/f77d000eae902034a2bf.jpeg?from=4010531038"
,
"#装修 #黑幕重重 怎样选购浴室柜?揭露浴室柜增项(增项:镜子,水龙头,软管等)@胡 一刀"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0300f9a0000belnavkqn5hfpb70b5kg&ratio=720p&line=0"
,
"https://p29-dy.byteimg.com/obj/c8f200068c30b23f1024?from=2563711402_large"
)
)
}
fun
initData
()
{
videos
.
add
(
VideoBean
(
1
,
"中韩夫妇与两宝"
,
"https://p29-dy.byteimg.com/aweme/100x100/2f9480001ea8cc615d6a9.jpeg?from=401053103"
,
"家有一老如有一宝,不分国界"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fe90000bs854d21rirdcdon9fk0&ratio=720p&line=0"
,
"https://p6-dy-ipv6.byteimg.com/img/tos-cn-p-0015/2263f31dfb304120a5fb5d6655b230c5_1594905185~tplv-dmt-logom:tos-cn-i-0813/65302cd29d2d4043a98de10a7723d33d.image?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
2
,
"央视新闻"
,
"https://p6-dy-ipv6.byteimg.com/aweme/100x100/30e520009a01cad2d810e.jpeg?from=4010531038"
,
"高三考生注意了!今年高考时间推迟一个月,为7月7日至7月8日"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200fe90000bs854d21rirdcdon9fk0&ratio=720p&line=0"
,
"https://p29-dy.byteimg.com/obj/tos-cn-p-0015/f79a5fe204e24bbbbfc55a76a81f5c2c_1585626014?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
3
,
"查查和张张"
,
"https://p6-dy-ipv6.byteimg.com/aweme/100x100/30e520009a01cad2d810e.jpeg?from=4010531038"
,
"#情侣 #春节 就没有我解决不了的婆媳关系 嘿嘿@Singing哥 @抖音小助手"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f670000bomln43d82dvbadk5a00&ratio=720p&line=0"
,
"https://p29-dy.byteimg.com/obj/tos-cn-p-0015/f61dcb8127204a8cb7a322bf816c0b3e_1580030882?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
4
,
"大鹏(宇宙简史)"
,
"https://p3-dy-ipv6.byteimg.com/aweme/100x100/1e1170002093b2ff1d0f7.jpeg?from=4010531038"
,
"2018下半年所以天文奇观!还有流星雨哦!千万不要错过了"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f4e0000bddrstnff778g23hs6mg&ratio=720p&line=0"
,
"https://p6-dy-ipv6.byteimg.com/obj/9dfb0003c8c228b763eb?from=2563711402_large"
)
)
videos
.
add
(
VideoBean
(
5
,
"胖爹带娃"
,
"https://p3-dy-ipv6.byteimg.com/aweme/100x100/26ec600005035c9b87288.jpeg?from=4010531038"
,
"带孩子出门玩耍一定要记得这一点!接力下去,别以为危险离我们很远@抖音小助手 #暑假安全"
,
"https://aweme.snssdk.com/aweme/v1/playwm/?video_id=v0200f4e0000bddrstnff778g23hs6mg&ratio=720p&line=0"
,
"https://p9-dy.byteimg.com/obj/2c5c600050a7b42352869?from=2563711402_large"
)
)
}
override
fun
onDetach
()
{
super
.
onDetach
()
recommendPresenter
.
detachView
()
...
...
@@ -281,5 +198,15 @@ class WatchVideoFragment : BaseFragment(), RecommendView {
}
override
fun
autoListSuc
(
list
:
BannerList
)
{
videos
.
clear
()
videos
.
addAll
(
list
.
list
)
adapter
?.
notifyDataSetChanged
()
}
override
fun
autoListFail
()
{
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/ui/widgets/VideoEpisodeDialog.kt
View file @
f8b20b46
...
...
@@ -129,6 +129,13 @@ class VideoEpisodeDialog(
}
}
fun
changeLockStatus
(
unlockIndex
:
Int
)
{
for
(
i
in
0
until
mData
.
size
)
{
mData
[
i
].
lock
=
i
>
unlockIndex
}
adapter
?.
notifyDataSetChanged
()
}
fun
setCurrentIndex
(
position
:
Int
)
{
for
(
mDatum
in
mData
)
{
mDatum
.
playing
=
false
...
...
video/app/src/main/java/com/mints/wisdomclean/video/DramaApiDetailActivity.kt
View file @
f8b20b46
...
...
@@ -84,6 +84,9 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private
var
freeSet
=
5
private
var
lockSet
=
2
private
var
isThirdId
=
false
private
var
isPlayNext
=
false
private
var
mode
=
DPDramaDetailConfig
.
SPECIFIC_DETAIL
private
val
isFromCard
by
lazy
{
intent
?.
getBooleanExtra
(
IS_FROM_CARD
,
false
)
?:
false
}
...
...
@@ -93,10 +96,14 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
val
json
=
extras
?.
getString
(
Constant
.
VEDIO_BEAN
)
isThirdId
=
extras
?.
getBoolean
(
Constant
.
VEDIO_THIRD
,
false
)
==
true
isPlayNext
=
extras
?.
getBoolean
(
Constant
.
VEDIO_NEXT
,
false
)
==
true
mVedioBean
=
Gson
().
fromJson
(
json
,
VedioBean
::
class
.
java
)
freeSet
=
mVedioBean
!!
.
unlockIndex
lockSet
=
mVedioBean
!!
.
adGiveVedioNum
// lockSet = mVedioBean!!.adGiveVedioNum
lockSet
=
3
hideLeftTopTips
=
true
mode
=
DPDramaDetailConfig
.
SPECIFIC_DETAIL
enableInfiniteScroll
=
false
...
...
@@ -334,6 +341,11 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
Log
.
d
(
TAG
,
"isNeedBlock: index = $index"
)
val
unlockIndex
=
mUnlockIndexMap
[
drama
.
id
]
?:
mInitUnlockIndex
val
hasUnlockList
=
mHasUnlockIndexMap
[
drama
.
id
]
?:
mutableListOf
()
Log
.
d
(
TAG
,
"isNeedBlock: index = $index"
+
" "
+
unlockIndex
+
"s"
+
drama
.
id
+
mHasUnlockIndexMap
)
return
index
>
unlockIndex
&&
hasUnlockList
.
contains
(
index
).
not
()
}
...
...
@@ -362,14 +374,24 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
override
fun
adClose
(
vo
:
HashMap
<
String
,
Any
>?)
{
vo
?.
let
{
it
[
"vedioId"
]
=
""
+
mVedioBean
!!
.
vedioId
if
(
isThirdId
)
{
it
[
"thirdId"
]
=
""
+
mVedioBean
!!
.
thirdId
}
else
{
it
[
"vedioId"
]
=
""
+
mVedioBean
!!
.
vedioId
}
videoPresenter
.
unlock
(
it
)
}
val
hasUnlockList
:
MutableList
<
Int
>
=
mHasUnlockIndexMap
[
drama
.
id
]
?:
mutableListOf
()
hasUnlockList
.
add
(
widget
.
currentDramaIndex
)
mHasUnlockIndexMap
[
drama
.
id
]
=
hasUnlockList
// 更新解锁集数
for
(
i
in
0
until
lockSet
)
{
val
hasUnlockList
:
MutableList
<
Int
>
=
mHasUnlockIndexMap
[
drama
.
id
]
?:
mutableListOf
()
hasUnlockList
.
add
(
widget
.
currentDramaIndex
+
lockSet
)
mHasUnlockIndexMap
[
drama
.
id
]
=
hasUnlockList
}
mUnlockIndexMap
[
drama
.
id
]
=
mUnlockIndexMap
[
drama
.
id
]
!!
+
lockSet
blockView
?.
visibility
=
View
.
GONE
callback
?.
onDramaRewardArrived
()
// 解锁当前集
}
...
...
@@ -509,9 +531,17 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
when
(
v
?.
id
)
{
R
.
id
.
ll_collect
->
{
if
(
mVedioBean
!!
.
collect
==
0
)
{
videoPresenter
.
collect
(
""
+
mVedioBean
!!
.
vedioId
)
if
(
isThirdId
)
{
videoPresenter
.
collect
(
""
+
mVedioBean
!!
.
thirdId
)
}
else
{
videoPresenter
.
collect
(
""
+
mVedioBean
!!
.
vedioId
)
}
}
else
{
videoPresenter
.
cancelCollect
(
""
+
mVedioBean
!!
.
vedioId
)
if
(
isThirdId
)
{
videoPresenter
.
cancelCollect
(
""
+
mVedioBean
!!
.
thirdId
)
}
else
{
videoPresenter
.
cancelCollect
(
""
+
mVedioBean
!!
.
vedioId
)
}
}
}
else
->
{}
...
...
video/app/src/main/java/com/mints/wisdomclean/video/DramaTabFragment.kt
View file @
f8b20b46
package
com.mints.wisdomclean.video
import
android.os.Bundle
import
android.util.Log
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
import
com.bytedance.sdk.dp.DPDramaDetailConfig
import
com.bytedance.sdk.dp.DPSdk
...
...
@@ -14,19 +10,22 @@ import com.bytedance.sdk.dp.IDPDramaListener
import
com.bytedance.sdk.dp.IDPDrawListener
import
com.bytedance.sdk.dp.IDPWidget
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.manager.LocalVedioManager
import
com.mints.wisdomclean.mvp.model.IndexList
import
com.mints.wisdomclean.mvp.presenters.VideoPresenter
import
com.mints.wisdomclean.mvp.views.VideoView
import
com.mints.wisdomclean.ui.fragment.base.BaseFragment
/**
* Created by limingqi on 2023/1/17
*/
class
DramaTabFragment
:
BaseFragment
()
{
class
DramaTabFragment
:
BaseFragment
()
,
VideoView
{
companion
object
{
private
val
videoPresenter
by
lazy
{
VideoPresenter
()
}
private
const
val
TAG
=
"DramaTabFragment"
private
const
val
FREE_SET
=
-
1
private
const
val
LOCK_SET
=
-
1
companion
object
{
private
const
val
TAG
=
"DramaTabFragment"
}
private
var
dpWidget
:
IDPWidget
?
=
null
...
...
@@ -42,6 +41,8 @@ class DramaTabFragment : BaseFragment() {
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
drama_home_frag_wrapper
private
fun
init
()
{
videoPresenter
.
attachView
(
this
)
if
(
isInited
)
{
return
}
...
...
@@ -57,15 +58,16 @@ class DramaTabFragment : BaseFragment() {
return
}
val
dramaDetailConfig
=
DPDramaDetailConfig
.
obtain
(
DPDramaDetailConfig
.
COMMON_DETAIL
)
.
freeSet
(
FREE_SET
)
.
lockSet
(
LOCK_SET
)
val
dramaDetailConfig
=
DPDramaDetailConfig
.
obtain
(
DPDramaDetailConfig
.
SPECIFIC_DETAIL
)
.
setEnterDelegate
{
context
,
drama
,
current
->
DramaApiDetailActivity
.
outerDrama
=
drama
videoPresenter
.
getIndexList
(
""
+
drama
.
id
,
true
)
}
.
hideMore
(
false
)
.
hideLeftTopTips
(
false
,
null
)
.
listener
(
dramaListener
)
// 短剧详情页视频播放回调
.
adListener
(
dramaAdListener
)
// 短剧详情页激励视频回调
dpWidget
=
DPSdk
.
factory
().
createDraw
(
DPWidgetDrawParams
.
obtain
()
.
adOffset
(
0
)
//单位 dp,为 0 时可以不设置
...
...
@@ -338,5 +340,41 @@ class DramaTabFragment : BaseFragment() {
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
videoPresenter
.
detachView
()
}
override
fun
getIndexListSuc
(
indexList
:
IndexList
)
{
LocalVedioManager
.
startVedioDetailActivityForType
(
requireActivity
(),
indexList
.
vedioMsg
,
true
,
isThirdId
=
true
)
}
override
fun
getIndexListFail
()
{
showToast
(
"网络错误!"
)
}
override
fun
collectSuc
()
{
}
override
fun
collectFail
()
{
}
override
fun
cancelCollectSuc
()
{
}
override
fun
cancelCollectFail
()
{
}
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
}
override
fun
unlockFail
()
{
}
}
\ No newline at end of file
video/app/src/main/java/com/mints/wisdomclean/video/RecommendVideoAdapter.kt
View file @
f8b20b46
...
...
@@ -14,6 +14,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
import
com.mints.wisdomclean.MintsApplication
import
com.mints.wisdomclean.R
import
com.mints.wisdomclean.mvp.model.VedioBean
/**
* author : ChenWenJie
...
...
@@ -22,15 +23,15 @@ import com.mints.wisdomclean.R
* desc : 适配器
*/
class
RecommendVideoAdapter
(
var
activity
:
Activity
)
:
BaseQuickAdapter
<
V
ide
oBean
,
BaseViewHolder
>(
R
.
layout
.
item_video_recommend
)
{
BaseQuickAdapter
<
V
edi
oBean
,
BaseViewHolder
>(
R
.
layout
.
item_video_recommend
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
V
ide
oBean
)
{
override
fun
convert
(
holder
:
BaseViewHolder
,
item
:
V
edi
oBean
)
{
//用户名
holder
.
setText
(
R
.
id
.
username_tv
,
item
.
user_nam
e
)
holder
.
setText
(
R
.
id
.
username_tv
,
item
.
titl
e
)
//标题
holder
.
setText
(
R
.
id
.
usertitle_tv
,
item
.
video_title
)
holder
.
setText
(
R
.
id
.
usertitle_tv
,
"第"
+
item
.
recommendIndex
+
"集"
)
//缩略图
Glide
.
with
(
activity
).
load
(
item
.
video_i
mage
)
Glide
.
with
(
activity
).
load
(
item
.
coverI
mage
)
.
into
(
holder
.
getView
<
JzvdStdTikTok
>(
R
.
id
.
jz_video
).
posterImageView
)
var
isPlay
=
false
...
...
@@ -49,11 +50,11 @@ class RecommendVideoAdapter(var activity: Activity) :
if
(
holder
.
layoutPosition
+
1
<
itemCount
)
{
val
item1
=
getItem
(
holder
.
layoutPosition
+
1
)
//缓存下一个 10秒
proxy
!!
.
preLoad
(
item1
.
video_path
,
10
)
proxy
!!
.
preLoad
(
item1
.
recommendUrl
,
10
)
}
//缓存当前,播放当前
val
proxyUrl
=
proxy
?.
getProxyUrl
(
item
.
video_path
).
toString
()
//设置视
val
proxyUrl
=
proxy
?.
getProxyUrl
(
item
.
recommendUrl
).
toString
()
//设置视
setPlay
(
holder
.
getView
(
R
.
id
.
jz_video
),
proxyUrl
)
}
...
...
video/app/src/main/java/com/mints/wisdomclean/video/VideoActivity.kt
View file @
f8b20b46
...
...
@@ -45,18 +45,24 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
var
mVedioBean
:
VedioBean
?
=
null
private
var
indexBean
:
IndexList
?
=
null
private
var
isPlayNext
=
false
private
var
playIndex
=
1
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_video
override
fun
initViewsAndEvents
()
{
videoPresenter
.
attachView
(
this
)
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
""
+
it
.
vedioId
)
}
if
(
isPlayNext
)
{
playIndex
=
mVedioBean
!!
.
recommendIndex
}
initView
()
}
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
val
json
=
extras
?.
getString
(
Constant
.
VEDIO_BEAN
)
isPlayNext
=
extras
?.
getBoolean
(
Constant
.
VEDIO_NEXT
,
false
)
==
true
mVedioBean
=
Gson
().
fromJson
(
json
,
VedioBean
::
class
.
java
)
super
.
getBundleExtras
(
extras
)
...
...
@@ -98,8 +104,6 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
adapter
.
setNewInstance
(
getAdapterData
())
val
emptyView
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
item_empty_video
,
null
)
adapter
.
setEmptyView
(
emptyView
)
//指定位置其他页面跳转过来。直接定位指定posion 这里不需要。
// recy.scrollToPosition(postion);
adapter
.
setOnCustomChildClickListener
(
this
)
adapter
.
setOnVideoCompletion
(
object
:
JzvdStdTikTok
.
OnVideoCompletion
{
...
...
@@ -217,12 +221,19 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override
fun
getIndexListSuc
(
indexList
:
IndexList
)
{
indexBean
=
indexList
mVedioBean
=
indexList
.
vedioMsg
indexBean
=
indexList
videos
.
clear
()
videos
.
addAll
(
indexList
.
list
)
adapter
.
setNewInstance
(
getAdapterData
())
adapter
.
notifyDataSetChanged
()
// 处理推荐页跳转自动播放下一集逻辑
if
(!
isPlayNext
)
{
playIndex
=
mVedioBean
!!
.
seeIndex
-
1
}
mCurrentPosition
=
playIndex
recy
.
scrollToPosition
(
playIndex
)
}
override
fun
getIndexListFail
()
{
...
...
@@ -245,6 +256,7 @@ class VideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
override
fun
unlockSuc
(
indexList
:
IndexList
)
{
dialog
?.
changeLockStatus
(
videos
.
size
)
videos
.
addAll
(
indexList
.
list
)
adapter
.
setNewInstance
(
getAdapterData
())
adapter
.
notifyDataSetChanged
()
...
...
video/app/src/main/java/com/mints/wisdomclean/video/VideoAdapter.kt
View file @
f8b20b46
...
...
@@ -4,6 +4,7 @@ import android.util.Log
import
android.view.View
import
android.widget.Button
import
android.widget.LinearLayout
import
android.widget.TextView
import
cn.jzvd.Jzvd
import
cn.jzvd.JzvdStd
import
com.airbnb.lottie.LottieAnimationView
...
...
@@ -46,6 +47,7 @@ class VideoAdapter(private var vedioBean: VedioBean) :
holder
.
getView
<
View
>(
R
.
id
.
vip
).
setOnClickListener
{
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
,
holder
.
adapterPosition
)
}
holder
.
getView
<
TextView
>(
R
.
id
.
unlock
).
text
=
"看广告解锁"
+
vedioBean
!!
.
adGiveVedioNum
+
"集"
holder
.
getView
<
View
>(
R
.
id
.
leave
).
visibility
=
View
.
GONE
holder
.
getView
<
View
>(
R
.
id
.
leave
).
setOnClickListener
{
mOnCustomChildClickListener
?.
onCustomChildClick
(
it
,
holder
.
adapterPosition
)
...
...
@@ -57,7 +59,7 @@ class VideoAdapter(private var vedioBean: VedioBean) :
private
fun
initVideoHolder
(
holder
:
BaseViewHolder
,
item
:
VideoMultiItemEntity
)
{
//标题
holder
.
setText
(
R
.
id
.
title_tv
,
item
.
video
.
title
)
holder
.
setText
(
R
.
id
.
title_tv
,
vedioBean
.
title
)
//介绍
holder
.
setText
(
R
.
id
.
info_tv
,
"第"
+
item
.
video
.
vedioIndex
+
"集"
)
//收藏数量
...
...
video/app/src/main/res/layout/drama_activity_api_detail.xml
View file @
f8b20b46
...
...
@@ -138,8 +138,8 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:background=
"#10ffffff"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
...
...
@@ -168,10 +168,8 @@
</LinearLayout>
</FrameLayout>
<ImageView
android:id=
"@+id/leave"
android:layout_width=
"wrap_content"
...
...
video/app/src/main/res/layout/item_empty_video.xml
View file @
f8b20b46
...
...
@@ -4,6 +4,10 @@
android:layout_height=
"match_parent"
android:background=
"#99000000"
>
<View
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
video/app/src/main/res/layout/item_follow.xml
View file @
f8b20b46
...
...
@@ -2,12 +2,13 @@
<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=
"match_parent"
android:layout_height=
"
18
0dp"
>
android:layout_height=
"
24
0dp"
>
<ImageView
android:id=
"@+id/image_iv"
android:layout_width=
"100dp"
android:layout_height=
"120dp"
android:layout_width=
"106dp"
android:layout_height=
"180dp"
android:scaleType=
"fitXY"
android:src=
"@mipmap/ic_launcher_main"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
...
...
@@ -18,7 +19,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"6dp"
android:layout_marginBottom=
"
10
dp"
android:layout_marginBottom=
"
4
dp"
android:text=
"已完结"
android:textColor=
"@color/white"
app:layout_constraintBottom_toBottomOf=
"@id/image_iv"
...
...
@@ -26,9 +27,11 @@
<TextView
android:id=
"@+id/title_tv"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
106dp
"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"10dp"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
"重回80年代"
android:textColor=
"@color/black"
app:layout_constraintStart_toStartOf=
"@id/image_iv"
...
...
@@ -36,9 +39,11 @@
<TextView
android:id=
"@+id/info_tv"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
106dp
"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"4dp"
android:ellipsize=
"end"
android:maxLines=
"1"
android:text=
"重回80年代"
android:textColor=
"@color/gray"
android:textSize=
"12sp"
...
...
@@ -47,8 +52,8 @@
<FrameLayout
android:id=
"@+id/fm_mask"
android:layout_width=
"10
0
dp"
android:layout_height=
"
18
0dp"
android:layout_width=
"10
6
dp"
android:layout_height=
"
24
0dp"
android:background=
"@drawable/shape_half_trans2"
app:layout_constraintEnd_toEndOf=
"@id/image_iv"
app:layout_constraintStart_toStartOf=
"@id/image_iv"
...
...
@@ -63,7 +68,7 @@
android:button=
"@null"
android:drawableEnd=
"@drawable/selector_cb"
android:paddingEnd=
"6dp"
android:paddingBottom=
"1
40
dp"
/>
android:paddingBottom=
"1
96
dp"
/>
</FrameLayout>
...
...
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