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
a2295980
Commit
a2295980
authored
Sep 22, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Plain Diff
代码优化
parents
6dc96409
10744905
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
182 additions
and
77 deletions
+182
-77
AndroidManifest.xml
video/app/src/main/AndroidManifest.xml
+1
-0
InMoneyVideo.java
...main/java/com/duben/dayplaylet/ad/video/InMoneyVideo.java
+12
-5
InMoneyVideoNoPre.java
...java/com/duben/dayplaylet/ad/video/InMoneyVideoNoPre.java
+11
-5
LocalVedioManager.kt
...in/java/com/duben/dayplaylet/manager/LocalVedioManager.kt
+2
-2
IndexList.java
...c/main/java/com/duben/dayplaylet/mvp/model/IndexList.java
+0
-10
RDVideoBean.java
...main/java/com/duben/dayplaylet/mvp/model/RDVideoBean.java
+33
-0
VideoPresenter.kt
...ava/com/duben/dayplaylet/mvp/presenters/VideoPresenter.kt
+4
-10
VideoView.kt
...src/main/java/com/duben/dayplaylet/mvp/views/VideoView.kt
+2
-2
LoanService.java
...p/src/main/java/com/duben/dayplaylet/net/LoanService.java
+2
-1
SongAwardActivity.kt
...va/com/duben/dayplaylet/ui/activitys/SongAwardActivity.kt
+4
-3
TaskAwardActivity.kt
...va/com/duben/dayplaylet/ui/activitys/TaskAwardActivity.kt
+2
-4
MusicFragment.kt
...in/java/com/duben/dayplaylet/ui/fragment/MusicFragment.kt
+24
-1
RedpkgFragment.kt
...n/java/com/duben/dayplaylet/ui/fragment/RedpkgFragment.kt
+10
-4
DrawAlipayDialog.kt
.../java/com/duben/dayplaylet/ui/widgets/DrawAlipayDialog.kt
+1
-1
RedPkgAwardDialog.kt
...java/com/duben/dayplaylet/ui/widgets/RedPkgAwardDialog.kt
+1
-1
VideoLockDialog.kt
...n/java/com/duben/dayplaylet/ui/widgets/VideoLockDialog.kt
+3
-4
VideoRewardDialog.kt
...java/com/duben/dayplaylet/ui/widgets/VideoRewardDialog.kt
+3
-2
VipCountDialog.kt
...in/java/com/duben/dayplaylet/ui/widgets/VipCountDialog.kt
+1
-1
WithDrawSucDialog.kt
...java/com/duben/dayplaylet/ui/widgets/WithDrawSucDialog.kt
+3
-4
ForegroundOrBackground.java
...va/com/duben/dayplaylet/utils/ForegroundOrBackground.java
+9
-1
FormatUtil.kt
...pp/src/main/java/com/duben/dayplaylet/utils/FormatUtil.kt
+7
-0
DramaApiDetailActivity.kt
.../com/duben/dayplaylet/video/csj/DramaApiDetailActivity.kt
+36
-11
TxVideoActivity.kt
...ain/java/com/duben/dayplaylet/video/tx/TxVideoActivity.kt
+1
-2
layout_red_box.xml
video/app/src/main/res/layout/layout_red_box.xml
+3
-3
view_countdown_video.xml
video/app/src/main/res/layout/view_countdown_video.xml
+1
-0
styles.xml
video/app/src/main/res/values/styles.xml
+6
-0
No files found.
video/app/src/main/AndroidManifest.xml
View file @
a2295980
...
...
@@ -171,6 +171,7 @@
android:name=
".ui.activitys.HintActivity"
android:launchMode=
"singleTask"
android:theme=
"@style/TransparentTheme"
/>
<service
android:name=
".ui.service.UpdateService"
android:exported=
"true"
/>
...
...
video/app/src/main/java/com/duben/dayplaylet/ad/video/InMoneyVideo.java
View file @
a2295980
...
...
@@ -2,7 +2,6 @@ package com.duben.dayplaylet.ad.video;
import
android.app.Activity
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
com.bytedance.sdk.openadsdk.AdSlot
;
import
com.bytedance.sdk.openadsdk.TTAdConstant
;
...
...
@@ -16,13 +15,13 @@ import com.duben.dayplaylet.ad.AdStatusListener;
import
com.duben.dayplaylet.common.AppConfig
;
import
com.duben.dayplaylet.common.Constant
;
import
com.duben.dayplaylet.manager.TrackManager
;
import
com.duben.dayplaylet.utils.AppPreferencesManager
;
import
com.duben.dayplaylet.utils.GromorePrintUtil
;
import
com.duben.dayplaylet.utils.LogUtil
;
import
com.duben.dayplaylet.utils.TimeRender
;
import
java.lang.ref.WeakReference
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* GroMore激励视频广告
...
...
@@ -220,8 +219,7 @@ public class InMoneyVideo {
vo
.
put
(
"list_id"
,
AppConfig
.
taskListId
);
}
if
(!
TextUtils
.
equals
(
Constant
.
CARRIERTYPE_VEDIO_UNLOCK
,
carrierType
)
||
!
TextUtils
.
equals
(
Constant
.
CARRIERTYPE_VEDIO
,
carrierType
))
{
if
(!
isNoReportCarrier
(
carrierType
))
{
TrackManager
.
getInstance
().
reportAddCoinMsg
(
vo
);
}
...
...
@@ -262,4 +260,13 @@ public class InMoneyVideo {
}
};
private
boolean
isNoReportCarrier
(
String
carrierType
)
{
List
<
String
>
strings
=
new
ArrayList
<>();
strings
.
add
(
Constant
.
CARRIERTYPE_VEDIO
);
strings
.
add
(
Constant
.
CARRIERTYPE_SONG_CLICK
);
strings
.
add
(
Constant
.
CARRIERTYPE_SONG_MORE
);
strings
.
add
(
Constant
.
CARRIERTYPE_SONG_ALL
);
return
strings
.
contains
(
carrierType
);
}
}
video/app/src/main/java/com/duben/dayplaylet/ad/video/InMoneyVideoNoPre.java
View file @
a2295980
...
...
@@ -2,7 +2,6 @@ package com.duben.dayplaylet.ad.video;
import
android.app.Activity
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
com.bytedance.sdk.openadsdk.AdSlot
;
import
com.bytedance.sdk.openadsdk.TTAdConstant
;
...
...
@@ -16,12 +15,12 @@ import com.duben.dayplaylet.ad.AdStatusListener;
import
com.duben.dayplaylet.common.AppConfig
;
import
com.duben.dayplaylet.common.Constant
;
import
com.duben.dayplaylet.manager.TrackManager
;
import
com.duben.dayplaylet.utils.AppPreferencesManager
;
import
com.duben.dayplaylet.utils.GromorePrintUtil
;
import
com.duben.dayplaylet.utils.LogUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* **实时加载
...
...
@@ -160,8 +159,7 @@ public class InMoneyVideoNoPre {
}
if
(!
TextUtils
.
equals
(
Constant
.
CARRIERTYPE_VEDIO_UNLOCK
,
carrierType
)
||
!
TextUtils
.
equals
(
Constant
.
CARRIERTYPE_VEDIO
,
carrierType
))
{
if
(!
isNoReportCarrier
(
carrierType
))
{
TrackManager
.
getInstance
().
reportAddCoinMsg
(
vo
);
}
...
...
@@ -201,5 +199,13 @@ public class InMoneyVideoNoPre {
}
};
private
boolean
isNoReportCarrier
(
String
carrierType
)
{
List
<
String
>
strings
=
new
ArrayList
<>();
strings
.
add
(
Constant
.
CARRIERTYPE_VEDIO
);
strings
.
add
(
Constant
.
CARRIERTYPE_SONG_CLICK
);
strings
.
add
(
Constant
.
CARRIERTYPE_SONG_MORE
);
strings
.
add
(
Constant
.
CARRIERTYPE_SONG_ALL
);
return
strings
.
contains
(
carrierType
);
}
}
video/app/src/main/java/com/duben/dayplaylet/manager/LocalVedioManager.kt
View file @
a2295980
...
...
@@ -7,7 +7,7 @@ import android.text.TextUtils
import
com.bytedance.sdk.dp.DPDrama
import
com.bytedance.sdk.dp.DPSdk
import
com.bytedance.sdk.dp.IDPWidgetFactory
import
com.duben.dayplaylet.ad.express.ExpressManager
import
com.duben.dayplaylet.ad.express.
My
ExpressManager
import
com.duben.library.utils.json.JsonUtil
import
com.duben.dayplaylet.common.Constant
import
com.duben.dayplaylet.mvp.model.VedioBean
...
...
@@ -113,7 +113,7 @@ object LocalVedioManager {
}
}
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
}
// 请求穿山甲数据
...
...
video/app/src/main/java/com/duben/dayplaylet/mvp/model/IndexList.java
View file @
a2295980
...
...
@@ -10,16 +10,6 @@ public class IndexList implements Serializable {
private
List
<
VedioEpisodeBean
>
list
;
private
ArrayList
<
String
>
tip
;
private
UserBean
.
UserMsgBean
userMsg
;
public
UserBean
.
UserMsgBean
getUserMsg
()
{
return
userMsg
;
}
public
void
setUserMsg
(
UserBean
.
UserMsgBean
userMsg
)
{
this
.
userMsg
=
userMsg
;
}
public
ArrayList
<
String
>
getTip
()
{
return
tip
;
}
...
...
video/app/src/main/java/com/duben/dayplaylet/mvp/model/RDVideoBean.java
0 → 100644
View file @
a2295980
package
com
.
duben
.
dayplaylet
.
mvp
.
model
;
import
java.io.Serializable
;
public
class
RDVideoBean
implements
Serializable
{
private
int
surplusCount
;
private
int
surplusSeconds
;
private
UserBean
.
UserMsgBean
userMsg
;
public
int
getSurplusCount
()
{
return
surplusCount
;
}
public
void
setSurplusCount
(
int
surplusCount
)
{
this
.
surplusCount
=
surplusCount
;
}
public
int
getSurplusSeconds
()
{
return
surplusSeconds
;
}
public
void
setSurplusSeconds
(
int
surplusSeconds
)
{
this
.
surplusSeconds
=
surplusSeconds
;
}
public
UserBean
.
UserMsgBean
getUserMsg
()
{
return
userMsg
;
}
public
void
setUserMsg
(
UserBean
.
UserMsgBean
userMsg
)
{
this
.
userMsg
=
userMsg
;
}
}
video/app/src/main/java/com/duben/dayplaylet/mvp/presenters/VideoPresenter.kt
View file @
a2295980
...
...
@@ -3,6 +3,7 @@ package com.duben.dayplaylet.mvp.presenters
import
com.duben.dayplaylet.manager.AppHttpManager
import
com.duben.dayplaylet.mvp.model.BaseResponse
import
com.duben.dayplaylet.mvp.model.IndexList
import
com.duben.dayplaylet.mvp.model.RDVideoBean
import
com.duben.dayplaylet.mvp.views.VideoView
import
com.duben.library.net.neterror.BaseSubscriber
import
com.duben.library.net.neterror.Throwable
...
...
@@ -93,13 +94,13 @@ class VideoPresenter : BasePresenter<VideoView>() {
fun
rdVedioMsg
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
rdVedioMsg
(),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
object
:
BaseSubscriber
<
BaseResponse
<
RDVideoBean
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
override
fun
onNext
(
baseResponse
:
BaseResponse
<
RDVideoBean
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
...
...
@@ -110,16 +111,9 @@ class VideoPresenter : BasePresenter<VideoView>() {
200
->
{
val
data
=
baseResponse
.
data
if
(
data
!=
null
)
{
view
.
rdVedioMsgSuc
(
data
[
"surplusCount"
].
asInt
,
data
[
"surplusSeconds"
].
asInt
)
view
.
rdVedioMsgSuc
(
data
)
}
}
else
->
{
view
.
rdVedioMsgSuc
(
0
,
0
)
view
.
showToast
(
message
)
}
}
}
...
...
video/app/src/main/java/com/duben/dayplaylet/mvp/views/VideoView.kt
View file @
a2295980
package
com.duben.dayplaylet.mvp.views
import
com.duben.dayplaylet.mvp.model.IndexList
import
com.duben.dayplaylet.mvp.model.
NineShow
Bean
import
com.duben.dayplaylet.mvp.model.
RDVideo
Bean
interface
VideoView
:
BaseView
{
fun
getIndexListSuc
(
indexList
:
IndexList
)
...
...
@@ -10,7 +10,7 @@ interface VideoView : BaseView {
fun
unlockSuc
(
indexList
:
IndexList
)
fun
unlockFail
()
fun
rdVedioMsgSuc
(
surplusCount
:
Int
,
surplusSeconds
:
Int
)
fun
rdVedioMsgSuc
(
data
:
RDVideoBean
)
fun
reportAddCoinMsgSuc
(
coin
:
Int
,
di
:
Int
)
...
...
video/app/src/main/java/com/duben/dayplaylet/net/LoanService.java
View file @
a2295980
...
...
@@ -4,6 +4,7 @@ import android.content.Context;
import
android.text.TextUtils
;
import
com.duben.dayplaylet.mvp.model.DrawInfoBean
;
import
com.duben.dayplaylet.mvp.model.RDVideoBean
;
import
com.duben.dayplaylet.mvp.model.RiskBean
;
import
com.duben.dayplaylet.mvp.model.SignInfoBean
;
import
com.duben.dayplaylet.mvp.model.MusicBean
;
...
...
@@ -238,7 +239,7 @@ public interface LoanService {
* @return
*/
@POST
(
"api/reward/rdVedioMsg"
)
Observable
<
BaseResponse
<
JsonObject
>>
rdVedioMsg
();
Observable
<
BaseResponse
<
RDVideoBean
>>
rdVedioMsg
();
/**
* 任务列表
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/activitys/SongAwardActivity.kt
View file @
a2295980
...
...
@@ -7,7 +7,6 @@ import android.view.View
import
android.widget.FrameLayout
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.express.ExpressAdCallback
import
com.duben.dayplaylet.ad.express.ExpressManager
import
com.duben.dayplaylet.ad.express.MyExpressManager
import
com.duben.dayplaylet.ui.activitys.base.BaseActivity
import
com.duben.dayplaylet.utils.UIUtils
...
...
@@ -55,6 +54,8 @@ class SongAwardActivity : BaseActivity(), View.OnClickListener {
}
private
fun
initListener
()
{
iv_award_quit
.
setOnClickListener
(
this
)
iv_song_award
.
setOnClickListener
(
this
)
}
override
fun
finish
()
{
...
...
@@ -108,12 +109,12 @@ class SongAwardActivity : BaseActivity(), View.OnClickListener {
fl_ad
.
addView
(
it
)
}
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
return
false
}
override
fun
loadFail
()
{
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
}
})
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/activitys/TaskAwardActivity.kt
View file @
a2295980
...
...
@@ -6,13 +6,11 @@ import android.os.Looper
import
android.view.KeyEvent
import
android.view.View
import
android.widget.FrameLayout
import
com.duben.dayplaylet.MintsApplication
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.AdManager
import
com.duben.dayplaylet.ad.AdStatusListener
import
com.duben.dayplaylet.ad.NoPreAdManager
import
com.duben.dayplaylet.ad.express.ExpressAdCallback
import
com.duben.dayplaylet.ad.express.ExpressManager
import
com.duben.dayplaylet.ad.express.MyExpressManager
import
com.duben.dayplaylet.common.AppConfig
import
com.duben.dayplaylet.manager.TrackManager
...
...
@@ -240,12 +238,12 @@ class TaskAwardActivity : BaseActivity(), View.OnClickListener {
fl_ad
.
addView
(
it
)
}
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
return
false
}
override
fun
loadFail
()
{
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
}
})
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/fragment/MusicFragment.kt
View file @
a2295980
...
...
@@ -31,6 +31,7 @@ import com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.AdManager
import
com.duben.dayplaylet.ad.AdStatusListener
import
com.duben.dayplaylet.ad.NoPreAdManager
import
com.duben.dayplaylet.ad.half.HalfScreenManager
import
com.duben.dayplaylet.common.AppConfig
import
com.duben.dayplaylet.common.Constant
import
com.duben.dayplaylet.manager.DPHolder
...
...
@@ -38,6 +39,7 @@ import com.duben.dayplaylet.mvp.model.MusicBean
import
com.duben.dayplaylet.mvp.presenters.MusicPresenter
import
com.duben.dayplaylet.mvp.views.MusicView
import
com.duben.dayplaylet.ui.activitys.NineActivity
import
com.duben.dayplaylet.ui.activitys.MainActivity
import
com.duben.dayplaylet.ui.activitys.SongAwardActivity
import
com.duben.dayplaylet.ui.fragment.base.LazyLoadBaseFragment
import
com.duben.dayplaylet.ui.widgets.countdowntimer.CountDownTimerSupport
...
...
@@ -47,6 +49,7 @@ import com.duben.dayplaylet.utils.LogUtil
import
com.duben.dayplaylet.utils.RxBus
import
com.duben.dayplaylet.utils.RxBus.MsgEvent
import
com.duben.dayplaylet.utils.SpanUtils
import
com.duben.library.utils.nodoubleclick.AntiShake
import
io.reactivex.Observer
import
io.reactivex.disposables.Disposable
import
kotlinx.android.synthetic.main.fragment_music.*
...
...
@@ -55,7 +58,7 @@ import kotlinx.android.synthetic.main.layout_draw_header.*
/**
* 猜歌
*/
class
MusicFragment
:
LazyLoadBaseFragment
(),
MusicView
{
class
MusicFragment
:
LazyLoadBaseFragment
(),
MusicView
,
View
.
OnClickListener
{
companion
object
{
private
const
val
TAG
=
"MusicFragment"
...
...
@@ -95,6 +98,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
}
btn_draw_gold
.
setOnClickListener
(
this
)
btn_draw_cash
.
setOnClickListener
(
this
)
}
override
fun
onFragmentFirstVisible
()
{
...
...
@@ -631,7 +636,10 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
},
100
)
}
HalfScreenManager
.
getInstance
().
preLoadAd
(
requireActivity
())
mainHandler
.
postDelayed
({
HalfScreenManager
.
getInstance
().
showAd
(
requireActivity
(),
null
)
cl_reward
.
visibility
=
View
.
GONE
},
1500
)
}
...
...
@@ -660,6 +668,8 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
}
private
fun
awardVideo
(
carrierType
:
String
)
{
HalfScreenManager
.
getInstance
().
preLoadAd
(
requireActivity
())
AdManager
.
instance
.
showAd
(
requireActivity
(),
carrierType
,
object
:
AdStatusListener
{
var
canFail
=
false
...
...
@@ -903,4 +913,17 @@ class MusicFragment : LazyLoadBaseFragment(), MusicView {
showRewardAnim
(
coin
,
di
)
}
override
fun
onClick
(
v
:
View
?)
{
if
(
AntiShake
.
check
(
v
?.
id
))
return
when
(
v
?.
id
)
{
R
.
id
.
btn_draw_gold
->
{
(
requireActivity
()
as
MainActivity
).
clickTab4Layout
()
}
R
.
id
.
btn_draw_cash
->
{
(
requireActivity
()
as
MainActivity
).
clickTab4Layout
()
}
}
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/ui/fragment/RedpkgFragment.kt
View file @
a2295980
...
...
@@ -13,7 +13,7 @@ import com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.AdManager
import
com.duben.dayplaylet.ad.AdStatusListener
import
com.duben.dayplaylet.ad.NoPreAdManager
import
com.duben.dayplaylet.ad.half.HalfScreenManager
NoPre
import
com.duben.dayplaylet.ad.half.HalfScreenManager
import
com.duben.dayplaylet.common.Constant
import
com.duben.dayplaylet.mvp.model.MSGMultiItemEntity
import
com.duben.dayplaylet.mvp.model.MsgBean
...
...
@@ -190,6 +190,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
}
private
fun
awardVideo
(
carrierType
:
String
)
{
HalfScreenManager
.
getInstance
().
preLoadAd
(
requireActivity
())
AdManager
.
instance
.
showAd
(
requireActivity
(),
carrierType
,
object
:
AdStatusListener
{
var
canFail
=
false
...
...
@@ -268,6 +270,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
}
private
fun
showRedPkgAwardDialog
()
{
HalfScreenManager
.
getInstance
().
preLoadAd
(
requireActivity
())
mRedPkgAwardDialog
=
RedPkgAwardDialog
(
requireContext
(),
10
,
132434
,
true
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
...
...
@@ -278,7 +282,7 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
}
R
.
id
.
ib_close
->
{
HalfScreenManager
NoPre
.
getInstance
().
showAd
(
requireActivity
(),
null
)
HalfScreenManager
.
getInstance
().
showAd
(
requireActivity
(),
null
)
}
else
->
{}
}
...
...
@@ -289,6 +293,8 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
}
private
fun
showWithdrawSucDialog
()
{
HalfScreenManager
.
getInstance
().
preLoadAd
(
requireActivity
())
mWithDrawSucDialog
=
WithDrawSucDialog
(
requireContext
(),
10
,
object
:
DialogListener
()
{
override
fun
onClick
(
dialog
:
Dialog
?,
v
:
View
?)
{
...
...
@@ -296,10 +302,10 @@ class RedpkgFragment : LazyLoadBaseFragment(), View.OnClickListener, RedpkgView
dialog
?.
dismiss
()
when
(
v
?.
id
)
{
R
.
id
.
btn
->
{
HalfScreenManager
NoPre
.
getInstance
().
showAd
(
requireActivity
(),
null
)
HalfScreenManager
.
getInstance
().
showAd
(
requireActivity
(),
null
)
}
R
.
id
.
ib_close
->
{
HalfScreenManager
NoPre
.
getInstance
().
showAd
(
requireActivity
(),
null
)
HalfScreenManager
.
getInstance
().
showAd
(
requireActivity
(),
null
)
}
else
->
{}
}
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/DrawAlipayDialog.kt
View file @
a2295980
...
...
@@ -27,7 +27,7 @@ class DrawAlipayDialog(private val context: Context, val cash: Double) :
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Fad
e
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Scal
e
window
!!
.
attributes
=
lp
// 设置外部不可关闭
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/RedPkgAwardDialog.kt
View file @
a2295980
...
...
@@ -36,7 +36,7 @@ class RedPkgAwardDialog(
lp
=
window
!!
.
attributes
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
height
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Fad
e
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Scal
e
window
!!
.
attributes
=
lp
// 设置外部不可关闭
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/VideoLockDialog.kt
View file @
a2295980
...
...
@@ -12,7 +12,6 @@ import android.widget.ImageButton
import
android.widget.TextView
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.express.ExpressAdCallback
import
com.duben.dayplaylet.ad.express.ExpressManager
import
com.duben.dayplaylet.ad.express.MyExpressManager
import
com.duben.dayplaylet.utils.UIUtils
...
...
@@ -39,7 +38,7 @@ class VideoLockDialog(
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
height
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Fad
e
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Scal
e
window
!!
.
attributes
=
lp
// 设置外部不可关闭
...
...
@@ -81,12 +80,12 @@ class VideoLockDialog(
flAd
.
addView
(
it
)
}
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
return
false
}
override
fun
loadFail
()
{
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
}
})
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/VideoRewardDialog.kt
View file @
a2295980
...
...
@@ -15,6 +15,7 @@ import com.airbnb.lottie.LottieComposition
import
com.airbnb.lottie.LottieCompositionFactory
import
com.airbnb.lottie.LottieDrawable
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.utils.FormatUtil
import
com.duben.dayplaylet.utils.SpanUtils
/**
...
...
@@ -41,7 +42,7 @@ class VideoRewardDialog(
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
height
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Fad
e
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Scal
e
window
!!
.
attributes
=
lp
// 设置外部不可关闭
...
...
@@ -62,7 +63,7 @@ class VideoRewardDialog(
tvInfo
.
text
=
SpanUtils
()
.
append
(
"还差"
)
.
append
(
"${(100f - currentCash)}元"
)
.
append
(
"${
FormatUtil.format
(100f - currentCash)}元"
)
.
setForegroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
red
))
.
append
(
"即可提现"
)
.
append
(
"100元"
)
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/VipCountDialog.kt
View file @
a2295980
...
...
@@ -32,7 +32,7 @@ class VipCountDialog(val activity: Activity, vedioBean: VedioBean, tipList: Arra
lp
=
window
!!
.
attributes
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Fad
e
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Scal
e
window
!!
.
attributes
=
lp
// 设置外部不可关闭
...
...
video/app/src/main/java/com/duben/dayplaylet/ui/widgets/WithDrawSucDialog.kt
View file @
a2295980
...
...
@@ -11,7 +11,6 @@ import android.widget.ImageButton
import
android.widget.TextView
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.express.ExpressAdCallback
import
com.duben.dayplaylet.ad.express.ExpressManager
import
com.duben.dayplaylet.ad.express.MyExpressManager
import
com.duben.dayplaylet.utils.UIUtils
...
...
@@ -40,7 +39,7 @@ class WithDrawSucDialog(
lp
.
gravity
=
Gravity
.
CENTER
lp
.
width
=
WindowManager
.
LayoutParams
.
MATCH_PARENT
lp
.
height
=
WindowManager
.
LayoutParams
.
WRAP_CONTENT
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Fad
e
lp
.
windowAnimations
=
R
.
style
.
DialogAnim
Scal
e
window
!!
.
attributes
=
lp
// 设置外部不可关闭
...
...
@@ -85,12 +84,12 @@ class WithDrawSucDialog(
flAd
.
addView
(
it
)
}
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
return
false
}
override
fun
loadFail
()
{
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
}
})
...
...
video/app/src/main/java/com/duben/dayplaylet/utils/ForegroundOrBackground.java
View file @
a2295980
...
...
@@ -11,7 +11,7 @@ import com.duben.dayplaylet.common.AppConfig;
import
com.duben.dayplaylet.manager.ActivityPageManager
;
import
com.duben.dayplaylet.manager.TrackManager
;
import
com.duben.dayplaylet.mvp.presenters.VersionUpdatePresenter
;
import
com.duben.dayplaylet.ui.activitys.
SplashForeAd
Activity
;
import
com.duben.dayplaylet.ui.activitys.
Main
Activity
;
import
java.lang.ref.WeakReference
;
...
...
@@ -26,6 +26,7 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
//获取当前最上层的activity
private
static
WeakReference
<
Activity
>
app_activity
;
private
static
WeakReference
<
Activity
>
main_activity
;
private
VersionUpdatePresenter
vup
;
public
static
ForegroundOrBackground
init
(
Application
application
)
{
...
...
@@ -40,6 +41,10 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
return
app_activity
.
get
();
}
public
static
MainActivity
getMainActivity
()
{
return
(
MainActivity
)
main_activity
.
get
();
}
@Override
public
void
onActivityResumed
(
Activity
activity
)
{
if
(
activity
==
null
)
...
...
@@ -63,6 +68,9 @@ public class ForegroundOrBackground implements Application.ActivityLifecycleCall
@Override
public
void
onActivityCreated
(
Activity
activity
,
Bundle
savedInstanceState
)
{
if
(
TextUtils
.
equals
(
activity
.
getClass
().
getSimpleName
(),
"MainActivity"
))
{
main_activity
=
new
WeakReference
<>(
activity
);
}
app_activity
=
new
WeakReference
<>(
activity
);
ActivityPageManager
.
getInstance
().
addActivity
(
activity
);
}
...
...
video/app/src/main/java/com/duben/dayplaylet/utils/FormatUtil.kt
View file @
a2295980
package
com.duben.dayplaylet.utils
import
java.math.BigDecimal
import
java.text.DecimalFormat
object
FormatUtil
{
...
...
@@ -22,4 +23,10 @@ object FormatUtil {
// val temp= bd1.subtract(bd2)
// return temp.setScale(2, BigDecimal.ROUND_HALF_UP).toDouble()
}
fun
format
(
data
:
Float
):
String
{
//#.00 表示两位小数
val
df
=
DecimalFormat
(
"#0.00"
)
return
df
.
format
(
data
)
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/dayplaylet/video/csj/DramaApiDetailActivity.kt
View file @
a2295980
...
...
@@ -20,16 +20,19 @@ import com.duben.dayplaylet.R
import
com.duben.dayplaylet.ad.AdManager
import
com.duben.dayplaylet.ad.AdStatusListener
import
com.duben.dayplaylet.ad.NoPreAdManager
import
com.duben.dayplaylet.ad.express.ExpressManager
import
com.duben.dayplaylet.ad.express.MyExpressManager
import
com.duben.dayplaylet.ad.half.HalfScreenManager
import
com.duben.dayplaylet.common.Constant
import
com.duben.dayplaylet.manager.LocalVedioManager
import
com.duben.dayplaylet.mvp.model.IndexList
import
com.duben.dayplaylet.mvp.model.RDVideoBean
import
com.duben.dayplaylet.mvp.model.VedioBean
import
com.duben.dayplaylet.mvp.presenters.VideoPresenter
import
com.duben.dayplaylet.mvp.views.VideoView
import
com.duben.dayplaylet.ui.activitys.base.BaseActivity
import
com.duben.dayplaylet.ui.adapter.VideoEpisodeAdapter
import
com.duben.dayplaylet.ui.widgets.*
import
com.duben.dayplaylet.utils.ForegroundOrBackground
import
com.duben.dayplaylet.utils.FormatUtil
import
com.duben.dayplaylet.utils.SpanUtils
import
com.duben.library.utils.nodoubleclick.AntiShake
...
...
@@ -108,12 +111,14 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
videoPresenter
.
attachView
(
this
)
mVedioBean
?.
let
{
videoPresenter
.
getIndexList
(
it
.
thirdId
,
true
)
}
ExpressManager
.
instance
.
preLoadAd
()
My
ExpressManager
.
instance
.
preLoadAd
()
leave
.
visibility
=
View
.
VISIBLE
fm_bottom
.
setOnClickListener
(
this
)
leave
.
setOnClickListener
(
this
)
iv_pause
.
setOnClickListener
(
this
)
btn_draw_gold
.
setOnClickListener
(
this
)
btn_draw_cash
.
setOnClickListener
(
this
)
drama
=
outerDrama
drama
?.
let
{
...
...
@@ -179,7 +184,7 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
override
fun
onDestroy
()
{
dpWidget
?.
destroy
()
ExpressManager
.
instance
.
destroy
()
My
ExpressManager
.
instance
.
destroy
()
cdvv
.
destroy
()
cdvv
.
setCountDownVideoListener
(
null
)
...
...
@@ -393,11 +398,6 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
override
fun
getIndexListSuc
(
indexList
:
IndexList
)
{
tipList
=
indexList
.
tip
mCash
=
indexList
.
userMsg
.
coin
mGold
=
indexList
.
userMsg
.
diamonds
tv_cash
.
text
=
"${FormatUtil.getCashFormaet(mCash)}元"
tv_gold
.
text
=
"${mGold}个"
}
override
fun
getIndexListFail
()
{
...
...
@@ -412,8 +412,14 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
override
fun
rdVedioMsgSuc
(
surplusCount
:
Int
,
surplusSeconds
:
Int
)
{
if
(
surplusCount
>
0
)
{
override
fun
rdVedioMsgSuc
(
data
:
RDVideoBean
)
{
mCash
=
data
.
userMsg
.
coin
mGold
=
data
.
userMsg
.
diamonds
tv_cash
.
text
=
"${FormatUtil.getCashFormaet(mCash)}元"
tv_gold
.
text
=
"${mGold}个"
if
(
data
.
surplusCount
>
0
)
{
cl_red_box
.
visibility
=
View
.
VISIBLE
tv_tips
.
text
=
SpanUtils
()
.
append
(
"点击领取 "
)
...
...
@@ -422,11 +428,13 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
.
create
()
tv_tips
.
visibility
=
View
.
GONE
triangle
.
visibility
=
View
.
GONE
cdvv
.
setTime
(
surplusSeconds
)
cdvv
.
setTime
(
data
.
surplusSeconds
)
cdvv
.
start
()
cdvv
.
setCountDownVideoListener
(
this
)
cl_red_box
.
isClickable
=
false
cl_red_box
.
setOnClickListener
{
if
(
cdvv
.
isPlaying
)
return
@setOnClickListener
dpWidget
?.
fragment
?.
onPause
()
showRedboxDialog
()
}
...
...
@@ -458,6 +466,18 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
R
.
id
.
fm_bottom
->
{
showEpisodeDialog
()
}
R
.
id
.
btn_draw_gold
->
{
finish
()
if
(
ForegroundOrBackground
.
getMainActivity
()
!=
null
)
{
ForegroundOrBackground
.
getMainActivity
().
clickTab4Layout
()
}
}
R
.
id
.
btn_draw_cash
->
{
finish
()
if
(
ForegroundOrBackground
.
getMainActivity
()
!=
null
)
{
ForegroundOrBackground
.
getMainActivity
().
clickTab4Layout
()
}
}
else
->
{}
}
}
...
...
@@ -502,6 +522,8 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
}
private
fun
showAd
(
carrierType
:
String
,
drama
:
DPDrama
?
=
null
,
widget
:
IDPWidget
?
=
null
)
{
HalfScreenManager
.
getInstance
().
preLoadAd
(
this
)
AdManager
.
instance
.
showAd
(
this
@DramaApiDetailActivity
,
carrierType
,
object
:
AdStatusListener
{
var
canFail
=
false
...
...
@@ -642,8 +664,11 @@ class DramaApiDetailActivity : BaseActivity(), VideoEpisodeAdapter.OnEpisodeClic
},
100
)
}
HalfScreenManager
.
getInstance
().
preLoadAd
(
this
)
mainHandler
.
postDelayed
({
cl_reward
.
visibility
=
View
.
GONE
// 展示插屏
HalfScreenManager
.
getInstance
().
showAd
(
this
,
null
)
},
1500
)
}
...
...
video/app/src/main/java/com/duben/dayplaylet/video/tx/TxVideoActivity.kt
View file @
a2295980
...
...
@@ -196,8 +196,7 @@ class TxVideoActivity : BaseActivity(), View.OnClickListener, VideoView,
override
fun
unlockFail
()
{
}
override
fun
rdVedioMsgSuc
(
surplusCount
:
Int
,
surplusSeconds
:
Int
)
{
override
fun
rdVedioMsgSuc
(
data
:
RDVideoBean
)
{
}
override
fun
reportAddCoinMsgSuc
(
coin
:
Int
,
di
:
Int
)
{
...
...
video/app/src/main/res/layout/layout_red_box.xml
View file @
a2295980
...
...
@@ -27,7 +27,7 @@
android:id=
"@+id/triangle"
android:layout_width=
"12dp"
android:layout_height=
"12dp"
android:layout_marginStart=
"
16
dp"
android:layout_marginStart=
"
30
dp"
android:background=
"@drawable/shape_triangle"
android:visibility=
"gone"
app:layout_constraintStart_toStartOf=
"@id/tv_tips"
...
...
@@ -51,9 +51,9 @@
<com.duben.dayplaylet.ui.widgets.CountDownVideoView
android:id=
"@+id/cdvv"
android:layout_gravity=
"center_horizontal"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
/>
<TextView
android:layout_width=
"82dp"
...
...
video/app/src/main/res/layout/view_countdown_video.xml
View file @
a2295980
...
...
@@ -26,6 +26,7 @@
android:layout_width=
"45dp"
android:layout_height=
"52dp"
android:layout_gravity=
"center"
android:padding=
"5dp"
android:src=
"@mipmap/withdraw_wx"
tools:visibility=
"gone"
/>
</FrameLayout>
video/app/src/main/res/values/styles.xml
View file @
a2295980
...
...
@@ -62,6 +62,12 @@
<item
name=
"android:windowExitAnimation"
>
@anim/fade_out
</item>
</style>
<style
name=
"DialogAnimScale"
parent=
"@android:style/Animation"
>
<item
name=
"android:windowEnterAnimation"
>
@anim/scale_in
</item>
<item
name=
"android:windowExitAnimation"
>
@anim/scale_out
</item>
</style>
<style
name=
"CustomCheckboxTheme"
parent=
"@android:style/Widget.CompoundButton.CheckBox"
>
<item
name=
"android:button"
>
@drawable/checkbox_style
</item>
</style>
...
...
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