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
7e4d8377
Commit
7e4d8377
authored
Dec 05, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
7c416055
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
89 additions
and
23 deletions
+89
-23
AppConfig.java
...rc/main/java/com/duben/speedplaylet/common/AppConfig.java
+1
-0
LocalVedioManager.kt
.../java/com/duben/speedplaylet/manager/LocalVedioManager.kt
+5
-3
TrackManager.java
...ain/java/com/duben/speedplaylet/manager/TrackManager.java
+6
-0
RecommendBannerList.java
...com/duben/speedplaylet/mvp/model/RecommendBannerList.java
+16
-0
RecommendBannerPresenter.kt
...n/speedplaylet/mvp/presenters/RecommendBannerPresenter.kt
+8
-3
TrackPresenter.java
...com/duben/speedplaylet/mvp/presenters/TrackPresenter.java
+32
-9
RecommendBannerView.kt
...a/com/duben/speedplaylet/mvp/views/RecommendBannerView.kt
+2
-5
LoanService.java
...src/main/java/com/duben/speedplaylet/net/LoanService.java
+14
-0
RecommendBannerActivity.kt
...uben/speedplaylet/ui/activitys/RecommendBannerActivity.kt
+2
-1
SplashActivity.kt
...ava/com/duben/speedplaylet/ui/activitys/SplashActivity.kt
+1
-1
item_banner_vip.xml
video/app/src/main/res/layout/item_banner_vip.xml
+1
-0
item_rv_vip.xml
video/app/src/main/res/layout/item_rv_vip.xml
+1
-1
No files found.
video/app/src/main/java/com/duben/speedplaylet/common/AppConfig.java
View file @
7e4d8377
...
@@ -16,6 +16,7 @@ public class AppConfig {
...
@@ -16,6 +16,7 @@ public class AppConfig {
* app应用首页 0-主页 1-position 2-我
* app应用首页 0-主页 1-position 2-我
*/
*/
public
static
int
fragmentClickFlag
=
0
;
public
static
int
fragmentClickFlag
=
0
;
public
static
int
vedioId
=
0
;
// 退出登录首页刷新
// 退出登录首页刷新
public
static
boolean
exitLoginMainRefresh
=
false
;
public
static
boolean
exitLoginMainRefresh
=
false
;
...
...
video/app/src/main/java/com/duben/speedplaylet/manager/LocalVedioManager.kt
View file @
7e4d8377
...
@@ -9,6 +9,7 @@ import com.bytedance.sdk.dp.DPSdk
...
@@ -9,6 +9,7 @@ import com.bytedance.sdk.dp.DPSdk
import
com.bytedance.sdk.dp.IDPWidgetFactory
import
com.bytedance.sdk.dp.IDPWidgetFactory
import
com.duben.speedplaylet.ad.express.ExpressManager
import
com.duben.speedplaylet.ad.express.ExpressManager
import
com.duben.library.utils.json.JsonUtil
import
com.duben.library.utils.json.JsonUtil
import
com.duben.speedplaylet.common.AppConfig
import
com.duben.speedplaylet.common.Constant
import
com.duben.speedplaylet.common.Constant
import
com.duben.speedplaylet.mvp.model.VedioBean
import
com.duben.speedplaylet.mvp.model.VedioBean
import
com.duben.speedplaylet.utils.AppPreferencesManager
import
com.duben.speedplaylet.utils.AppPreferencesManager
...
@@ -28,6 +29,7 @@ object LocalVedioManager {
...
@@ -28,6 +29,7 @@ object LocalVedioManager {
* 提交当前视频数据
* 提交当前视频数据
*/
*/
fun
commitVedio
(
data
:
VedioBean
)
{
fun
commitVedio
(
data
:
VedioBean
)
{
AppConfig
.
vedioId
=
data
.
vedioId
cacheVedio
(
data
)
cacheVedio
(
data
)
TrackManager
.
getInstance
().
commitVedio
(
data
)
TrackManager
.
getInstance
().
commitVedio
(
data
)
}
}
...
@@ -106,13 +108,13 @@ object LocalVedioManager {
...
@@ -106,13 +108,13 @@ object LocalVedioManager {
bundle
.
putBoolean
(
Constant
.
VEDIO_NEXT
,
isPlayNext
)
bundle
.
putBoolean
(
Constant
.
VEDIO_NEXT
,
isPlayNext
)
bundle
.
putBoolean
(
Constant
.
VEDIO_THIRD
,
isThirdId
)
bundle
.
putBoolean
(
Constant
.
VEDIO_THIRD
,
isThirdId
)
readyGo
(
activity
,
TxVideoActivity
::
class
.
java
,
bundle
)
readyGo
(
activity
,
TxVideoActivity
::
class
.
java
,
bundle
)
}
else
if
(
data
?.
createType
==
3
)
{
}
else
if
(
data
?.
createType
==
2
)
{
requestDrama
(
activity
,
data
)
}
else
{
//推荐短剧
//推荐短剧
val
bundle
=
Bundle
()
val
bundle
=
Bundle
()
bundle
.
putString
(
Constant
.
VEDIO_BEAN
,
JsonUtil
.
toJson
(
data
))
bundle
.
putString
(
Constant
.
VEDIO_BEAN
,
JsonUtil
.
toJson
(
data
))
readyGo
(
activity
,
NewTxVideoActivity
::
class
.
java
,
bundle
)
readyGo
(
activity
,
NewTxVideoActivity
::
class
.
java
,
bundle
)
}
else
{
requestDrama
(
activity
,
data
)
}
}
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
if
(!
UserManager
.
getInstance
().
vipFlag
)
{
...
...
video/app/src/main/java/com/duben/speedplaylet/manager/TrackManager.java
View file @
7e4d8377
...
@@ -41,6 +41,12 @@ public class TrackManager {
...
@@ -41,6 +41,12 @@ public class TrackManager {
}
}
}
}
public
void
firstShowVedio
()
{
if
(
trackPresenter
!=
null
)
{
trackPresenter
.
firstShowVedio
();
}
}
public
void
commitVedio
(
VedioBean
data
)
{
public
void
commitVedio
(
VedioBean
data
)
{
if
(
trackPresenter
!=
null
)
{
if
(
trackPresenter
!=
null
)
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
...
...
video/app/src/main/java/com/duben/speedplaylet/mvp/model/RecommendBannerList.java
0 → 100644
View file @
7e4d8377
package
com
.
duben
.
speedplaylet
.
mvp
.
model
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
RecommendBannerList
implements
Serializable
{
private
List
<
VedioBean
>
vedio4
;
public
List
<
VedioBean
>
getList
()
{
return
vedio4
;
}
public
void
setList
(
List
<
VedioBean
>
list
)
{
this
.
vedio4
=
list
;
}
}
video/app/src/main/java/com/duben/speedplaylet/mvp/presenters/RecommendBannerPresenter.kt
View file @
7e4d8377
...
@@ -2,17 +2,22 @@ package com.duben.speedplaylet.mvp.presenters
...
@@ -2,17 +2,22 @@ package com.duben.speedplaylet.mvp.presenters
import
com.duben.library.net.neterror.BaseSubscriber
import
com.duben.library.net.neterror.BaseSubscriber
import
com.duben.library.net.neterror.Throwable
import
com.duben.library.net.neterror.Throwable
import
com.duben.speedplaylet.common.AppConfig
import
com.duben.speedplaylet.manager.AppHttpManager
import
com.duben.speedplaylet.manager.AppHttpManager
import
com.duben.speedplaylet.mvp.model.BannerList
import
com.duben.speedplaylet.mvp.model.BannerList
import
com.duben.speedplaylet.mvp.model.BaseResponse
import
com.duben.speedplaylet.mvp.model.BaseResponse
import
com.duben.speedplaylet.mvp.model.RecommendBannerList
import
com.duben.speedplaylet.mvp.views.RecommendBannerView
import
com.duben.speedplaylet.mvp.views.RecommendBannerView
import
java.util.HashMap
class
RecommendBannerPresenter
:
BasePresenter
<
RecommendBannerView
>()
{
class
RecommendBannerPresenter
:
BasePresenter
<
RecommendBannerView
>()
{
fun
orders
()
{
fun
orders
()
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"vedioId"
]
=
AppConfig
.
vedioId
AppHttpManager
.
getInstance
(
loanApplication
)
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
orders
(
),
.
call
(
loanService
.
vedio4Msg
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
BannerList
>>()
{
object
:
BaseSubscriber
<
BaseResponse
<
Recommend
BannerList
>>()
{
override
fun
onCompleted
()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
if
(
isLinkView
)
return
}
}
...
@@ -21,7 +26,7 @@ class RecommendBannerPresenter : BasePresenter<RecommendBannerView>() {
...
@@ -21,7 +26,7 @@ class RecommendBannerPresenter : BasePresenter<RecommendBannerView>() {
if
(
isLinkView
)
return
if
(
isLinkView
)
return
}
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
BannerList
>)
{
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Recommend
BannerList
>)
{
if
(
isLinkView
)
return
if
(
isLinkView
)
return
val
code
=
baseResponse
.
status
val
code
=
baseResponse
.
status
...
...
video/app/src/main/java/com/duben/speedplaylet/mvp/presenters/TrackPresenter.java
View file @
7e4d8377
package
com
.
duben
.
speedplaylet
.
mvp
.
presenters
;
package
com
.
duben
.
speedplaylet
.
mvp
.
presenters
;
import
android.content.Context
;
import
android.content.Context
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.util.Log
;
import
android.util.Log
;
import
com.google.gson.JsonObject
;
import
com.duben.speedplaylet.common.Constant
;
import
com.duben.speedplaylet.manager.LocalVedioManager
;
import
com.duben.speedplaylet.mvp.model.IndexList
;
import
com.duben.speedplaylet.mvp.model.VedioBean
;
import
com.duben.speedplaylet.utils.AppPreferencesManager
;
import
com.duben.library.net.neterror.BaseSubscriber
;
import
com.duben.library.net.neterror.BaseSubscriber
;
import
com.duben.library.net.neterror.Throwable
;
import
com.duben.library.net.neterror.Throwable
;
import
com.duben.speedplaylet.MintsApplication
;
import
com.duben.speedplaylet.MintsApplication
;
import
com.duben.speedplaylet.common.AppConfig
;
import
com.duben.speedplaylet.common.DeviceInfo
;
import
com.duben.speedplaylet.common.DeviceInfo
;
import
com.duben.speedplaylet.manager.AppHttpManager
;
import
com.duben.speedplaylet.manager.AppHttpManager
;
import
com.duben.speedplaylet.manager.UserManager
;
import
com.duben.speedplaylet.manager.UserManager
;
import
com.duben.speedplaylet.mvp.model.BaseResponse
;
import
com.duben.speedplaylet.mvp.model.BaseResponse
;
import
com.duben.speedplaylet.mvp.model.UserBean
;
import
com.duben.speedplaylet.mvp.model.UserBean
;
import
com.duben.speedplaylet.utils.DeviceUuidFactory
;
import
com.duben.speedplaylet.utils.DeviceUuidFactory
;
import
com.google.gson.JsonObject
;
import
java.util.HashMap
;
import
java.util.HashMap
;
...
@@ -48,7 +42,7 @@ public class TrackPresenter extends BaseTrackPresenter {
...
@@ -48,7 +42,7 @@ public class TrackPresenter extends BaseTrackPresenter {
case
200
:
{
case
200
:
{
UserManager
.
getInstance
().
saveUserInfo
(
baseResponse
.
getData
());
UserManager
.
getInstance
().
saveUserInfo
(
baseResponse
.
getData
());
getMyInf
o
();
firstShowVedi
o
();
saveTerminalInfo
();
saveTerminalInfo
();
}
}
...
@@ -227,4 +221,33 @@ public class TrackPresenter extends BaseTrackPresenter {
...
@@ -227,4 +221,33 @@ public class TrackPresenter extends BaseTrackPresenter {
});
});
}
}
public
void
firstShowVedio
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
firstShowVedio
(),
new
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
JsonObject
>
baseResponse
)
{
switch
(
baseResponse
.
getStatus
())
{
case
200
:
{
try
{
JsonObject
data
=
baseResponse
.
getData
();
AppConfig
.
showVipVedio
=
data
.
get
(
"canShowVedio4"
).
getAsBoolean
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
});
}
}
}
video/app/src/main/java/com/duben/speedplaylet/mvp/views/RecommendBannerView.kt
View file @
7e4d8377
package
com.duben.speedplaylet.mvp.views
package
com.duben.speedplaylet.mvp.views
import
com.duben.speedplaylet.mvp.model.BannerList
import
com.duben.speedplaylet.mvp.model.*
import
com.duben.speedplaylet.mvp.model.UserBean
import
com.duben.speedplaylet.mvp.model.VipBean
import
com.duben.speedplaylet.mvp.model.WxPayParamBean
interface
RecommendBannerView
:
BaseView
{
interface
RecommendBannerView
:
BaseView
{
fun
ordersSuc
(
data
:
BannerList
?)
fun
ordersSuc
(
data
:
Recommend
BannerList
?)
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/speedplaylet/net/LoanService.java
View file @
7e4d8377
...
@@ -3,6 +3,7 @@ package com.duben.speedplaylet.net;
...
@@ -3,6 +3,7 @@ package com.duben.speedplaylet.net;
import
android.content.Context
;
import
android.content.Context
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
com.duben.speedplaylet.mvp.model.RecommendBannerList
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonObject
;
import
com.duben.speedplaylet.BuildConfig
;
import
com.duben.speedplaylet.BuildConfig
;
import
com.duben.speedplaylet.mvp.model.BannerList
;
import
com.duben.speedplaylet.mvp.model.BannerList
;
...
@@ -310,6 +311,19 @@ public interface LoanService {
...
@@ -310,6 +311,19 @@ public interface LoanService {
@POST
(
"api/vedio/showTurn"
)
@POST
(
"api/vedio/showTurn"
)
Observable
<
BaseResponse
<
NineShowBean
>>
showTurn
();
Observable
<
BaseResponse
<
NineShowBean
>>
showTurn
();
/**
* 获取推荐状态
*/
@POST
(
"api/vedio/showVedio4"
)
Observable
<
BaseResponse
<
JsonObject
>>
firstShowVedio
();
/**
* 推荐banner
*/
@POST
(
"api/vedio/vedio4Msg"
)
Observable
<
BaseResponse
<
RecommendBannerList
>>
vedio4Msg
(
@Body
Map
<
String
,
Object
>
vo
);
/**
/**
* 默认http工厂
* 默认http工厂
*/
*/
...
...
video/app/src/main/java/com/duben/speedplaylet/ui/activitys/RecommendBannerActivity.kt
View file @
7e4d8377
...
@@ -9,6 +9,7 @@ import com.duben.library.utils.nodoubleclick.AntiShake
...
@@ -9,6 +9,7 @@ import com.duben.library.utils.nodoubleclick.AntiShake
import
com.duben.speedplaylet.R
import
com.duben.speedplaylet.R
import
com.duben.speedplaylet.manager.LocalVedioManager
import
com.duben.speedplaylet.manager.LocalVedioManager
import
com.duben.speedplaylet.mvp.model.BannerList
import
com.duben.speedplaylet.mvp.model.BannerList
import
com.duben.speedplaylet.mvp.model.RecommendBannerList
import
com.duben.speedplaylet.mvp.model.VedioBean
import
com.duben.speedplaylet.mvp.model.VedioBean
import
com.duben.speedplaylet.mvp.presenters.RecommendBannerPresenter
import
com.duben.speedplaylet.mvp.presenters.RecommendBannerPresenter
import
com.duben.speedplaylet.mvp.views.RecommendBannerView
import
com.duben.speedplaylet.mvp.views.RecommendBannerView
...
@@ -58,7 +59,7 @@ class RecommendBannerActivity : BaseActivity(),RecommendBannerView, View.OnClick
...
@@ -58,7 +59,7 @@ class RecommendBannerActivity : BaseActivity(),RecommendBannerView, View.OnClick
recommendBannerPresenter
.
detachView
()
recommendBannerPresenter
.
detachView
()
}
}
override
fun
ordersSuc
(
data
:
BannerList
?)
{
override
fun
ordersSuc
(
data
:
Recommend
BannerList
?)
{
data
?.
let
{
data
?.
let
{
setBanner
(
it
.
list
)
setBanner
(
it
.
list
)
}
}
...
...
video/app/src/main/java/com/duben/speedplaylet/ui/activitys/SplashActivity.kt
View file @
7e4d8377
...
@@ -71,7 +71,7 @@ class SplashActivity : BaseActivity() {
...
@@ -71,7 +71,7 @@ class SplashActivity : BaseActivity() {
private
fun
initData
()
{
private
fun
initData
()
{
if
(!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
userID
)){
if
(!
TextUtils
.
isEmpty
(
UserManager
.
getInstance
().
userID
)){
TrackManager
.
getInstance
().
getMyInf
o
()
TrackManager
.
getInstance
().
firstShowVedi
o
()
}
}
val
firstSplash
=
get
().
getBoolean
(
Constant
.
FIRST_SPLASH
,
true
)
val
firstSplash
=
get
().
getBoolean
(
Constant
.
FIRST_SPLASH
,
true
)
...
...
video/app/src/main/res/layout/item_banner_vip.xml
View file @
7e4d8377
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
android:scaleType=
"fitXY"
/>
android:scaleType=
"fitXY"
/>
<TextView
<TextView
android:visibility=
"gone"
android:id=
"@+id/bannerTitle"
android:id=
"@+id/bannerTitle"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"24dp"
android:layout_height=
"24dp"
...
...
video/app/src/main/res/layout/item_rv_vip.xml
View file @
7e4d8377
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"
20
dp"
android:layout_marginTop=
"
14
dp"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"18sp"
android:textSize=
"18sp"
tools:text=
"包年会员"
/>
tools: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