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
29b09e40
Commit
29b09e40
authored
Jul 19, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
183fe3e1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
9 deletions
+32
-9
IndexList.java
...rc/main/java/com/xinfu/helivideo/mvp/model/IndexList.java
+10
-0
VipCountDialog.kt
...ain/java/com/xinfu/helivideo/ui/widgets/VipCountDialog.kt
+14
-6
DramaApiDetailActivity.kt
.../java/com/xinfu/helivideo/video/DramaApiDetailActivity.kt
+3
-2
TxVideoActivity.kt
...rc/main/java/com/xinfu/helivideo/video/TxVideoActivity.kt
+3
-1
dialog_vip_count.xml
video/app/src/main/res/layout/dialog_vip_count.xml
+2
-0
No files found.
video/app/src/main/java/com/xinfu/helivideo/mvp/model/IndexList.java
View file @
29b09e40
package
com
.
xinfu
.
helivideo
.
mvp
.
model
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
IndexList
implements
Serializable
{
private
VedioBean
vedioMsg
;
private
List
<
VedioEpisodeBean
>
list
;
private
ArrayList
<
String
>
tip
;
public
ArrayList
<
String
>
getTip
()
{
return
tip
;
}
public
void
setTip
(
ArrayList
<
String
>
tip
)
{
this
.
tip
=
tip
;
}
public
VedioBean
getVedioMsg
()
{
return
vedioMsg
;
...
...
video/app/src/main/java/com/xinfu/helivideo/ui/widgets/VipCountDialog.kt
View file @
29b09e40
...
...
@@ -15,7 +15,8 @@ import com.xinfu.helivideo.ui.activitys.VipActivity
import
com.xinfu.helivideo.ui.widgets.countdowntimer.CountDownTimerSupport
import
com.xinfu.helivideo.ui.widgets.countdowntimer.OnCountDownTimerListener
class
VipCountDialog
(
activity
:
Activity
,
vedioBean
:
VedioBean
)
:
Dialog
(
activity
,
R
.
style
.
dialog
)
{
class
VipCountDialog
(
activity
:
Activity
,
vedioBean
:
VedioBean
,
tipList
:
ArrayList
<
String
>?)
:
Dialog
(
activity
,
R
.
style
.
dialog
)
{
private
val
lp
:
WindowManager
.
LayoutParams
var
timer
:
CountDownTimerSupport
?
=
null
...
...
@@ -38,6 +39,8 @@ class VipCountDialog(activity: Activity, vedioBean: VedioBean) : Dialog(activity
val
fm
=
findViewById
<
View
>(
R
.
id
.
fm
)
val
text_count
=
findViewById
<
TextView
>(
R
.
id
.
text_count
)
val
tv_dialog_vip_count_left
=
findViewById
<
TextView
>(
R
.
id
.
tv_dialog_vip_count_left
)
val
tv_dialog_vip_count_right
=
findViewById
<
TextView
>(
R
.
id
.
tv_dialog_vip_count_right
)
timer
=
CountDownTimerSupport
(
3000L
,
1000
)
timer
?.
setOnCountDownTimerListener
(
object
:
OnCountDownTimerListener
{
...
...
@@ -51,12 +54,17 @@ class VipCountDialog(activity: Activity, vedioBean: VedioBean) : Dialog(activity
})
timer
?.
start
()
if
(
tipList
!=
null
&&
tipList
.
size
>=
2
)
{
tv_dialog_vip_count_left
.
text
=
tipList
.
get
(
0
)
tv_dialog_vip_count_right
.
text
=
" ${tipList.get(1)}"
}
fm
.
setOnClickListener
{
val
bundle
=
Bundle
()
bundle
.
putString
(
VipActivity
.
VEDIO_ID
,
vedioBean
.
vedioId
.
toString
())
bundle
.
putString
(
VipActivity
.
THIRD_ID
,
vedioBean
.
thirdId
)
readyGo
(
activity
,
VipActivity
::
class
.
java
,
bundle
)
val
bundle
=
Bundle
()
bundle
.
putString
(
VipActivity
.
VEDIO_ID
,
vedioBean
.
vedioId
.
toString
())
bundle
.
putString
(
VipActivity
.
THIRD_ID
,
vedioBean
.
thirdId
)
readyGo
(
activity
,
VipActivity
::
class
.
java
,
bundle
)
dismiss
()
}
}
...
...
@@ -84,7 +92,7 @@ class VipCountDialog(activity: Activity, vedioBean: VedioBean) : Dialog(activity
}
fun
readyGo
(
activity
:
Activity
,
clazz
:
Class
<
*
>?,
bundle
:
Bundle
?)
{
fun
readyGo
(
activity
:
Activity
,
clazz
:
Class
<
*
>?,
bundle
:
Bundle
?)
{
val
intent
=
Intent
(
activity
,
clazz
)
if
(
null
!=
bundle
)
{
intent
.
putExtras
(
bundle
)
...
...
video/app/src/main/java/com/xinfu/helivideo/video/DramaApiDetailActivity.kt
View file @
29b09e40
...
...
@@ -31,7 +31,6 @@ import com.xinfu.helivideo.ui.adapter.VideoEpisodeAdapter
import
com.xinfu.helivideo.ui.widgets.DialogListener
import
com.xinfu.helivideo.ui.widgets.VideoEpisodeDialog
import
com.xinfu.helivideo.ui.widgets.VipCountDialog
import
com.xinfu.helivideo.utils.LogUtil
import
com.xinfu.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.drama_activity_api_detail.*
import
kotlinx.android.synthetic.main.drama_activity_api_detail.episode_tv
...
...
@@ -64,6 +63,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private
var
dpWidget
:
IDPWidget
?
=
null
private
var
isInited
=
false
private
var
drama
:
DPDrama
?
=
null
private
var
tipList
:
ArrayList
<
String
>?
=
null
private
var
mInitUnlockIndex
=
0
...
...
@@ -521,6 +521,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
override
fun
getIndexListSuc
(
indexList
:
IndexList
)
{
tipList
=
indexList
.
tip
}
override
fun
getIndexListFail
()
{
...
...
@@ -600,7 +601,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private
fun
showVipCountDialog
(
position
:
Int
)
{
if
(
position
==
0
||
mVedioBean
!!
.
tipMaxIndex
==
0
||
mVedioBean
!!
.
tipMaxIndex
-
1
<
position
)
return
VipCountDialog
(
this
,
mVedioBean
!!
)
VipCountDialog
(
this
,
mVedioBean
!!
,
tipList
)
.
setOnDialogDismiss
(
object
:
VipCountDialog
.
OnDialogDismiss
{
override
fun
onDialogDismiss
()
{
...
...
video/app/src/main/java/com/xinfu/helivideo/video/TxVideoActivity.kt
View file @
29b09e40
...
...
@@ -39,6 +39,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
var
mVedioBean
:
VedioBean
?
=
null
private
var
indexBean
:
IndexList
?
=
null
private
var
tipList
:
ArrayList
<
String
>?
=
null
private
var
isPlayNext
=
false
private
var
playIndex
=
1
...
...
@@ -136,6 +137,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
}
if
(
playIndex
>
mVedioBean
!!
.
vedioTotal
)
playIndex
=
0
tipList
=
indexList
.
tip
mVedioBean
=
indexList
.
vedioMsg
indexBean
=
indexList
videos
.
clear
()
...
...
@@ -273,7 +275,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
return
}
VipCountDialog
(
this
,
mVedioBean
!!
)
VipCountDialog
(
this
,
mVedioBean
!!
,
tipList
)
.
setOnDialogDismiss
(
object
:
VipCountDialog
.
OnDialogDismiss
{
override
fun
onDialogDismiss
()
{}
})
...
...
video/app/src/main/res/layout/dialog_vip_count.xml
View file @
29b09e40
...
...
@@ -32,6 +32,7 @@
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_dialog_vip_count_left"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"1分钱"
...
...
@@ -40,6 +41,7 @@
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_dialog_vip_count_right"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
" 签约会员"
...
...
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