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
3c930a51
Commit
3c930a51
authored
Jul 28, 2023
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
f0bcc351
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
32 deletions
+49
-32
ExpressManager.kt
...ain/java/com/mints/helivideo/ad/express/ExpressManager.kt
+1
-5
AboutusActivity.kt
.../java/com/mints/helivideo/ui/activitys/AboutusActivity.kt
+0
-1
TxVideoActivity.kt
...rc/main/java/com/mints/helivideo/video/TxVideoActivity.kt
+44
-25
SuperShortVideoView.java
...ava/com/mints/helivideo/video/tx/SuperShortVideoView.java
+4
-0
TxVideoAdapter.kt
...va/com/mints/helivideo/video/tx/adapter/TxVideoAdapter.kt
+0
-1
No files found.
video/app/src/main/java/com/mints/helivideo/ad/express/ExpressManager.kt
View file @
3c930a51
...
@@ -99,10 +99,7 @@ class ExpressManager {
...
@@ -99,10 +99,7 @@ class ExpressManager {
* 2:如果是信息流自渲染广告,设置广告图片期望的图片宽高 ,不能为0
* 2:如果是信息流自渲染广告,设置广告图片期望的图片宽高 ,不能为0
* 2:如果是信息流模板广告,宽度设置为希望的宽度,高度设置为0(0为高度选择自适应参数)
* 2:如果是信息流模板广告,宽度设置为希望的宽度,高度设置为0(0为高度选择自适应参数)
*/
*/
.
setImageAcceptedSize
(
.
setImageAcceptedSize
(
UIUtils
.
getAdWidth
(
activity
).
toInt
(),
0
)
UIUtils
.
getAdWidth
(
activity
).
toInt
(),
0
)
.
setAdCount
(
1
)
//请求广告数量为1到3条 (优先采用平台配置的数量)
.
setAdCount
(
1
)
//请求广告数量为1到3条 (优先采用平台配置的数量)
.
build
()
.
build
()
...
@@ -166,7 +163,6 @@ class ExpressManager {
...
@@ -166,7 +163,6 @@ class ExpressManager {
}
}
fun
getAdView
(
callback
:
ExpressAdCallback
?)
{
fun
getAdView
(
callback
:
ExpressAdCallback
?)
{
val
isOversped
=
TimeRender
.
isOverspedMin
(
adLoadTime
,
AdManager
.
AD_NO_SHOWTIME_OUT
)
val
isOversped
=
TimeRender
.
isOverspedMin
(
adLoadTime
,
AdManager
.
AD_NO_SHOWTIME_OUT
)
// 若上一个广告还在加载中则返回
// 若上一个广告还在加载中则返回
if
(
isLoadSuccess
==
1
)
{
if
(
isLoadSuccess
==
1
)
{
...
...
video/app/src/main/java/com/mints/helivideo/ui/activitys/AboutusActivity.kt
View file @
3c930a51
...
@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
...
@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import
android.os.Bundle
import
android.os.Bundle
import
android.util.Log
import
android.util.Log
import
android.view.View
import
android.view.View
import
android.widget.ImageView
import
android.widget.TextView
import
android.widget.TextView
import
android.widget.Toast
import
android.widget.Toast
import
com.bytedance.hume.readapk.HumeSDK
import
com.bytedance.hume.readapk.HumeSDK
...
...
video/app/src/main/java/com/mints/helivideo/video/TxVideoActivity.kt
View file @
3c930a51
...
@@ -117,16 +117,16 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -117,16 +117,16 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
super_short_video_view
.
setOnPageChangeListener
{
super_short_video_view
.
setOnPageChangeListener
{
if
(
super_short_video_view
.
isAdPosition
(
it
))
{
if
(
super_short_video_view
.
isAdPosition
(
it
))
{
fm_bottom
.
visibility
=
View
.
GONE
fm_bottom
.
visibility
=
View
.
GONE
ll_lucky
.
visibility
=
View
.
GONE
super_short_video_view
.
pause
()
super_short_video_view
.
pause
()
return
@setOnPageChangeListener
return
@setOnPageChangeListener
}
}
fm_bottom
.
visibility
=
View
.
VISIBLE
fm_bottom
.
visibility
=
View
.
VISIBLE
val
readPosition
=
getRealPosition
(
it
)
val
readIndex
=
getRealIndex
(
it
)
showVipCountDialog
(
readIndex
)
showVipCountDialog
(
readPosition
)
localShowLucky
(
readIndex
)
localShowLucky
(
readPosition
)
// VIdeoindex -> seeIndex
// VIdeoindex -> seeIndex
val
data
=
super_short_video_view
.
data
val
data
=
super_short_video_view
.
data
...
@@ -261,16 +261,12 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -261,16 +261,12 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
return
return
}
}
val
readPosition
=
getRealPosition
(
position
)
val
readPosition
=
getRealPosition
(
position
+
1
)
if
(
readPosition
!=
position
)
{
super_short_video_view
.
pause
()
}
super_short_video_view
.
onItemClick
(
readPosition
)
super_short_video_view
.
onItemClick
(
readPosition
)
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
Handler
(
Looper
.
getMainLooper
()).
postDelayed
({
showVipCountDialog
(
readPosition
)
showVipCountDialog
(
position
+
1
)
localShowLucky
(
readPosition
)
localShowLucky
(
position
+
1
)
},
300
)
},
300
)
}
}
...
@@ -361,10 +357,14 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -361,10 +357,14 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
}
}
private
fun
showVipCountDialog
(
position
:
Int
)
{
/**
* @param index 当前下标的集数
*/
private
fun
showVipCountDialog
(
index
:
Int
)
{
if
(
isFinishing
)
return
if
(
isFinishing
)
return
if
(
position
==
0
||
mVedioBean
!!
.
tipMaxIndex
==
0
||
mVedioBean
!!
.
tipMaxIndex
-
1
<
position
)
{
if
(
mVedioBean
!!
.
tipMaxIndex
==
0
||
index
==
1
||
mVedioBean
!!
.
tipMaxIndex
<
index
||
index
>
mVedioBean
!!
.
unlockIndex
)
{
return
return
}
}
...
@@ -376,21 +376,25 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -376,21 +376,25 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
private
fun
localShowLucky
(
position
:
Int
)
{
/**
* @param index 当前下标的集数
*/
private
fun
localShowLucky
(
index
:
Int
)
{
val
localLucky
=
AppPreferencesManager
.
get
()
val
localLucky
=
AppPreferencesManager
.
get
()
.
getBoolean
(
Constant
.
LUCKY_FLAG
,
false
)
.
getBoolean
(
Constant
.
LUCKY_FLAG
,
false
)
val
data
=
super_short_video_view
.
data
if
(
UserManager
.
getInstance
().
vipFlag
)
{
ll_lucky
.
visibility
=
View
.
GONE
return
}
if
(
mVedioBean
!=
null
&&
(
isLuckyShow
||
localLucky
))
{
if
(
mVedioBean
!=
null
&&
(
isLuckyShow
||
localLucky
))
{
// if (position > mVedioBean!!.unlockIndex - 1) {
if
(
index
>
mVedioBean
!!
.
unlockIndex
)
{
if
(
data
[
position
].
itemType
!=
MULTI_ITEM_1
||
UserManager
.
getInstance
().
vipFlag
||
position
>
mVedioBean
!!
.
unlockIndex
-
1
)
{
// 解锁界面
// 解锁界面
ll_lucky
.
visibility
=
View
.
GONE
ll_lucky
.
visibility
=
View
.
GONE
}
else
{
}
else
{
// 超过免费剧
// 超过免费剧
if
(
position
>=
mVedioBean
!!
.
freeIndex
)
{
if
(
index
>
mVedioBean
!!
.
freeIndex
)
{
ll_lucky
.
visibility
=
View
.
VISIBLE
ll_lucky
.
visibility
=
View
.
VISIBLE
}
else
{
}
else
{
ll_lucky
.
visibility
=
View
.
GONE
ll_lucky
.
visibility
=
View
.
GONE
...
@@ -399,14 +403,29 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
...
@@ -399,14 +403,29 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
}
}
}
// 获取当前下标真正代表的集数
private
fun
getRealIndex
(
position
:
Int
):
Int
{
var
readIndex
=
position
val
data
=
super_short_video_view
.
data
if
(
data
!=
null
&&
data
.
size
>
0
)
{
if
(
data
[
position
].
itemType
==
MULTI_ITEM_1
)
{
readIndex
=
data
[
position
].
video
!!
.
vedioIndex
}
}
return
readIndex
}
// 用于点击匹配当前剧集对应的具体下标
private
fun
getRealPosition
(
position
:
Int
):
Int
{
private
fun
getRealPosition
(
position
:
Int
):
Int
{
var
readPosition
=
position
var
readPosition
=
position
val
data
=
super_short_video_view
.
data
val
data
=
super_short_video_view
.
data
for
(
i
in
0
until
data
.
size
)
{
if
(
data
!=
null
&&
data
.
size
>
0
)
{
if
(
data
[
i
].
itemType
==
MULTI_ITEM_1
)
{
for
(
i
in
0
until
data
.
size
)
{
if
(
data
[
i
].
video
!!
.
vedioIndex
==
position
+
1
)
{
if
(
data
[
i
].
itemType
==
MULTI_ITEM_1
)
{
readPosition
=
i
if
(
data
[
i
].
video
!!
.
vedioIndex
==
position
)
{
break
readPosition
=
i
break
}
}
}
}
}
}
}
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/SuperShortVideoView.java
View file @
3c930a51
...
@@ -118,6 +118,10 @@ public class SuperShortVideoView extends RelativeLayout {
...
@@ -118,6 +118,10 @@ public class SuperShortVideoView extends RelativeLayout {
addAdView
(
position
);
addAdView
(
position
);
onPageSelectedMethod
(
position
);
onPageSelectedMethod
(
position
);
if
(
mCurrentPosition
==
mAdapter
.
getData
().
size
()
-
1
)
{
mAdapter
.
notifyItemChanged
(
mCurrentPosition
);
}
break
;
break
;
case
RecyclerView
.
SCROLL_STATE_DRAGGING
:
//拖动
case
RecyclerView
.
SCROLL_STATE_DRAGGING
:
//拖动
break
;
break
;
...
...
video/app/src/main/java/com/mints/helivideo/video/tx/adapter/TxVideoAdapter.kt
View file @
3c930a51
...
@@ -18,7 +18,6 @@ import com.mints.helivideo.ad.express.ExpressAdCallback
...
@@ -18,7 +18,6 @@ import com.mints.helivideo.ad.express.ExpressAdCallback
import
com.mints.helivideo.ad.express.ExpressManager
import
com.mints.helivideo.ad.express.ExpressManager
import
com.mints.helivideo.manager.UserManager
import
com.mints.helivideo.manager.UserManager
import
com.mints.helivideo.mvp.model.*
import
com.mints.helivideo.mvp.model.*
import
com.mints.helivideo.utils.LogUtil
import
com.mints.helivideo.utils.UIUtils
import
com.mints.helivideo.utils.UIUtils
import
com.mints.helivideo.video.tx.TXVideoBaseView
import
com.mints.helivideo.video.tx.TXVideoBaseView
...
...
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