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
68056377
Commit
68056377
authored
Jul 20, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
94b36144
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
62 additions
and
8 deletions
+62
-8
Constant.kt
.../app/src/main/java/com/xinfu/helivideo/common/Constant.kt
+1
-0
LocalVedioManager.kt
...ain/java/com/xinfu/helivideo/manager/LocalVedioManager.kt
+10
-3
SplashActivity.kt
...n/java/com/xinfu/helivideo/ui/activitys/SplashActivity.kt
+1
-1
SplashAdActivity.kt
...java/com/xinfu/helivideo/ui/activitys/SplashAdActivity.kt
+1
-1
DramaApiDetailActivity.kt
.../java/com/xinfu/helivideo/video/DramaApiDetailActivity.kt
+24
-1
TxVideoActivity.kt
...rc/main/java/com/xinfu/helivideo/video/TxVideoActivity.kt
+25
-2
No files found.
video/app/src/main/java/com/xinfu/helivideo/common/Constant.kt
View file @
68056377
...
...
@@ -7,6 +7,7 @@ object Constant {
const
val
VEDIO_BEAN
=
"VEDIO_BEAN"
const
val
VEDIO_NEXT
=
"VEDIO_NEXT"
const
val
VEDIO_THIRD
=
"VEDIO_THIRD"
const
val
VEDIO_SPLASH
=
"VEDIO_SPLASH"
/**
* 首次弹出权限声明
...
...
video/app/src/main/java/com/xinfu/helivideo/manager/LocalVedioManager.kt
View file @
68056377
...
...
@@ -86,7 +86,8 @@ object LocalVedioManager {
activity
:
Activity
,
data
:
VedioBean
?,
isPlayNext
:
Boolean
=
false
,
isThirdId
:
Boolean
=
false
isThirdId
:
Boolean
=
false
,
isSplash
:
Boolean
=
false
)
{
if
(
data
?.
createType
==
1
)
{
//自有短剧
...
...
@@ -94,15 +95,18 @@ object LocalVedioManager {
bundle
.
putString
(
Constant
.
VEDIO_BEAN
,
JsonUtil
.
toJson
(
data
))
bundle
.
putBoolean
(
Constant
.
VEDIO_NEXT
,
isPlayNext
)
bundle
.
putBoolean
(
Constant
.
VEDIO_THIRD
,
isThirdId
)
if
(
isSplash
)
{
bundle
.
putBoolean
(
Constant
.
VEDIO_SPLASH
,
true
)
}
// readyGo(activity, VideoActivity::class.java, bundle)
readyGo
(
activity
,
TxVideoActivity
::
class
.
java
,
bundle
)
}
else
{
requestDrama
(
activity
,
data
)
requestDrama
(
activity
,
data
,
isSplash
)
}
}
// 请求穿山甲数据
private
fun
requestDrama
(
activity
:
Activity
,
data
:
VedioBean
?)
{
private
fun
requestDrama
(
activity
:
Activity
,
data
:
VedioBean
?
,
isSplash
:
Boolean
)
{
if
(
DPSdk
.
isStartSuccess
()
&&
data
!=
null
)
{
DPSdk
.
factory
().
requestDrama
(
arrayListOf
(
data
.
thirdId
.
toLong
()),
object
:
IDPWidgetFactory
.
DramaCallback
{
...
...
@@ -119,6 +123,9 @@ object LocalVedioManager {
//穿山甲短剧
val
bundle
=
Bundle
()
bundle
.
putString
(
Constant
.
VEDIO_BEAN
,
JsonUtil
.
toJson
(
data
))
if
(
isSplash
)
{
bundle
.
putBoolean
(
Constant
.
VEDIO_SPLASH
,
true
)
}
readyGo
(
activity
,
DramaApiDetailActivity
::
class
.
java
,
bundle
)
}
...
...
video/app/src/main/java/com/xinfu/helivideo/ui/activitys/SplashActivity.kt
View file @
68056377
...
...
@@ -152,7 +152,7 @@ class SplashActivity : BaseActivity() {
AppPreferencesManager
.
get
().
put
(
Constant
.
IS_FIRST_VEDIO
,
false
)
val
cacheVedio
=
LocalVedioManager
.
getCacheVedio
()
if
(
cacheVedio
!=
null
)
{
LocalVedioManager
.
startVedioDetailActivityForType
(
this
,
cacheVedio
)
LocalVedioManager
.
startVedioDetailActivityForType
(
this
,
cacheVedio
,
isSplash
=
true
)
}
else
{
if
(
UserManager
.
getInstance
().
newFlag
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
// AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
...
...
video/app/src/main/java/com/xinfu/helivideo/ui/activitys/SplashAdActivity.kt
View file @
68056377
...
...
@@ -105,7 +105,7 @@ class SplashAdActivity : BaseActivity() {
AppPreferencesManager
.
get
().
put
(
Constant
.
IS_FIRST_VEDIO
,
false
)
val
cacheVedio
=
LocalVedioManager
.
getCacheVedio
()
if
(
cacheVedio
!=
null
)
{
LocalVedioManager
.
startVedioDetailActivityForType
(
this
,
cacheVedio
)
LocalVedioManager
.
startVedioDetailActivityForType
(
this
,
cacheVedio
,
isSplash
=
true
)
}
else
{
if
(
UserManager
.
getInstance
().
newFlag
&&
!
UserManager
.
getInstance
().
vipFlag
)
{
// AppPreferencesManager.get().put(Constant.IS_FIRST_VIP_BTN, true)
...
...
video/app/src/main/java/com/xinfu/helivideo/video/DramaApiDetailActivity.kt
View file @
68056377
...
...
@@ -3,6 +3,7 @@ package com.xinfu.helivideo.video
import
android.app.Dialog
import
android.os.Bundle
import
android.util.Log
import
android.view.KeyEvent
import
android.view.View
import
android.widget.Button
import
android.widget.ImageView
...
...
@@ -23,6 +24,7 @@ import com.xinfu.helivideo.mvp.model.IndexList
import
com.xinfu.helivideo.mvp.model.VedioBean
import
com.xinfu.helivideo.mvp.presenters.VideoPresenter
import
com.xinfu.helivideo.mvp.views.VideoView
import
com.xinfu.helivideo.ui.activitys.MainActivity
import
com.xinfu.helivideo.ui.activitys.VipActivity
import
com.xinfu.helivideo.ui.activitys.base.BaseActivity
import
com.xinfu.helivideo.ui.adapter.VideoEpisodeAdapter
...
...
@@ -81,6 +83,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
private
var
isThirdId
=
false
private
var
isPlayNext
=
false
private
var
isSplashEnter
=
false
private
var
mode
=
DPDramaDetailConfig
.
SPECIFIC_DETAIL
...
...
@@ -92,6 +96,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
val
json
=
extras
?.
getString
(
Constant
.
VEDIO_BEAN
)
isThirdId
=
extras
?.
getBoolean
(
Constant
.
VEDIO_THIRD
,
false
)
==
true
isPlayNext
=
extras
?.
getBoolean
(
Constant
.
VEDIO_NEXT
,
false
)
==
true
isSplashEnter
=
extras
?.
getBoolean
(
Constant
.
VEDIO_SPLASH
,
false
)
==
true
mVedioBean
=
Gson
().
fromJson
(
json
,
VedioBean
::
class
.
java
)
orderTagsList
=
mVedioBean
?.
orderTags
...
...
@@ -167,7 +173,11 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
.
commit
()
leaveBtn
?.
setOnClickListener
{
finish
()
if
(
isSplashEnter
)
{
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
else
{
finish
()
}
}
vipBtn
?.
setOnClickListener
{
val
bundle
=
Bundle
()
...
...
@@ -180,6 +190,19 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
isInited
=
true
}
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
?):
Boolean
{
when
(
keyCode
)
{
KeyEvent
.
KEYCODE_BACK
->
{
if
(
isSplashEnter
)
{
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
else
{
finish
()
}
}
}
return
true
}
private
fun
initWidget
()
{
drama
?.
let
{
drama
->
dpWidget
=
DPSdk
.
factory
().
createDramaDetail
(
...
...
video/app/src/main/java/com/xinfu/helivideo/video/TxVideoActivity.kt
View file @
68056377
...
...
@@ -4,6 +4,7 @@ import android.app.Dialog
import
android.os.Bundle
import
android.os.Handler
import
android.os.Looper
import
android.view.KeyEvent
import
android.view.View
import
com.google.gson.Gson
import
com.xinfu.helivideo.R
...
...
@@ -12,12 +13,14 @@ import com.xinfu.helivideo.ad.AdStatusListener
import
com.xinfu.helivideo.ad.NoPreAdManager
import
com.xinfu.helivideo.common.Constant
import
com.xinfu.helivideo.manager.LocalVedioManager
import
com.xinfu.helivideo.manager.UserManager
import
com.xinfu.helivideo.mvp.model.IndexList
import
com.xinfu.helivideo.mvp.model.IndexList.VedioEpisodeBean
import
com.xinfu.helivideo.mvp.model.VedioBean
import
com.xinfu.helivideo.mvp.model.VideoMultiItemEntity
import
com.xinfu.helivideo.mvp.presenters.VideoPresenter
import
com.xinfu.helivideo.mvp.views.VideoView
import
com.xinfu.helivideo.ui.activitys.MainActivity
import
com.xinfu.helivideo.ui.activitys.VipActivity
import
com.xinfu.helivideo.ui.activitys.base.BaseActivity
import
com.xinfu.helivideo.ui.adapter.VideoEpisodeAdapter
...
...
@@ -27,6 +30,7 @@ import com.xinfu.helivideo.ui.widgets.VipCountDialog
import
com.xinfu.helivideo.video.tx.adapter.TxVideoAdapter
import
com.xinfu.library.utils.nodoubleclick.AntiShake
import
kotlinx.android.synthetic.main.activity_tx_video.*
import
kotlinx.android.synthetic.main.activity_vip.*
class
TxVideoActivity
:
BaseActivity
(),
View
.
OnClickListener
,
VideoView
,
VideoEpisodeAdapter
.
OnEpisodeClickListener
,
TxVideoAdapter
.
OnCustomChildClickListener
{
...
...
@@ -43,6 +47,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
private
var
orderTagsList
:
ArrayList
<
String
>?
=
null
private
var
isPlayNext
=
false
private
var
isSplashEnter
=
false
private
var
playIndex
=
1
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_tx_video
...
...
@@ -56,6 +61,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
val
json
=
extras
?.
getString
(
Constant
.
VEDIO_BEAN
)
isPlayNext
=
extras
?.
getBoolean
(
Constant
.
VEDIO_NEXT
,
false
)
==
true
isSplashEnter
=
extras
?.
getBoolean
(
Constant
.
VEDIO_SPLASH
,
false
)
==
true
mVedioBean
=
Gson
().
fromJson
(
json
,
VedioBean
::
class
.
java
)
orderTagsList
=
mVedioBean
?.
orderTags
super
.
getBundleExtras
(
extras
)
...
...
@@ -94,7 +100,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
// VIdeoindex -> seeIndex
if
(
videos
.
size
>
it
)
{
mVedioBean
!!
.
seeIndex
=
videos
[
it
].
vedioIndex
mVedioBean
!!
.
orderTags
=
orderTagsList
mVedioBean
!!
.
orderTags
=
orderTagsList
LocalVedioManager
.
commitVedio
(
mVedioBean
!!
)
}
}
...
...
@@ -103,11 +109,28 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
close_iv
.
setOnClickListener
(
this
)
}
override
fun
onKeyDown
(
keyCode
:
Int
,
event
:
KeyEvent
?):
Boolean
{
when
(
keyCode
)
{
KeyEvent
.
KEYCODE_BACK
->
{
if
(
isSplashEnter
)
{
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
else
{
finish
()
}
}
}
return
true
}
override
fun
onClick
(
v
:
View
?)
{
if
(
AntiShake
.
check
(
v
?.
id
))
return
when
(
v
?.
id
)
{
R
.
id
.
close_iv
->
{
finish
()
if
(
isSplashEnter
)
{
readyGoThenKill
(
MainActivity
::
class
.
java
)
}
else
{
finish
()
}
}
R
.
id
.
fm_bottom
->
{
showEpisodeDialog
()
...
...
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