Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
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_goodmoney
Commits
175d5a63
Commit
175d5a63
authored
Jan 15, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
珊瑚激励视频集成
parent
2e5ae5df
Changes
51
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
987 additions
and
407 deletions
+987
-407
build.gradle
GoodMoney/app/build.gradle
+16
-16
GDTSDK.tbsNoPlugin.4.290.1160.aar
GoodMoney/app/libs/GDTSDK.tbsNoPlugin.4.290.1160.aar
+0
-0
discovery-2.0.17.aar
GoodMoney/app/libs/discovery-2.0.17.aar
+0
-0
ks_adsdk-2.6.8.aar
GoodMoney/app/libs/ks_adsdk-2.6.8.aar
+0
-0
shanhuAD-1.3.1.aar
GoodMoney/app/libs/shanhuAD-1.3.1.aar
+0
-0
tzsdk_coral-2.1.0-20200807130815-release.aar
...ney/app/libs/tzsdk_coral-2.1.0-20200807130815-release.aar
+0
-0
tzsdk_core-3.0.0-20200807130815-release.aar
...oney/app/libs/tzsdk_core-3.0.0-20200807130815-release.aar
+0
-0
tzsdk_reporter-3.0.0-20200807130815-release.aar
.../app/libs/tzsdk_reporter-3.0.0-20200807130815-release.aar
+0
-0
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+1
-1
CoralDownload.java
...main/java/com/mints/goodmoney/ad/tz_ad/CoralDownload.java
+12
-8
BaseVideoAd.kt
...src/main/java/com/mints/goodmoney/ad/video/BaseVideoAd.kt
+3
-3
CsjVideoAdManager.java
.../java/com/mints/goodmoney/ad/video/CsjVideoAdManager.java
+25
-25
MhVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/MhVideoAdManager.kt
+28
-28
TzVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/TzVideoAdManager.kt
+26
-18
VideoAdingManager.java
.../java/com/mints/goodmoney/ad/video/VideoAdingManager.java
+523
-0
WnVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/WnVideoAdManager.kt
+28
-28
YlhVideoAdManager.java
.../java/com/mints/goodmoney/ad/video/YlhVideoAdManager.java
+33
-35
AppConfig.java
...p/src/main/java/com/mints/goodmoney/common/AppConfig.java
+10
-6
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+2
-1
TzManager.kt
...pp/src/main/java/com/mints/goodmoney/manager/TzManager.kt
+1
-1
DrawcashBean.java
...main/java/com/mints/goodmoney/mvp/model/DrawcashBean.java
+4
-0
MainVideoMsgBean.java
.../java/com/mints/goodmoney/mvp/model/MainVideoMsgBean.java
+1
-1
VedioRulesBean.java
...in/java/com/mints/goodmoney/mvp/model/VedioRulesBean.java
+16
-0
VideoAdingBean.java
...in/java/com/mints/goodmoney/mvp/model/VideoAdingBean.java
+1
-1
HomePresenter.kt
.../java/com/mints/goodmoney/mvp/presenters/HomePresenter.kt
+3
-4
HorizChannelPresenter.kt
...m/mints/goodmoney/mvp/presenters/HorizChannelPresenter.kt
+3
-3
KylVideoPresenter.kt
...a/com/mints/goodmoney/mvp/presenters/KylVideoPresenter.kt
+2
-3
MhVedioAdPresenter.kt
.../com/mints/goodmoney/mvp/presenters/MhVedioAdPresenter.kt
+2
-3
TzVideoAdPresenter.kt
.../com/mints/goodmoney/mvp/presenters/TzVideoAdPresenter.kt
+2
-2
WnVideoAdPresenter.kt
.../com/mints/goodmoney/mvp/presenters/WnVideoAdPresenter.kt
+2
-3
YlhVideoAdPresenter.java
...m/mints/goodmoney/mvp/presenters/YlhVideoAdPresenter.java
+2
-2
HomeView.kt
...p/src/main/java/com/mints/goodmoney/mvp/views/HomeView.kt
+2
-2
HorizChannelView.kt
...in/java/com/mints/goodmoney/mvp/views/HorizChannelView.kt
+2
-2
KylVideoView.kt
...c/main/java/com/mints/goodmoney/mvp/views/KylVideoView.kt
+6
-0
VideoAdManagerView.java
...ava/com/mints/goodmoney/mvp/views/VideoAdManagerView.java
+5
-0
LoanService.java
...pp/src/main/java/com/mints/goodmoney/net/LoanService.java
+3
-3
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+25
-25
DrawcashActivity.kt
...java/com/mints/goodmoney/ui/activitys/DrawcashActivity.kt
+13
-10
KylVideoActivity.kt
...java/com/mints/goodmoney/ui/activitys/KylVideoActivity.kt
+51
-52
MainActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
+3
-3
MorningClockActivity.kt
.../com/mints/goodmoney/ui/activitys/MorningClockActivity.kt
+22
-22
SettingsActivity.kt
...java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
+1
-1
TaskActivity.kt
...ain/java/com/mints/goodmoney/ui/activitys/TaskActivity.kt
+1
-1
HorizonChannelFragment.kt
...com/mints/goodmoney/ui/fragment/HorizonChannelFragment.kt
+5
-5
KuYinYuePageFragment.kt
...a/com/mints/goodmoney/ui/fragment/KuYinYuePageFragment.kt
+3
-5
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+38
-31
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+27
-19
CountDownVideoView.java
...va/com/mints/goodmoney/ui/widgets/CountDownVideoView.java
+11
-11
DrawcashVideoDialog.kt
...ava/com/mints/goodmoney/ui/widgets/DrawcashVideoDialog.kt
+22
-22
activity_kyl_video.xml
GoodMoney/app/src/main/res/layout/activity_kyl_video.xml
+0
-0
layout_red_box.xml
GoodMoney/app/src/main/res/layout/layout_red_box.xml
+1
-1
No files found.
GoodMoney/app/build.gradle
View file @
175d5a63
...
...
@@ -254,7 +254,7 @@ dependencies {
// 枫岚
implementation
(
name:
'mh-adsdk'
,
ext:
'aar'
)
implementation
(
name:
'mh-adsdk-ext'
,
ext:
'aar'
)
//
implementation(name: 'ks_3.3.5.3', ext: 'aar')
implementation
(
name:
'ks_3.3.5.3'
,
ext:
'aar'
)
// 聚乐云
implementation
(
name:
'okgo-2.2'
,
ext:
'aar'
)
implementation
(
name:
'scenemodule-2.2'
,
ext:
'aar'
)
...
...
@@ -264,23 +264,23 @@ dependencies {
// 微转阅读
implementation
(
name:
'articlesdk-v1.0.6.202012121917-x'
,
ext:
'aar'
)
//天卓SDK的珊瑚2.0组件
// implementation("com.android.support:support-v4:28.+")
// implementation(name: 'adapt-1.3.3', ext: 'aar')
// implementation(name: 'commonbase-1.0.2', ext: 'aar')
// implementation(name: 'discovery-2.0.14', ext: 'aar')
// implementation(name: 'shanhuAD.1.2.0', ext: 'aar')
// implementation(name: 'tzsdk_coral-2.0.0-20200807131516-release', ext: 'aar')
// implementation(name: 'tzsdk_core-3.0.0-20200807131516-release', ext: 'aar')
// implementation(name: 'tzsdk_reporter-3.0.0-20200807131516-release', ext: 'aar')
// implementation(name: 'ks_adsdk-2.6.8', ext: 'aar')
implementation
(
"com.android.support:support-v4:28.+"
)
implementation
(
name:
'adapt-1.3.3'
,
ext:
'aar'
)
implementation
(
name:
'commonbase-1.0.2'
,
ext:
'aar'
)
implementation
(
name:
'discovery-2.0.17'
,
ext:
'aar'
)
implementation
(
name:
'shanhuAD-1.3.1'
,
ext:
'aar'
)
implementation
(
name:
'tzsdk_coral-2.1.0-20200807130815-release'
,
ext:
'aar'
)
implementation
(
name:
'tzsdk_core-3.0.0-20200807130815-release'
,
ext:
'aar'
)
implementation
(
name:
'tzsdk_reporter-3.0.0-20200807130815-release'
,
ext:
'aar'
)
implementation
(
name:
'discovery-2.0.14'
,
ext:
'aar'
)
implementation
(
name:
'shanhuAD.1.2.0'
,
ext:
'aar'
)
implementation
(
name:
'tzsdk_coral-2.0.0-20200807131516-release'
,
ext:
'aar'
)
implementation
(
name:
'tzsdk_core-3.0.0-20200807131516-release'
,
ext:
'aar'
)
implementation
(
name:
'tzsdk_reporter-3.0.0-20200807131516-release'
,
ext:
'aar'
)
// implementation(name: 'ks_adsdk-2.6.8', ext: 'aar')
// implementatiion(name: 'adapt-1.3.3', ext: 'aar')
// implementation(name: 'commonbase-1.0.2', ext: 'aar')
// implementation(name: 'discovery-2.0.17', ext: 'aar')
// implementation(name: 'shanhuAD-1.3.1', ext: 'aar')
// implementation(name: 'tzsdk_coral-2.1.0-20200807130815-release', ext: 'aar')
// implementaton(name: 'tzsdk_core-3.0.0-20200807130815-release', ext: 'aar')
// implementation(name: 'tzsdk_reporter-3.0.0-20200807130815-release', ext: 'aar')
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
...
...
GoodMoney/app/libs/GDTSDK.tbsNoPlugin.4.290.1160.aar
deleted
100755 → 0
View file @
2e5ae5df
File deleted
GoodMoney/app/libs/discovery-2.0.17.aar
deleted
100644 → 0
View file @
2e5ae5df
File deleted
GoodMoney/app/libs/ks_adsdk-2.6.8.aar
deleted
100644 → 0
View file @
2e5ae5df
File deleted
GoodMoney/app/libs/shanhuAD-1.3.1.aar
deleted
100644 → 0
View file @
2e5ae5df
File deleted
GoodMoney/app/libs/tzsdk_coral-2.1.0-20200807130815-release.aar
deleted
100644 → 0
View file @
2e5ae5df
File deleted
GoodMoney/app/libs/tzsdk_core-3.0.0-20200807130815-release.aar
deleted
100644 → 0
View file @
2e5ae5df
File deleted
GoodMoney/app/libs/tzsdk_reporter-3.0.0-20200807130815-release.aar
deleted
100644 → 0
View file @
2e5ae5df
File deleted
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
175d5a63
...
...
@@ -161,7 +161,7 @@ public class MintsApplication extends MultiDexApplication {
// PR下载附件
// initPRDownloader();
// 天卓
// 天卓
珊瑚
TzManager
.
INSTANCE
.
initTz
(
this
);
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/tz_ad/CoralDownload.java
View file @
175d5a63
...
...
@@ -2,6 +2,7 @@ package com.mints.goodmoney.ad.tz_ad;
import
androidx.annotation.Nullable
;
import
com.mints.goodmoney.BuildConfig
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.manager.UserManager
;
import
com.tz.sdk.coral.ad.CoralAD
;
...
...
@@ -21,18 +22,21 @@ import java.util.List;
*/
public
final
class
CoralDownload
{
public
static
final
int
RELEASE_TASK_TYPE
=
103
;
private
int
mTaskType
;
/**
* taskType 珊瑚的任务类型 103正式环境 134测试环境
*/
public
CoralDownload
(
int
taskType
)
{
mTaskType
=
taskType
;
}
public
static
final
int
RELEASE_TASK_TYPE_DEBUG
=
134
;
public
static
final
int
RELEASE_TASK_TYPE_RELEASE
=
103
;
public
void
pull
()
{
int
type
;
if
(
BuildConfig
.
DEBUG
)
{
type
=
RELEASE_TASK_TYPE_DEBUG
;
}
else
{
type
=
RELEASE_TASK_TYPE_RELEASE
;
}
new
ADLoader
(
MintsApplication
.
getContext
())
.
get
(
ADType
.
APP_DOWNLOAD
)
.
from
(
ADSource
.
CORAL
)
...
...
@@ -40,7 +44,7 @@ public final class CoralDownload {
.
reward
(
true
)
.
with
(
new
HashMap
<
String
,
Object
>()
{
{
put
(
CoralAD
.
Key
.
TASK_TYPE
,
mTaskT
ype
);
put
(
CoralAD
.
Key
.
TASK_TYPE
,
t
ype
);
put
(
CoralAD
.
Key
.
ACCOUNT_ID
,
UserManager
.
getInstance
().
getUserID
());
put
(
CoralAD
.
Key
.
LOGIN_KEY
,
UserManager
.
getInstance
().
getTokenID
());
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edio/BaseVedi
oAd.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ideo/BaseVide
oAd.kt
View file @
175d5a63
package
com.mints.goodmoney.ad.v
edi
o
package
com.mints.goodmoney.ad.v
ide
o
import
android.app.Activity
import
android.content.DialogInterface
...
...
@@ -11,7 +11,7 @@ import com.mints.goodmoney.ui.widgets.LoadingDialog
import
com.mints.goodmoney.utils.ToastUtil
import
java.util.HashMap
open
class
BaseV
edi
oAd
(
activity
:
Activity
)
:
BaseView
{
open
class
BaseV
ide
oAd
(
activity
:
Activity
)
:
BaseView
{
open
var
activity
:
Activity
?
=
null
var
progressDialog
:
LoadingDialog
?
=
null
...
...
@@ -111,5 +111,5 @@ open class BaseVedioAd(activity: Activity) : BaseView {
open
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{}
open
fun
onDest
or
y
()
{}
open
fun
onDest
ro
y
()
{}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edio/CsjVedi
oAdManager.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ideo/CsjVide
oAdManager.java
View file @
175d5a63
package
com
.
mints
.
goodmoney
.
ad
.
v
edi
o
;
package
com
.
mints
.
goodmoney
.
ad
.
v
ide
o
;
import
android.app.Activity
;
...
...
@@ -25,13 +25,13 @@ import java.util.HashMap;
/**
* 穿山甲激励视频广告
*/
public
class
CsjV
edioAdManager
extends
BaseVedi
oAd
{
public
class
CsjV
ideoAdManager
extends
BaseVide
oAd
{
private
static
CsjV
edi
oAdManager
_inst
;
private
static
CsjV
ide
oAdManager
_inst
;
private
AppPreferences
ps
;
private
int
curCoin
;
private
String
extraId
;
private
CsjV
edioAdListener
csjVedi
oAdListener
;
private
CsjV
ideoAdListener
csjVide
oAdListener
;
Activity
activity
;
private
TTAdNative
ttAdNative
;
...
...
@@ -40,16 +40,16 @@ public class CsjVedioAdManager extends BaseVedioAd {
private
boolean
isClickScreen
=
true
;
// 是否点击屏幕跳转广告
public
static
CsjV
edi
oAdManager
getInstance
(
Activity
activity
)
{
public
static
CsjV
ide
oAdManager
getInstance
(
Activity
activity
)
{
if
(
_inst
!=
null
)
{
return
_inst
;
}
else
{
_inst
=
new
CsjV
edi
oAdManager
(
activity
);
_inst
=
new
CsjV
ide
oAdManager
(
activity
);
return
_inst
;
}
}
private
CsjV
edi
oAdManager
(
Activity
activity
)
{
private
CsjV
ide
oAdManager
(
Activity
activity
)
{
super
(
activity
);
init
(
activity
);
}
...
...
@@ -64,7 +64,7 @@ public class CsjVedioAdManager extends BaseVedioAd {
}
@Override
public
void
onDest
or
y
()
{
public
void
onDest
ro
y
()
{
if
(
mttRewardVideoAd
!=
null
)
{
mttRewardVideoAd
.
setRewardAdInteractionListener
(
null
);
}
...
...
@@ -148,9 +148,9 @@ public class CsjVedioAdManager extends BaseVedioAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
LogUtil
.
d
(
"
CsjVedioAdManag
er"
,
"onError "
+
code
+
message
);
if
(
csjV
edi
oAdListener
!=
null
)
{
csjV
edioAdListener
.
csjVedi
oAdFail
();
LogUtil
.
d
(
"
csjVideoAdListen
er"
,
"onError "
+
code
+
message
);
if
(
csjV
ide
oAdListener
!=
null
)
{
csjV
ideoAdListener
.
csjVide
oAdFail
();
}
}
...
...
@@ -163,8 +163,8 @@ public class CsjVedioAdManager extends BaseVedioAd {
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
if
(
csjV
edi
oAdListener
!=
null
)
{
csjV
edioAdListener
.
csjVedi
oAdFail
();
if
(
csjV
ide
oAdListener
!=
null
)
{
csjV
ideoAdListener
.
csjVide
oAdFail
();
}
}
}
...
...
@@ -196,8 +196,8 @@ public class CsjVedioAdManager extends BaseVedioAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
}
if
(
csjV
edi
oAdListener
!=
null
)
{
csjV
edioAdListener
.
csjVedi
oDownload
();
if
(
csjV
ide
oAdListener
!=
null
)
{
csjV
ideoAdListener
.
csjVide
oDownload
();
}
}
...
...
@@ -205,8 +205,8 @@ public class CsjVedioAdManager extends BaseVedioAd {
public
void
onAdClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
if
(
csjV
edi
oAdListener
!=
null
)
{
csjV
edioAdListener
.
csjVedi
oAdSuccess
();
if
(
csjV
ide
oAdListener
!=
null
)
{
csjV
ideoAdListener
.
csjVide
oAdSuccess
();
}
}
...
...
@@ -218,8 +218,8 @@ public class CsjVedioAdManager extends BaseVedioAd {
public
void
onVideoError
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"VideoError"
);
if
(
csjV
edi
oAdListener
!=
null
)
{
csjV
edioAdListener
.
csjVedi
oAdFail
();
if
(
csjV
ide
oAdListener
!=
null
)
{
csjV
ideoAdListener
.
csjVide
oAdFail
();
}
}
...
...
@@ -298,15 +298,15 @@ public class CsjVedioAdManager extends BaseVedioAd {
return
vo
;
}
public
void
setCsjV
edioAdListener
(
CsjVedioAdListener
csjVedi
oAdListener
)
{
this
.
csjV
edioAdListener
=
csjVedi
oAdListener
;
public
void
setCsjV
ideoAdListener
(
CsjVideoAdListener
csjVide
oAdListener
)
{
this
.
csjV
ideoAdListener
=
csjVide
oAdListener
;
}
public
interface
CsjV
edi
oAdListener
{
void
csjV
edi
oAdFail
();
public
interface
CsjV
ide
oAdListener
{
void
csjV
ide
oAdFail
();
void
csjV
edi
oAdSuccess
();
void
csjV
ide
oAdSuccess
();
void
csjV
edi
oDownload
();
void
csjV
ide
oDownload
();
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edio/MhVedi
oAdManager.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ideo/MhVide
oAdManager.kt
View file @
175d5a63
package
com.mints.goodmoney.ad.v
edi
o
package
com.mints.goodmoney.ad.v
ide
o
import
android.app.Activity
import
com.maplehaze.adsdk.video.RewardVideoAd
...
...
@@ -6,32 +6,32 @@ import com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.MhManager
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.mvp.presenters.MhV
edi
oAdPresenter
import
com.mints.goodmoney.mvp.views.V
edi
oAdManagerView
import
com.mints.goodmoney.mvp.presenters.MhV
ide
oAdPresenter
import
com.mints.goodmoney.mvp.views.V
ide
oAdManagerView
import
com.mints.goodmoney.utils.LogUtil
private
val
TAG
=
MhV
edi
oAdManager
::
class
.
java
.
simpleName
private
val
TAG
=
MhV
ide
oAdManager
::
class
.
java
.
simpleName
/**
* 枫岚广告视频
*/
class
MhV
edi
oAdManager
private
constructor
(
activity
:
Activity
)
:
BaseV
edioAd
(
activity
),
Vedi
oAdManagerView
{
class
MhV
ide
oAdManager
private
constructor
(
activity
:
Activity
)
:
BaseV
ideoAd
(
activity
),
Vide
oAdManagerView
{
private
var
mhV
dedioAdPresenter
:
MhVedi
oAdPresenter
?
=
null
private
var
mhV
edioAdListener
:
MhVedi
oAdListener
?
=
null
private
var
mhV
ideoAdPresenter
:
MhVide
oAdPresenter
?
=
null
private
var
mhV
ideoAdListener
:
MhVide
oAdListener
?
=
null
private
var
mRewardVideoAd
:
RewardVideoAd
?
=
null
private
var
isClickScreen
:
Boolean
=
true
override
var
activity
:
Activity
?
=
null
companion
object
{
private
var
_inst
:
MhV
edi
oAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
MhV
edi
oAdManager
?
{
private
var
_inst
:
MhV
ide
oAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
MhV
ide
oAdManager
?
{
return
if
(
_inst
!=
null
)
{
_inst
}
else
{
_inst
=
MhV
edi
oAdManager
(
activity
)
_inst
=
MhV
ide
oAdManager
(
activity
)
_inst
}
}
...
...
@@ -43,8 +43,8 @@ class MhVedioAdManager private constructor(activity: Activity) :
private
fun
init
(
activity
:
Activity
)
{
this
.
activity
=
activity
mhV
dedioAdPresenter
=
MhVedi
oAdPresenter
()
mhV
dedi
oAdPresenter
?.
attachView
(
this
)
mhV
ideoAdPresenter
=
MhVide
oAdPresenter
()
mhV
ide
oAdPresenter
?.
attachView
(
this
)
}
override
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{
...
...
@@ -88,8 +88,8 @@ class MhVedioAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
mhV
edi
oAdListener
!=
null
)
{
mhV
edioAdListener
?.
mhVedi
oAdDownload
()
if
(
mhV
ide
oAdListener
!=
null
)
{
mhV
ideoAdListener
?.
mhVide
oAdDownload
()
}
}
...
...
@@ -100,12 +100,12 @@ class MhVedioAdManager private constructor(activity: Activity) :
override
fun
onADClose
()
{
LogUtil
.
d
(
TAG
,
"onADClose"
)
mhV
dedi
oAdPresenter
?.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_FL
,
extraId
,
curCoin
))
mhV
ide
oAdPresenter
?.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_FL
,
extraId
,
curCoin
))
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
mhV
edi
oAdListener
!=
null
)
{
mhV
edioAdListener
?.
mhVedi
oAdSuccess
()
if
(
mhV
ide
oAdListener
!=
null
)
{
mhV
ideoAdListener
?.
mhVide
oAdSuccess
()
}
}
...
...
@@ -114,8 +114,8 @@ class MhVedioAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
if
(
mhV
edi
oAdListener
!=
null
)
{
mhV
edioAdListener
?.
mhVedi
oAdFail
()
if
(
mhV
ide
oAdListener
!=
null
)
{
mhV
ideoAdListener
?.
mhVide
oAdFail
()
}
}
...
...
@@ -124,18 +124,18 @@ class MhVedioAdManager private constructor(activity: Activity) :
mRewardVideoAd
?.
loadAd
()
}
fun
setMhV
edioAdListener
(
mhVedioAdListener
:
MhVedi
oAdListener
?)
{
this
.
mhV
edioAdListener
=
mhVedi
oAdListener
fun
setMhV
ideoAdListener
(
mhVideoAdListener
:
MhVide
oAdListener
?)
{
this
.
mhV
ideoAdListener
=
mhVide
oAdListener
}
interface
MhV
edi
oAdListener
{
fun
mhV
edi
oAdSuccess
()
fun
mhV
edi
oAdFail
()
fun
mhV
edi
oAdDownload
()
interface
MhV
ide
oAdListener
{
fun
mhV
ide
oAdSuccess
()
fun
mhV
ide
oAdFail
()
fun
mhV
ide
oAdDownload
()
}
override
fun
onDest
or
y
()
{
mhV
dedi
oAdPresenter
?.
let
{
override
fun
onDest
ro
y
()
{
mhV
ide
oAdPresenter
?.
let
{
it
.
dispose
()
it
.
detachView
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edi
o/TzVideoAdManager.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ide
o/TzVideoAdManager.kt
View file @
175d5a63
package
com.mints.goodmoney.ad.v
edi
o
package
com.mints.goodmoney.ad.v
ide
o
import
android.app.Activity
import
androidx.annotation.Nullable
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.presenters.TzVideoAdPresenter
import
com.mints.goodmoney.mvp.views.V
edi
oAdManagerView
import
com.mints.goodmoney.mvp.views.V
ide
oAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.tz.sdk.coral.ad.CoralAD
import
com.tz.sdk.coral.callback.CoralVideoListener
...
...
@@ -19,10 +20,10 @@ import com.tz.sdk.core.loader.ADLoader
private
val
TAG
=
TzVideoAdManager
::
class
.
java
.
simpleName
/**
* 天卓广告视频
* 天卓
珊瑚
广告视频
*/
class
TzVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseV
edioAd
(
activity
),
Vedi
oAdManagerView
{
BaseV
ideoAd
(
activity
),
Vide
oAdManagerView
{
private
var
isClickScreen
:
Boolean
=
true
...
...
@@ -36,7 +37,8 @@ class TzVideoAdManager private constructor(activity: Activity) :
* 104(正式环境使用,珊瑚和广点通、快手视频混出)
* 131(测试环境使用,广点通视频单出)
*/
const
val
TZ_REWRAD_TYPE
=
132
const
val
TZ_REWRAD_TYPE_DEBUG
=
131
const
val
TZ_REWRAD_TYPE_RELEASE
=
104
private
var
_inst
:
TzVideoAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
TzVideoAdManager
?
{
...
...
@@ -63,6 +65,12 @@ class TzVideoAdManager private constructor(activity: Activity) :
this
.
activity
=
activity
isClickScreen
=
true
val
type
=
if
(
BuildConfig
.
DEBUG
)
{
TZ_REWRAD_TYPE_DEBUG
}
else
{
TZ_REWRAD_TYPE_RELEASE
}
ADLoader
(
activity
)
.
get
(
ADType
.
REWARD_VIDEO
)
.
from
(
ADSource
.
CORAL
)
...
...
@@ -70,7 +78,7 @@ class TzVideoAdManager private constructor(activity: Activity) :
.
count
(
1
)
.
with
(
object
:
HashMap
<
String
?,
Any
?>()
{
init
{
put
(
CoralAD
.
Key
.
TASK_TYPE
,
TZ_REWRAD_TYPE
)
put
(
CoralAD
.
Key
.
TASK_TYPE
,
type
)
put
(
CoralAD
.
Key
.
ACCOUNT_ID
,
UserManager
.
getInstance
().
userID
)
put
(
CoralAD
.
Key
.
LOGIN_KEY
,
UserManager
.
getInstance
().
tokenID
)
// put(CoralAD.Key.VIDEO_AUTO_PLAY, true) //拉取成功后是否自动播放视频,非必须,默认true
...
...
@@ -80,18 +88,18 @@ class TzVideoAdManager private constructor(activity: Activity) :
override
fun
onAdLoaded
(
adList
:
List
<
CoralAD
>?)
{
LogUtil
.
d
(
TAG
,
"onAdLoaded"
)
if
(
adList
!=
null
&&
adList
.
isNotEmpty
())
{
val
ad
=
adList
[
0
]
//
if (adList != null && adList.isNotEmpty()) {
//
val ad = adList[0]
// ad.playVideo(activity)
}
else
{
}
//
} else {
//
//
}
}
override
fun
onAdFailed
(
adError
:
ADError
)
{
LogUtil
.
d
(
TAG
,
"onAdFailed"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_
TZ
,
Constant
.
EVENT_TYPE_ONE
,
(
adError
.
code
).
toString
(),
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_
SH
,
Constant
.
EVENT_TYPE_ONE
,
(
adError
.
code
).
toString
(),
""
)
if
(
tzVideoAdListener
!=
null
)
{
tzVideoAdListener
?.
tzVideoAdFail
()
...
...
@@ -101,7 +109,7 @@ class TzVideoAdManager private constructor(activity: Activity) :
override
fun
onAdShow
(
@Nullable
ad
:
CoralAD
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onAdShow"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_
TZ
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_
SH
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
)
return
super
.
onAdShow
(
ad
)
}
...
...
@@ -114,7 +122,7 @@ class TzVideoAdManager private constructor(activity: Activity) :
if
(
isClickScreen
)
{
// 防止重复
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_
FL
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_
SH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
tzVideoAdListener
!=
null
)
{
...
...
@@ -157,9 +165,9 @@ class TzVideoAdManager private constructor(activity: Activity) :
override
fun
onVideoClosed
(
@Nullable
coralAD
:
CoralAD
?,
@Nullable
s
:
String
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onVideoClosed"
)
tzVideoAdPresenter
?.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_
TZ
,
extraId
,
curCoin
))
tzVideoAdPresenter
?.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_
SH
,
extraId
,
curCoin
))
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_
TZ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_
SH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
tzVideoAdListener
!=
null
)
{
tzVideoAdListener
?.
tzVideoAdSuccess
()
...
...
@@ -171,7 +179,7 @@ class TzVideoAdManager private constructor(activity: Activity) :
}
fun
setTzV
edi
oAdListener
(
tzVideoAdListener
:
TzVideoAdListener
?)
{
fun
setTzV
ide
oAdListener
(
tzVideoAdListener
:
TzVideoAdListener
?)
{
this
.
tzVideoAdListener
=
tzVideoAdListener
}
...
...
@@ -181,7 +189,7 @@ class TzVideoAdManager private constructor(activity: Activity) :
fun
tzVideoAdDownload
()
}
override
fun
onDest
or
y
()
{
override
fun
onDest
ro
y
()
{
tzVideoAdPresenter
?.
let
{
it
.
dispose
()
it
.
detachView
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edio/Vedi
oAdingManager.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ideo/Vide
oAdingManager.java
View file @
175d5a63
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edio/WnVedi
oAdManager.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ideo/WnVide
oAdManager.kt
View file @
175d5a63
package
com.mints.goodmoney.ad.v
edi
o
package
com.mints.goodmoney.ad.v
ide
o
import
android.app.Activity
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.WnManager
import
com.mints.goodmoney.mvp.presenters.WnV
edi
oAdPresenter
import
com.mints.goodmoney.mvp.views.V
edi
oAdManagerView
import
com.mints.goodmoney.mvp.presenters.WnV
ide
oAdPresenter
import
com.mints.goodmoney.mvp.views.V
ide
oAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.wannuosili.sdk.*
private
val
TAG
=
WnV
edi
oAdManager
::
class
.
java
.
simpleName
private
val
TAG
=
WnV
ide
oAdManager
::
class
.
java
.
simpleName
/**
* 闪电盒子视频
*/
class
WnV
edi
oAdManager
private
constructor
(
activity
:
Activity
)
:
BaseV
edioAd
(
activity
),
Vedi
oAdManagerView
{
class
WnV
ide
oAdManager
private
constructor
(
activity
:
Activity
)
:
BaseV
ideoAd
(
activity
),
Vide
oAdManagerView
{
private
var
wnV
edioAdPresenter
:
WnVedi
oAdPresenter
?
=
null
private
var
wnV
edioAdListener
:
WnVedi
oAdListener
?
=
null
private
var
wnV
ideoAdPresenter
:
WnVide
oAdPresenter
?
=
null
private
var
wnV
ideoAdListener
:
WnVide
oAdListener
?
=
null
private
var
mRewardVideoAd
:
WNRewardVideoAd
?
=
null
private
var
isClickScreen
:
Boolean
=
true
override
var
activity
:
Activity
?
=
null
companion
object
{
private
var
_inst
:
WnV
edi
oAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
WnV
edi
oAdManager
?
{
private
var
_inst
:
WnV
ide
oAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
WnV
ide
oAdManager
?
{
return
if
(
_inst
!=
null
)
{
_inst
}
else
{
_inst
=
WnV
edi
oAdManager
(
activity
)
_inst
=
WnV
ide
oAdManager
(
activity
)
_inst
}
}
...
...
@@ -43,8 +43,8 @@ class WnVedioAdManager private constructor(activity: Activity) :
private
fun
init
(
activity
:
Activity
)
{
this
.
activity
=
activity
wnV
edioAdPresenter
=
WnVedi
oAdPresenter
()
wnV
edi
oAdPresenter
?.
attachView
(
this
)
wnV
ideoAdPresenter
=
WnVide
oAdPresenter
()
wnV
ide
oAdPresenter
?.
attachView
(
this
)
}
override
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{
...
...
@@ -69,8 +69,8 @@ class WnVedioAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_ONE
,
(
code
).
toString
(),
message
)
if
(
wnV
edi
oAdListener
!=
null
)
{
wnV
edioAdListener
?.
wnVedi
oAdFail
()
if
(
wnV
ide
oAdListener
!=
null
)
{
wnV
ideoAdListener
?.
wnVide
oAdFail
()
}
}
...
...
@@ -92,18 +92,18 @@ class WnVedioAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
wnV
edi
oAdListener
!=
null
)
{
wnV
edioAdListener
?.
wnVedi
oAdDownload
()
if
(
wnV
ide
oAdListener
!=
null
)
{
wnV
ideoAdListener
?.
wnVide
oAdDownload
()
}
}
override
fun
onAdClose
()
{
wnV
edi
oAdPresenter
?.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_SDHZ
,
extraId
,
curCoin
))
wnV
ide
oAdPresenter
?.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_SDHZ
,
extraId
,
curCoin
))
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
wnV
edi
oAdListener
!=
null
)
{
wnV
edioAdListener
?.
wnVedi
oAdSuccess
()
if
(
wnV
ide
oAdListener
!=
null
)
{
wnV
ideoAdListener
?.
wnVide
oAdSuccess
()
}
}
...
...
@@ -130,18 +130,18 @@ class WnVedioAdManager private constructor(activity: Activity) :
})
}
fun
setWnV
edioAdListener
(
wnVedioAdListener
:
WnVedi
oAdListener
?)
{
this
.
wnV
edioAdListener
=
wnVedi
oAdListener
fun
setWnV
ideoAdListener
(
wnVideoAdListener
:
WnVide
oAdListener
?)
{
this
.
wnV
ideoAdListener
=
wnVide
oAdListener
}
interface
WnV
edi
oAdListener
{
fun
wnV
edi
oAdSuccess
()
fun
wnV
edi
oAdFail
()
fun
wnV
edi
oAdDownload
()
interface
WnV
ide
oAdListener
{
fun
wnV
ide
oAdSuccess
()
fun
wnV
ide
oAdFail
()
fun
wnV
ide
oAdDownload
()
}
override
fun
onDest
or
y
()
{
wnV
edi
oAdPresenter
?.
let
{
override
fun
onDest
ro
y
()
{
wnV
ide
oAdPresenter
?.
let
{
it
.
dispose
()
it
.
detachView
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
edio/YlhVedi
oAdManager.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/v
ideo/YlhVide
oAdManager.java
View file @
175d5a63
package
com
.
mints
.
goodmoney
.
ad
.
v
edi
o
;
package
com
.
mints
.
goodmoney
.
ad
.
v
ide
o
;
import
android.app.Activity
;
import
android.os.SystemClock
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.TrackManager
;
import
com.mints.goodmoney.manager.YlhAdManager
;
import
com.mints.goodmoney.mvp.presenters.YlhV
edi
oAdPresenter
;
import
com.mints.goodmoney.mvp.views.V
edi
oAdManagerView
;
import
com.mints.goodmoney.mvp.presenters.YlhV
ide
oAdPresenter
;
import
com.mints.goodmoney.mvp.views.V
ide
oAdManagerView
;
import
com.mints.goodmoney.utils.LogUtil
;
import
com.mints.goodmoney.utils.ToastUtil
;
import
com.qq.e.ads.rewardvideo.RewardVideoAD
;
import
com.qq.e.ads.rewardvideo.RewardVideoADListener
;
import
com.qq.e.comm.util.AdError
;
...
...
@@ -19,30 +17,30 @@ import com.qq.e.comm.util.AdError;
/**
* 优量汇视频
*/
public
class
YlhV
edioAdManager
extends
BaseVedioAd
implements
Vedi
oAdManagerView
{
public
class
YlhV
ideoAdManager
extends
BaseVideoAd
implements
Vide
oAdManagerView
{
private
static
YlhV
edi
oAdManager
_inst
;
private
static
YlhV
ide
oAdManager
_inst
;
// 优量汇激励视频
private
RewardVideoAD
rewardVideoAD
;
private
YlhV
edioAdPresenter
ylhVedi
oAdPresenter
;
private
YlhV
edioAdListener
ylhVedi
oAdListener
;
private
YlhV
ideoAdPresenter
ylhVide
oAdPresenter
;
private
YlhV
ideoAdListener
ylhVide
oAdListener
;
Activity
activity
;
private
boolean
isClickScreen
=
true
;
// 是否点击屏幕跳转广告
public
static
YlhV
edi
oAdManager
getInstance
(
Activity
activity
)
{
public
static
YlhV
ide
oAdManager
getInstance
(
Activity
activity
)
{
if
(
_inst
!=
null
)
{
return
_inst
;
}
else
{
_inst
=
new
YlhV
edi
oAdManager
(
activity
);
_inst
=
new
YlhV
ide
oAdManager
(
activity
);
return
_inst
;
}
}
private
YlhV
edi
oAdManager
(
Activity
activity
)
{
private
YlhV
ide
oAdManager
(
Activity
activity
)
{
super
(
activity
);
init
(
activity
);
}
...
...
@@ -50,15 +48,15 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView
private
void
init
(
Activity
activity
)
{
this
.
activity
=
activity
;
ylhV
edioAdPresenter
=
new
YlhVedi
oAdPresenter
();
ylhV
edi
oAdPresenter
.
attachView
(
this
);
ylhV
ideoAdPresenter
=
new
YlhVide
oAdPresenter
();
ylhV
ide
oAdPresenter
.
attachView
(
this
);
}
@Override
public
void
onDest
or
y
()
{
if
(
ylhV
edi
oAdPresenter
!=
null
)
{
ylhV
edi
oAdPresenter
.
dispose
();
ylhV
edi
oAdPresenter
.
detachView
();
public
void
onDest
ro
y
()
{
if
(
ylhV
ide
oAdPresenter
!=
null
)
{
ylhV
ide
oAdPresenter
.
dispose
();
ylhV
ide
oAdPresenter
.
detachView
();
}
activity
=
null
;
...
...
@@ -157,8 +155,8 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView
e
.
printStackTrace
();
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Load Fail"
);
if
(
ylhV
edi
oAdListener
!=
null
)
{
ylhV
edioAdListener
.
ylhVedi
oAdFail
();
if
(
ylhV
ide
oAdListener
!=
null
)
{
ylhV
ideoAdListener
.
ylhVide
oAdFail
();
}
}
}
...
...
@@ -182,7 +180,7 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView
@Override
public
void
onReward
()
{
//激励视频广告激励发放
// if (activity != null) {
// ylhV
edi
oAdPresenter.reportAddCoinMsg(activity, getAdMapVO(carrierType));
// ylhV
ide
oAdPresenter.reportAddCoinMsg(activity, getAdMapVO(carrierType));
// }
}
...
...
@@ -199,8 +197,8 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
}
if
(
ylhV
edi
oAdListener
!=
null
)
{
ylhV
edioAdListener
.
ylhVedi
oAdDownload
();
if
(
ylhV
ide
oAdListener
!=
null
)
{
ylhV
ideoAdListener
.
ylhVide
oAdDownload
();
}
}
...
...
@@ -213,10 +211,10 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView
public
void
onADClose
()
{
//激励视频广告被关闭
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
ylhV
edi
oAdPresenter
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_YLH
,
extraId
,
curCoin
));
ylhV
ide
oAdPresenter
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_YLH
,
extraId
,
curCoin
));
if
(
ylhV
edi
oAdListener
!=
null
)
{
ylhV
edioAdListener
.
ylhVedi
oAdSuccess
();
if
(
ylhV
ide
oAdListener
!=
null
)
{
ylhV
ideoAdListener
.
ylhVide
oAdSuccess
();
}
}
...
...
@@ -224,13 +222,13 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView
public
void
onError
(
AdError
adError
)
{
//广告流程出错,AdError中包含错误码和错误描述
if
(
adError
!=
null
)
{
LogUtil
.
d
(
"YlhV
edi
oAdManager"
,
"onError "
+
adError
.
getErrorCode
()
+
adError
.
getErrorMsg
());
LogUtil
.
d
(
"YlhV
ide
oAdManager"
,
"onError "
+
adError
.
getErrorCode
()
+
adError
.
getErrorMsg
());
// 0 成功 1失败 2点击 3-有效展示
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
adError
.
getErrorCode
()),
adError
.
getErrorMsg
());
}
if
(
ylhV
edi
oAdListener
!=
null
)
{
ylhV
edioAdListener
.
ylhVedi
oAdFail
();
if
(
ylhV
ide
oAdListener
!=
null
)
{
ylhV
ideoAdListener
.
ylhVide
oAdFail
();
}
}
});
...
...
@@ -238,15 +236,15 @@ public class YlhVedioAdManager extends BaseVedioAd implements VedioAdManagerView
rewardVideoAD
.
loadAD
();
}
public
void
setYlhV
edioAdListener
(
YlhVedioAdListener
ylhVedi
oAdListener
)
{
this
.
ylhV
edioAdListener
=
ylhVedi
oAdListener
;
public
void
setYlhV
ideoAdListener
(
YlhVideoAdListener
ylhVide
oAdListener
)
{
this
.
ylhV
ideoAdListener
=
ylhVide
oAdListener
;
}
public
interface
YlhV
edi
oAdListener
{
void
ylhV
edi
oAdFail
();
public
interface
YlhV
ide
oAdListener
{
void
ylhV
ide
oAdFail
();
void
ylhV
edi
oAdSuccess
();
void
ylhV
ide
oAdSuccess
();
void
ylhV
edi
oAdDownload
();
void
ylhV
ide
oAdDownload
();
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/common/AppConfig.java
View file @
175d5a63
...
...
@@ -64,17 +64,21 @@ public class AppConfig {
*/
public
static
int
ylhAdCount
=
5
;
/**
* csjV
edi
o 剩余广告播放数
* csjV
ide
o 剩余广告播放数
*/
public
static
int
csjV
edi
oAdCount
=
5
;
public
static
int
csjV
ide
oAdCount
=
5
;
/**
* wnV
edi
o 剩余广告播放数
* wnV
ide
o 剩余广告播放数
*/
public
static
int
wnV
edi
oAdCount
=
5
;
public
static
int
wnV
ide
oAdCount
=
5
;
/**
* flV
edi
o 剩余广告播放数
* flV
ide
o 剩余广告播放数
*/
public
static
int
flVedioAdCount
=
5
;
public
static
int
flVideoAdCount
=
5
;
/**
* shVideo 剩余广告播放数
*/
public
static
int
shVideoAdCount
=
5
;
/**
* 高额试玩任务标识
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
175d5a63
...
...
@@ -138,7 +138,7 @@ object Constant {
const
val
AD_SOURCE_YLH
=
"YLH"
const
val
AD_SOURCE_SDHZ
=
"SDHZ"
//闪电盒子
const
val
AD_SOURCE_FL
=
"FL"
//枫岚
const
val
AD_SOURCE_
TZ
=
"TZ
"
//天卓
const
val
AD_SOURCE_
SH
=
"SH
"
//天卓
// 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
const
val
EVENT_TYPE_ZERO
=
"0"
...
...
@@ -158,6 +158,7 @@ object Constant {
const
val
YLH_VEDIO_AD
=
"YLH_VEDIO_AD"
const
val
SDHZ_VEDIO_AD
=
"SDHZ_VEDIO_AD"
const
val
FL_VEDIO_AD
=
"Fl_VEDIO_AD"
const
val
SH_VEDIO_AD
=
"SH_VEDIO_AD"
// 游戏类型
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TzManager.kt
View file @
175d5a63
...
...
@@ -9,7 +9,7 @@ import com.tz.sdk.core.engine.ADEngineConfig
import
com.tz.sdk.core.engine.IADEngineState
/**
* 描述:天卓激励视频
* 描述:天卓
珊瑚
激励视频
*/
object
TzManager
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/DrawcashBean.java
View file @
175d5a63
...
...
@@ -84,7 +84,11 @@ public class DrawcashBean implements Serializable {
private
int
CSJ_VEDIO
;
private
int
YLH_VEDIO
;
private
int
FL_VEDIO
;
private
int
CORAL_VEDIO
;
public
int
getCORAL_VEDIO
()
{
return
CORAL_VEDIO
;
}
public
int
getSDHZ_VEDIO
()
{
return
SDHZ_VEDIO
;
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/MainV
edi
oMsgBean.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/MainV
ide
oMsgBean.java
View file @
175d5a63
...
...
@@ -2,7 +2,7 @@ package com.mints.goodmoney.mvp.model;
import
java.io.Serializable
;
public
class
MainV
edi
oMsgBean
implements
Serializable
{
public
class
MainV
ide
oMsgBean
implements
Serializable
{
private
boolean
toCreateReward
;
private
int
rewardDoubleCoin
;
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/VedioRulesBean.java
View file @
175d5a63
...
...
@@ -8,6 +8,7 @@ public class VedioRulesBean implements Serializable {
private
YlhVedioBean
YLH_VEDIO
;
private
SdhzVedioBean
SDHZ_VEDIO
;
private
FLVedioBean
FL_VEDIO
;
private
CORALVedioBean
CORAL_VEDIO
;
private
boolean
flVideoFlag
;
public
class
CsjVedioBean
implements
Serializable
{
...
...
@@ -62,6 +63,19 @@ public class VedioRulesBean implements Serializable {
}
}
public
class
CORALVedioBean
implements
Serializable
{
private
int
surplus
;
private
int
rate
;
public
int
getSurplus
()
{
return
surplus
;
}
public
int
getRate
()
{
return
rate
;
}
}
public
FLVedioBean
getFL_VEDIO
()
{
return
FL_VEDIO
;
}
...
...
@@ -78,6 +92,8 @@ public class VedioRulesBean implements Serializable {
return
SDHZ_VEDIO
;
}
public
CORALVedioBean
getCORAl_VIDEO
()
{
return
CORAL_VEDIO
;
}
public
boolean
isFlVideoFlag
()
{
return
flVideoFlag
;
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/V
edi
oAdingBean.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/V
ide
oAdingBean.java
View file @
175d5a63
...
...
@@ -2,7 +2,7 @@ package com.mints.goodmoney.mvp.model;
import
java.io.Serializable
;
public
class
V
edi
oAdingBean
implements
Serializable
{
public
class
V
ide
oAdingBean
implements
Serializable
{
private
int
downloadCoin
;
private
int
curCoin
;
private
String
carrierType
;
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/HomePresenter.kt
View file @
175d5a63
...
...
@@ -2,11 +2,10 @@ package com.mints.goodmoney.mvp.presenters
import
android.text.TextUtils
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.DeviceInfo
import
com.mints.goodmoney.manager.*
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.MainV
edi
oMsgBean
import
com.mints.goodmoney.mvp.model.MainV
ide
oMsgBean
import
com.mints.goodmoney.mvp.model.UserBean
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
import
com.mints.goodmoney.mvp.views.HomeView
...
...
@@ -92,7 +91,7 @@ class HomePresenter : BasePresenter<HomeView>() {
fun
getHomeVedioMsg
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getHomeVedioMsg
(),
object
:
BaseSubscriber
<
BaseResponse
<
MainV
edi
oMsgBean
>>()
{
object
:
BaseSubscriber
<
BaseResponse
<
MainV
ide
oMsgBean
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
}
...
...
@@ -101,7 +100,7 @@ class HomePresenter : BasePresenter<HomeView>() {
if
(
isLinkView
)
return
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
MainV
edi
oMsgBean
>)
{
override
fun
onNext
(
baseResponse
:
BaseResponse
<
MainV
ide
oMsgBean
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/HorizChannelPresenter.kt
View file @
175d5a63
...
...
@@ -2,7 +2,7 @@ package com.mints.goodmoney.mvp.presenters
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.model.MainV
edi
oMsgBean
import
com.mints.goodmoney.mvp.model.MainV
ide
oMsgBean
import
com.mints.goodmoney.mvp.views.HorizChannelView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
...
...
@@ -13,7 +13,7 @@ class HorizChannelPresenter : BasePresenter<HorizChannelView>() {
fun
getSmallHomeVedioBaseMsg
()
{
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
smallHomeVedioBaseMsg
,
object
:
BaseSubscriber
<
BaseResponse
<
MainV
edi
oMsgBean
>>()
{
object
:
BaseSubscriber
<
BaseResponse
<
MainV
ide
oMsgBean
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
}
...
...
@@ -22,7 +22,7 @@ class HorizChannelPresenter : BasePresenter<HorizChannelView>() {
if
(
isLinkView
)
return
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
MainV
edi
oMsgBean
>)
{
override
fun
onNext
(
baseResponse
:
BaseResponse
<
MainV
ide
oMsgBean
>)
{
if
(
isLinkView
)
return
val
code
=
baseResponse
.
getStatus
()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/KylV
edi
oPresenter.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/KylV
ide
oPresenter.kt
View file @
175d5a63
...
...
@@ -3,13 +3,12 @@ package com.mints.goodmoney.mvp.presenters
import
com.google.gson.JsonObject
import
com.mints.goodmoney.manager.AppHttpManager
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.views.BookView
import
com.mints.goodmoney.mvp.views.KylVedioView
import
com.mints.goodmoney.mvp.views.KylVideoView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
java.util.*
class
KylV
edioPresenter
:
BasePresenter
<
KylVedi
oView
>()
{
class
KylV
ideoPresenter
:
BasePresenter
<
KylVide
oView
>()
{
fun
addReadSeconds
(
seconds
:
Int
)
{
val
vo
=
HashMap
<
String
,
Any
>()
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/MhVedioAdPresenter.kt
View file @
175d5a63
...
...
@@ -3,14 +3,13 @@ package com.mints.goodmoney.mvp.presenters
import
android.app.Activity
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.views.V
edi
oAdManagerView
import
com.mints.goodmoney.mvp.views.V
ide
oAdManagerView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
rx.Subscription
import
rx.android.schedulers.AndroidSchedulers
import
java.util.*
class
MhV
edioAdPresenter
:
BasePresenter
<
Vedi
oAdManagerView
>()
{
class
MhV
ideoAdPresenter
:
BasePresenter
<
Vide
oAdManagerView
>()
{
fun
reportAddCoinMsg
(
activity
:
Activity
?,
vo
:
HashMap
<
String
,
Any
>)
{
if
(
activity
==
null
)
return
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/TzVideoAdPresenter.kt
View file @
175d5a63
...
...
@@ -3,14 +3,14 @@ package com.mints.goodmoney.mvp.presenters
import
android.app.Activity
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.views.V
edi
oAdManagerView
import
com.mints.goodmoney.mvp.views.V
ide
oAdManagerView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
rx.Subscription
import
rx.android.schedulers.AndroidSchedulers
import
java.util.*
class
TzVideoAdPresenter
:
BasePresenter
<
V
edi
oAdManagerView
>()
{
class
TzVideoAdPresenter
:
BasePresenter
<
V
ide
oAdManagerView
>()
{
fun
reportAddCoinMsg
(
activity
:
Activity
?,
vo
:
HashMap
<
String
,
Any
>)
{
if
(
activity
==
null
)
return
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/WnV
edi
oAdPresenter.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/WnV
ide
oAdPresenter.kt
View file @
175d5a63
...
...
@@ -3,14 +3,13 @@ package com.mints.goodmoney.mvp.presenters
import
android.app.Activity
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.mvp.model.BaseResponse
import
com.mints.goodmoney.mvp.views.V
edi
oAdManagerView
import
com.mints.goodmoney.mvp.views.V
ide
oAdManagerView
import
com.mints.library.net.neterror.BaseSubscriber
import
com.mints.library.net.neterror.Throwable
import
rx.Subscription
import
rx.android.schedulers.AndroidSchedulers
import
java.util.*
class
WnV
edioAdPresenter
:
BasePresenter
<
Vedi
oAdManagerView
>()
{
class
WnV
ideoAdPresenter
:
BasePresenter
<
Vide
oAdManagerView
>()
{
fun
reportAddCoinMsg
(
activity
:
Activity
?,
vo
:
HashMap
<
String
,
Any
>)
{
if
(
activity
==
null
)
return
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/YlhV
edi
oAdPresenter.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/YlhV
ide
oAdPresenter.java
View file @
175d5a63
...
...
@@ -4,7 +4,7 @@ import android.app.Activity;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.mvp.model.BaseResponse
;
import
com.mints.goodmoney.mvp.views.V
edi
oAdManagerView
;
import
com.mints.goodmoney.mvp.views.V
ide
oAdManagerView
;
import
com.mints.goodmoney.net.LoanService
;
import
com.mints.library.net.neterror.BaseSubscriber
;
import
com.mints.library.net.neterror.Throwable
;
...
...
@@ -14,7 +14,7 @@ import java.util.HashMap;
import
rx.Subscription
;
import
rx.android.schedulers.AndroidSchedulers
;
public
class
YlhV
edioAdPresenter
extends
BasePresenter
<
Vedi
oAdManagerView
>
{
public
class
YlhV
ideoAdPresenter
extends
BasePresenter
<
Vide
oAdManagerView
>
{
private
MintsApplication
loanApplication
;
private
LoanService
loanService
;
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/HomeView.kt
View file @
175d5a63
package
com.mints.goodmoney.mvp.views
import
com.mints.goodmoney.mvp.model.MainV
edi
oMsgBean
import
com.mints.goodmoney.mvp.model.MainV
ide
oMsgBean
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
interface
HomeView
:
BaseView
{
fun
getHallBaseMsgSuc
(
data
:
UserTaskMsgBean
)
fun
getHomeVedioMsgSuc
(
data
:
MainV
edi
oMsgBean
)
fun
getHomeVedioMsgSuc
(
data
:
MainV
ide
oMsgBean
)
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/HorizChannelView.kt
View file @
175d5a63
package
com.mints.goodmoney.mvp.views
import
com.mints.goodmoney.mvp.model.MainV
edi
oMsgBean
import
com.mints.goodmoney.mvp.model.MainV
ide
oMsgBean
interface
HorizChannelView
:
BaseView
{
fun
getHomeVedioMsgSuc
(
data
:
MainV
edi
oMsgBean
)
fun
getHomeVedioMsgSuc
(
data
:
MainV
ide
oMsgBean
)
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/KylV
edi
oView.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/KylV
ide
oView.kt
View file @
175d5a63
package
com.mints.goodmoney.mvp.views
import
com.mints.goodmoney.mvp.model.AccountMsgBean
interface
KylV
edi
oView
:
BaseView
{
interface
KylV
ide
oView
:
BaseView
{
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/V
edi
oAdManagerView.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/views/V
ide
oAdManagerView.java
View file @
175d5a63
package
com
.
mints
.
goodmoney
.
mvp
.
views
;
public
interface
V
edi
oAdManagerView
extends
BaseView
{
public
interface
V
ide
oAdManagerView
extends
BaseView
{
}
GoodMoney/app/src/main/java/com/mints/goodmoney/net/LoanService.java
View file @
175d5a63
...
...
@@ -13,7 +13,7 @@ import com.mints.goodmoney.mvp.model.FriendHallMsgBean;
import
com.mints.goodmoney.mvp.model.GoldRecordBean
;
import
com.mints.goodmoney.mvp.model.KylTabBean
;
import
com.mints.goodmoney.mvp.model.KylVedioBean
;
import
com.mints.goodmoney.mvp.model.MainV
edi
oMsgBean
;
import
com.mints.goodmoney.mvp.model.MainV
ide
oMsgBean
;
import
com.mints.goodmoney.mvp.model.MealBean
;
import
com.mints.goodmoney.mvp.model.MorningClockBean
;
import
com.mints.goodmoney.mvp.model.MyInfo
;
...
...
@@ -292,7 +292,7 @@ public interface LoanService {
* @return
*/
@POST
(
"api/getHomeVedioBaseMsg"
)
Observable
<
BaseResponse
<
MainV
edi
oMsgBean
>>
getHomeVedioMsg
();
Observable
<
BaseResponse
<
MainV
ide
oMsgBean
>>
getHomeVedioMsg
();
/**
* 横版视频信息
...
...
@@ -300,7 +300,7 @@ public interface LoanService {
* @return
*/
@POST
(
"api/getSmallHomeVedioBaseMsg"
)
Observable
<
BaseResponse
<
MainV
edi
oMsgBean
>>
getSmallHomeVedioBaseMsg
();
Observable
<
BaseResponse
<
MainV
ide
oMsgBean
>>
getSmallHomeVedioBaseMsg
();
/**
* 小说阅读时长
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
175d5a63
...
...
@@ -6,12 +6,12 @@ import android.view.KeyEvent
import
android.view.View
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.express.PreLoadExpressManager
import
com.mints.goodmoney.ad.v
edio.Vedi
oAdingManager
import
com.mints.goodmoney.ad.v
ideo.Vide
oAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.common.DeviceInfo.Companion.instance
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.V
edi
oAdingBean
import
com.mints.goodmoney.mvp.model.V
ide
oAdingBean
import
com.mints.goodmoney.mvp.presenters.AwardPresenter
import
com.mints.goodmoney.mvp.views.AwardView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
...
...
@@ -34,13 +34,13 @@ import java.util.*
*/
class
AwardActivity
:
BaseActivity
(),
AwardView
,
View
.
OnClickListener
{
private
lateinit
var
v
edioAdingManager
:
Vedi
oAdingManager
private
lateinit
var
v
ideoAdingManager
:
Vide
oAdingManager
private
val
awardPresenter
by
lazy
{
AwardPresenter
()
}
private
var
mTimer
:
CountDownTimerSupport
?
=
null
private
var
curCoin
=
0
//传入金币
private
var
extraId
=
""
//传入key
private
var
carrierType
=
""
//传入载体
private
var
loadV
edi
oFailCount
=
0
// 视频失败次数
private
var
loadV
ide
oFailCount
=
0
// 视频失败次数
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_award
...
...
@@ -53,7 +53,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
override
fun
initViewsAndEvents
()
{
awardPresenter
.
attachView
(
this
)
v
edioAdingManager
=
Vedi
oAdingManager
.
getInstance
(
this
)
v
ideoAdingManager
=
Vide
oAdingManager
.
getInstance
(
this
)
if
(!
AppConfig
.
app_black_flag
)
{
// 首次进行黑名单校验
...
...
@@ -347,8 +347,8 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
PreLoadExpressManager
.
onDestroy
()
flAwardAd
?.
removeAllViews
()
v
edioAdingManager
.
setVedi
oAdingListener
(
null
)
v
edi
oAdingManager
.
onDestory
()
v
ideoAdingManager
.
setVide
oAdingListener
(
null
)
v
ide
oAdingManager
.
onDestory
()
awardPresenter
.
detachView
()
}
...
...
@@ -371,12 +371,12 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
Constant
.
CARRIER_CHALLENGE_TURN
,
Constant
.
CARRIER_CHALLENGE_CARD
,
Constant
.
CARRIER_WALK_BUBBLE
,
Constant
.
CARRIER_EATMEAL_SUBSIDY
,
Constant
.
CARRIER_WALK
,
Constant
.
CARRIER_HOMEWATER
->
{
awardV
edi
o
()
awardV
ide
o
()
}
Constant
.
CARRIER_BLESSINGBAG_DOUBLE
,
Constant
.
CARRIER_CHALLENGE_SHAREFRIEND_DOUBLE
,
Constant
.
CARRIER_HOMEVEDIO_DOUBLE
,
Constant
.
CARRIER_SMALLHOMEVEDIO_DOUBLE
,
Constant
.
CARRIER_RUISHINEWS_DOUBLE
->
{
pushUmengEvent
()
awardV
edi
o
()
awardV
ide
o
()
}
Constant
.
CARRIER_NEW_VISITOR
->
{
readyGoThenKill
(
WxLoginActivity
::
class
.
java
)
...
...
@@ -392,53 +392,53 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
/**
* 获取激励视频
*/
private
fun
awardV
edi
o
()
{
if
(
v
edioAdingManager
.
getVedi
oFinishFlag
())
{
private
fun
awardV
ide
o
()
{
if
(
v
ideoAdingManager
.
getVide
oFinishFlag
())
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
showLoading
(
"加载中..."
)
val
bean
=
V
edi
oAdingBean
()
val
bean
=
V
ide
oAdingBean
()
bean
.
setCarrierType
(
carrierType
)
bean
.
setCurCoin
(
curCoin
)
bean
.
setExtraId
(
extraId
)
loadV
edio
(
vedi
oAdingManager
,
bean
,
true
)
loadV
ideo
(
vide
oAdingManager
,
bean
,
true
)
}
/**
* 加载激励视频
*/
private
fun
loadV
edio
(
vedioAdingManager
:
VedioAdingManager
,
bean
:
Vedi
oAdingBean
,
isFirstLoad
:
Boolean
)
{
v
edioAdingManager
.
setVedioAdingListener
(
object
:
VedioAdingManager
.
Vedi
oAdingListener
{
override
fun
v
edi
oAdingListenerError
(
adType
:
String
)
{
private
fun
loadV
ideo
(
videoAdingManager
:
VideoAdingManager
,
bean
:
Vide
oAdingBean
,
isFirstLoad
:
Boolean
)
{
v
ideoAdingManager
.
setVideoAdingListener
(
object
:
VideoAdingManager
.
Vide
oAdingListener
{
override
fun
v
ide
oAdingListenerError
(
adType
:
String
)
{
showToast
(
"加载超时,请休息一下"
)
hideLoading
()
}
override
fun
v
edi
oAdingListenerFail
(
adType
:
String
)
{
loadV
edi
oFailCount
++
if
(
loadV
edi
oFailCount
>=
2
)
{
override
fun
v
ide
oAdingListenerFail
(
adType
:
String
)
{
loadV
ide
oFailCount
++
if
(
loadV
ide
oFailCount
>=
2
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
loadV
edio
(
vedi
oAdingManager
,
bean
,
false
)
loadV
ideo
(
vide
oAdingManager
,
bean
,
false
)
}
}
override
fun
v
edi
oAdingListenerSuccess
(
adType
:
String
)
{
override
fun
v
ide
oAdingListenerSuccess
(
adType
:
String
)
{
hideLoading
()
v
edi
oAdingSuccess
(
adType
)
v
ide
oAdingSuccess
(
adType
)
}
})
if
(
isFirstLoad
)
{
// 首页按权重加载
v
edi
oAdingManager
.
loadAding
(
this
,
bean
)
v
ide
oAdingManager
.
loadAding
(
this
,
bean
)
}
else
{
// 失败按优先级加载
v
edi
oAdingManager
.
loadFailAding
(
this
,
bean
)
v
ide
oAdingManager
.
loadFailAding
(
this
,
bean
)
}
}
...
...
@@ -507,7 +507,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
/**
* 广告返回结果
*/
private
fun
v
edi
oAdingSuccess
(
adType
:
String
)
{
private
fun
v
ide
oAdingSuccess
(
adType
:
String
)
{
setAdFinshLayout
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/DrawcashActivity.kt
View file @
175d5a63
...
...
@@ -8,7 +8,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.v
edio.Vedi
oAdingManager
import
com.mints.goodmoney.ad.v
ideo.Vide
oAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.login.LoginApi
...
...
@@ -21,7 +21,6 @@ import com.mints.goodmoney.mvp.views.DrawcashView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.ui.adapter.DrawcashAdapter
import
com.mints.goodmoney.ui.adapter.listener.OnItemClickListener
import
com.mints.goodmoney.ui.widgets.DialogListener
import
com.mints.goodmoney.ui.widgets.DrawcashVideoDialog
import
com.mints.goodmoney.ui.widgets.JDTintDialog
import
com.mints.goodmoney.utils.LogUtil
...
...
@@ -45,7 +44,7 @@ class DrawcashActivity : BaseActivity(),
private
var
drawcashVideoDialog
:
DrawcashVideoDialog
?
=
null
private
lateinit
var
vedioAdingManager
:
V
edi
oAdingManager
private
lateinit
var
vedioAdingManager
:
V
ide
oAdingManager
private
val
drawcashPresenter
by
lazy
{
DrawcashPresenter
()
}
private
lateinit
var
drawcashAdapter
:
DrawcashAdapter
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
...
...
@@ -74,7 +73,7 @@ class DrawcashActivity : BaseActivity(),
tvDrawJd
.
setOnCheckedChangeListener
(
this
)
view_title
.
text
=
"提现规则"
vedioAdingManager
=
V
edi
oAdingManager
.
getInstance
(
this
)
vedioAdingManager
=
V
ide
oAdingManager
.
getInstance
(
this
)
drawcashPresenter
.
attachView
(
this
)
initListener
()
}
...
...
@@ -299,14 +298,18 @@ class DrawcashActivity : BaseActivity(),
* 设置视频权重
*/
private
fun
initAdWeight
(
data
:
DrawcashBean
.
VedioRules
)
{
vedioAdingManager
.
initAdWeight
(
data
.
csJ_VEDIO
,
data
.
ylH_VEDIO
,
data
.
sdhZ_VEDIO
,
data
.
fL_VEDIO
)
// vedioAdingManager?.initAdWeight(data.csJ_VEDIO, data.ylH_VEDIO, data.sdhZ_VEDIO)
LogUtil
.
d
(
TAG
,
"提现权重值:csjWeight:${data.csJ_VEDIO} ylhWeight:${data.ylH_VEDIO} sdhzWeight:${data.sdhZ_VEDIO} flWeight:${data.fL_VEDIO}"
)
vedioAdingManager
.
initAdWeight
(
data
.
csJ_VEDIO
,
data
.
ylH_VEDIO
,
data
.
sdhZ_VEDIO
,
data
.
fL_VEDIO
,
data
.
coraL_VEDIO
)
LogUtil
.
d
(
TAG
,
"提现权重值:csjWeight:${data.csJ_VEDIO} "
+
"ylhWeight:${data.ylH_VEDIO} "
+
"sdhzWeight:${data.sdhZ_VEDIO} "
+
"shWeight:${data.coraL_VEDIO} "
+
"flWeight:${data.fL_VEDIO}"
)
// 广告视频数
AppConfig
.
csjV
edi
oAdCount
=
10
AppConfig
.
csjV
ide
oAdCount
=
10
AppConfig
.
ylhAdCount
=
10
AppConfig
.
wnVedioAdCount
=
10
AppConfig
.
flVedioAdCount
=
10
AppConfig
.
wnVideoAdCount
=
10
AppConfig
.
flVideoAdCount
=
10
AppConfig
.
shVideoAdCount
=
10
}
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/KylV
edi
oActivity.kt
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/KylV
ide
oActivity.kt
View file @
175d5a63
...
...
@@ -9,72 +9,71 @@ import com.downloader.Error
import
com.downloader.OnDownloadListener
import
com.downloader.PRDownloader
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.v
edio.Vedi
oAdingManager
import
com.mints.goodmoney.ad.v
ideo.Vide
oAdingManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.mvp.model.VedioAdingBean
import
com.mints.goodmoney.mvp.presenters.GamePresenter
import
com.mints.goodmoney.mvp.presenters.KylVedioPresenter
import
com.mints.goodmoney.mvp.views.KylVedioView
import
com.mints.goodmoney.mvp.model.VideoAdingBean
import
com.mints.goodmoney.mvp.presenters.KylVideoPresenter
import
com.mints.goodmoney.mvp.views.KylVideoView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
import
com.mints.goodmoney.utils.CacheUtil
import
com.mints.goodmoney.utils.LogUtil
import
com.mints.goodmoney.utils.MD5
import
kotlinx.android.synthetic.main.activity_kyl_v
edi
o.*
import
kotlinx.android.synthetic.main.activity_kyl_v
ide
o.*
/**
* 描述:酷音乐视频
* 作者:孟崔广
* 时间:2021/1/4 15:09
*/
class
KylV
edioActivity
:
BaseActivity
(),
View
.
OnClickListener
,
KylVedi
oView
{
class
KylV
ideoActivity
:
BaseActivity
(),
View
.
OnClickListener
,
KylVide
oView
{
companion
object
{
const
val
V
EDIO_URL
=
"vedi
o_url"
const
val
V
IDEO_URL
=
"vide
o_url"
}
private
lateinit
var
v
edi
oUrl
:
String
private
lateinit
var
v
ide
oUrl
:
String
private
val
kylV
edioPresenter
by
lazy
{
KylVedi
oPresenter
()
}
private
lateinit
var
v
edioAdingManager
:
Vedi
oAdingManager
private
var
loadV
edi
oFailCount
=
0
private
val
kylV
ideoPresenter
by
lazy
{
KylVide
oPresenter
()
}
private
lateinit
var
v
ideoAdingManager
:
Vide
oAdingManager
private
var
loadV
ide
oFailCount
=
0
private
val
videoWallpaper
by
lazy
{
VideoWallpaper
()
}
private
var
downloadId
:
Int
=
-
1
//v
edi
o下载id
private
var
downloadV
edi
oSucFlag
=
false
// 下载视频成功
private
var
downloadId
:
Int
=
-
1
//v
ide
o下载id
private
var
downloadV
ide
oSucFlag
=
false
// 下载视频成功
private
var
cachePath
=
""
// cache路径
private
var
v
edi
oName
=
""
// 视频名称
private
var
v
ide
oName
=
""
// 视频名称
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_kyl_v
edi
o
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_kyl_v
ide
o
override
fun
isApplyKitKatTranslucency
()
=
false
override
fun
getBundleExtras
(
extras
:
Bundle
?)
{
super
.
getBundleExtras
(
extras
)
extras
?.
let
{
v
edioUrl
=
it
.
getString
(
VEDI
O_URL
,
""
)
v
ideoUrl
=
it
.
getString
(
VIDE
O_URL
,
""
)
}
}
override
fun
initViewsAndEvents
()
{
if
(
TextUtils
.
isEmpty
(
v
edi
oUrl
))
{
if
(
TextUtils
.
isEmpty
(
v
ide
oUrl
))
{
showToast
(
"加载失败,请稍后重试."
)
finish
()
return
}
cachePath
=
cacheDir
.
path
+
"/"
v
edioAdingManager
=
Vedi
oAdingManager
.
getInstance
(
this
)
v
ideoAdingManager
=
Vide
oAdingManager
.
getInstance
(
this
)
initListener
()
loadV
edio
(
vedi
oUrl
)
loadV
ideo
(
vide
oUrl
)
}
private
fun
loadV
edio
(
vedi
oUrl
:
String
)
{
jzvdStd
?.
setUp
(
v
edi
oUrl
,
""
)
private
fun
loadV
ideo
(
vide
oUrl
:
String
)
{
jzvdStd
?.
setUp
(
v
ide
oUrl
,
""
)
jzvdStd
?.
startVideo
()
// jzvdStd.setV
edi
oRestart(false)
// jzvdStd.setJzV
edioStatusListener(object : JZVideoPlayerStandardLoopVideo.JZVedi
oStatusListener {
// override fun jzV
edi
oPlaying() {
// jzvdStd.setV
ide
oRestart(false)
// jzvdStd.setJzV
ideoStatusListener(object : JZVideoPlayerStandardLoopVideo.JZVide
oStatusListener {
// override fun jzV
ide
oPlaying() {
// }
// })
}
...
...
@@ -112,22 +111,22 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView {
//删除缓存文件
CacheUtil
.
clearAllCache
(
context
)
kylV
edi
oPresenter
.
detachView
()
kylV
ide
oPresenter
.
detachView
()
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
ivBack
->
finish
()
R
.
id
.
ivSetting
->
{
awardV
edi
o
()
downloadV
edi
oToCacheFile
()
awardV
ide
o
()
downloadV
ide
oToCacheFile
()
}
}
}
private
fun
downloadV
edi
oToCacheFile
()
{
v
edi
oName
=
MD5
.
GetMD5Code
(
System
.
currentTimeMillis
().
toString
()
+
UserManager
.
getInstance
().
userID
)
+
".mp4"
downloadId
=
PRDownloader
.
download
(
v
edioUrl
,
cachePath
,
vedi
oName
)
private
fun
downloadV
ide
oToCacheFile
()
{
v
ide
oName
=
MD5
.
GetMD5Code
(
System
.
currentTimeMillis
().
toString
()
+
UserManager
.
getInstance
().
userID
)
+
".mp4"
downloadId
=
PRDownloader
.
download
(
v
ideoUrl
,
cachePath
,
vide
oName
)
.
build
()
// .setOnStartOrResumeListener { }
// .setOnPauseListener {
...
...
@@ -138,7 +137,7 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView {
// }
.
start
(
object
:
OnDownloadListener
{
override
fun
onDownloadComplete
()
{
downloadV
edi
oSucFlag
=
true
downloadV
ide
oSucFlag
=
true
}
override
fun
onError
(
error
:
Error
)
{
...
...
@@ -155,59 +154,59 @@ class KylVedioActivity : BaseActivity(), View.OnClickListener, KylVedioView {
/**
* 获取激励视频
*/
private
fun
awardV
edi
o
()
{
if
(
v
edioAdingManager
.
vedi
oFinishFlag
)
{
private
fun
awardV
ide
o
()
{
if
(
v
ideoAdingManager
.
vide
oFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
loadV
edi
oFailCount
=
0
loadV
ide
oFailCount
=
0
showLoading
(
"加载中..."
)
val
bean
=
V
edi
oAdingBean
()
val
bean
=
V
ide
oAdingBean
()
bean
.
carrierType
=
Constant
.
CARRIER_KUYINYUE_VEDIO
loadV
edio
(
vedi
oAdingManager
,
bean
,
true
)
loadV
ideo
(
vide
oAdingManager
,
bean
,
true
)
}
/**
* 加载激励视频
*/
private
fun
loadV
edio
(
vedioAdingManager
:
VedioAdingManager
,
bean
:
Vedi
oAdingBean
,
isFirstLoad
:
Boolean
)
{
v
edioAdingManager
.
setVedioAdingListener
(
object
:
VedioAdingManager
.
Vedi
oAdingListener
{
override
fun
v
edi
oAdingListenerError
(
adType
:
String
)
{
private
fun
loadV
ideo
(
videoAdingManager
:
VideoAdingManager
,
bean
:
Vide
oAdingBean
,
isFirstLoad
:
Boolean
)
{
v
ideoAdingManager
.
setVideoAdingListener
(
object
:
VideoAdingManager
.
Vide
oAdingListener
{
override
fun
v
ide
oAdingListenerError
(
adType
:
String
)
{
showToast
(
"加载超时,请休息一下"
)
hideLoading
()
}
override
fun
v
edi
oAdingListenerFail
(
adType
:
String
)
{
loadV
edi
oFailCount
++
if
(
loadV
edi
oFailCount
>=
2
)
{
override
fun
v
ide
oAdingListenerFail
(
adType
:
String
)
{
loadV
ide
oFailCount
++
if
(
loadV
ide
oFailCount
>=
2
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
loadV
edio
(
vedi
oAdingManager
,
bean
,
false
)
loadV
ideo
(
vide
oAdingManager
,
bean
,
false
)
}
}
override
fun
v
edi
oAdingListenerSuccess
(
adType
:
String
)
{
override
fun
v
ide
oAdingListenerSuccess
(
adType
:
String
)
{
hideLoading
()
v
edi
oAdingSuccess
(
adType
)
v
ide
oAdingSuccess
(
adType
)
}
})
if
(
isFirstLoad
)
{
// 首页按权重加载
v
edi
oAdingManager
.
loadAding
(
this
,
bean
)
v
ide
oAdingManager
.
loadAding
(
this
,
bean
)
}
else
{
// 失败按优先级加载
v
edi
oAdingManager
.
loadFailAding
(
this
,
bean
)
v
ide
oAdingManager
.
loadFailAding
(
this
,
bean
)
}
}
private
fun
v
edi
oAdingSuccess
(
adType
:
String
)
{
if
(
downloadV
edi
oSucFlag
)
{
LogUtil
.
d
(
"KylV
edioActivity"
,
"name:-->"
+
cachePath
+
vedi
oName
)
private
fun
v
ide
oAdingSuccess
(
adType
:
String
)
{
if
(
downloadV
ide
oSucFlag
)
{
LogUtil
.
d
(
"KylV
ideoActivity"
,
"name:-->"
+
cachePath
+
vide
oName
)
try
{
showToast
(
"设置壁纸成功"
)
videoWallpaper
.
setToWallPaper
(
this
,
cachePath
+
v
edi
oName
)
videoWallpaper
.
setToWallPaper
(
this
,
cachePath
+
v
ide
oName
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MainActivity.kt
View file @
175d5a63
...
...
@@ -10,7 +10,7 @@ import androidx.fragment.app.FragmentManager
import
androidx.fragment.app.FragmentTransaction
import
com.ireader.ireadersdk.IreaderApi
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.v
edio.Vedi
oAdingManager
import
com.mints.goodmoney.ad.v
ideo.Vide
oAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
...
...
@@ -72,8 +72,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
super
.
onDestroy
()
TTPreLoadCarrierExpressManager
.
getInstance
().
onDestroy
()
V
edioAdingManager
.
getInstance
(
this
).
setVedi
oAdingListener
(
null
)
V
edi
oAdingManager
.
getInstance
(
this
).
onDestory
()
V
ideoAdingManager
.
getInstance
(
this
).
setVide
oAdingListener
(
null
)
V
ide
oAdingManager
.
getInstance
(
this
).
onDestory
()
}
public
override
fun
onSaveInstanceState
(
outState
:
Bundle
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/MorningClockActivity.kt
View file @
175d5a63
...
...
@@ -4,12 +4,12 @@ import android.os.Bundle
import
android.view.View
import
androidx.recyclerview.widget.GridLayoutManager
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.v
edio.Vedi
oAdingManager
import
com.mints.goodmoney.ad.v
ideo.Vide
oAdingManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import
com.mints.goodmoney.manager.TtCsjAdManager
import
com.mints.goodmoney.mvp.model.MorningClockBean
import
com.mints.goodmoney.mvp.model.V
edi
oAdingBean
import
com.mints.goodmoney.mvp.model.V
ide
oAdingBean
import
com.mints.goodmoney.mvp.presenters.MorningClockPresenter
import
com.mints.goodmoney.mvp.views.MorningClockView
import
com.mints.goodmoney.ui.activitys.base.BaseActivity
...
...
@@ -29,8 +29,8 @@ class MorningClockActivity : BaseActivity()
private
lateinit
var
morningClockAdapter
:
MorningClockAdapter
private
var
morningClockList
:
MutableList
<
MorningClockBean
.
MorningClockTargetBean
>?
=
null
private
lateinit
var
v
edioAdingManager
:
Vedi
oAdingManager
private
var
loadV
edi
oFailCount
=
0
private
lateinit
var
v
ideoAdingManager
:
Vide
oAdingManager
private
var
loadV
ide
oFailCount
=
0
private
var
morningClockBean
:
MorningClockBean
?
=
null
override
fun
getContentViewLayoutID
()
=
R
.
layout
.
activity_morning_clock
...
...
@@ -38,7 +38,7 @@ class MorningClockActivity : BaseActivity()
override
fun
isApplyKitKatTranslucency
()
=
false
override
fun
initViewsAndEvents
()
{
v
edioAdingManager
=
Vedi
oAdingManager
.
getInstance
(
this
)
v
ideoAdingManager
=
Vide
oAdingManager
.
getInstance
(
this
)
initListener
()
morningClockPresenter
.
attachView
(
this
)
...
...
@@ -60,7 +60,7 @@ class MorningClockActivity : BaseActivity()
when
(
v
?.
id
)
{
R
.
id
.
ivMorningClockBack
->
finish
()
R
.
id
.
tvMorningClockClick
->
{
awardV
edi
o
()
awardV
ide
o
()
// 预加载信息流
TTPreLoadCarrierExpressManager
.
getInstance
().
loadTtFrameLayout
(
TtCsjAdManager
.
TT_AD_NATIVEEXPRESS_MORNINGCLOCK
)
...
...
@@ -106,54 +106,54 @@ class MorningClockActivity : BaseActivity()
/**
* 获取激励视频
*/
private
fun
awardV
edi
o
()
{
if
(
v
edioAdingManager
.
vedi
oFinishFlag
)
{
private
fun
awardV
ide
o
()
{
if
(
v
ideoAdingManager
.
vide
oFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
showLoading
(
"加载中..."
)
val
bean
=
V
edi
oAdingBean
()
val
bean
=
V
ide
oAdingBean
()
bean
.
carrierType
=
Constant
.
CARRIER_MORNING_CLOCK
loadV
edio
(
vedi
oAdingManager
,
bean
,
true
)
loadV
ideo
(
vide
oAdingManager
,
bean
,
true
)
}
/**
* 加载激励视频
*/
private
fun
loadV
edio
(
vedioAdingManager
:
VedioAdingManager
,
bean
:
Vedi
oAdingBean
,
isFirstLoad
:
Boolean
)
{
v
edioAdingManager
.
setVedioAdingListener
(
object
:
VedioAdingManager
.
Vedi
oAdingListener
{
override
fun
v
edi
oAdingListenerError
(
adType
:
String
)
{
private
fun
loadV
ideo
(
videoAdingManager
:
VideoAdingManager
,
bean
:
Vide
oAdingBean
,
isFirstLoad
:
Boolean
)
{
v
ideoAdingManager
.
setVideoAdingListener
(
object
:
VideoAdingManager
.
Vide
oAdingListener
{
override
fun
v
ide
oAdingListenerError
(
adType
:
String
)
{
showToast
(
"加载超时,请休息一下"
)
hideLoading
()
}
override
fun
v
edi
oAdingListenerFail
(
adType
:
String
)
{
loadV
edi
oFailCount
++
if
(
loadV
edi
oFailCount
>=
2
)
{
override
fun
v
ide
oAdingListenerFail
(
adType
:
String
)
{
loadV
ide
oFailCount
++
if
(
loadV
ide
oFailCount
>=
2
)
{
hideLoading
()
showToast
(
"加载失败,请稍后重试!"
)
}
else
{
loadV
edio
(
vedi
oAdingManager
,
bean
,
false
)
loadV
ideo
(
vide
oAdingManager
,
bean
,
false
)
}
}
override
fun
v
edi
oAdingListenerSuccess
(
adType
:
String
)
{
override
fun
v
ide
oAdingListenerSuccess
(
adType
:
String
)
{
hideLoading
()
v
edi
oAdingSuccess
(
adType
)
v
ide
oAdingSuccess
(
adType
)
}
})
if
(
isFirstLoad
)
{
// 首页按权重加载
v
edi
oAdingManager
.
loadAding
(
this
,
bean
)
v
ide
oAdingManager
.
loadAding
(
this
,
bean
)
}
else
{
// 失败按优先级加载
v
edi
oAdingManager
.
loadFailAding
(
this
,
bean
)
v
ide
oAdingManager
.
loadFailAding
(
this
,
bean
)
}
}
private
fun
v
edi
oAdingSuccess
(
adType
:
String
)
{
private
fun
v
ide
oAdingSuccess
(
adType
:
String
)
{
try
{
if
(
morningClockList
!=
null
&&
morningClockList
!!
.
size
>
0
)
{
for
(
morningBean
in
morningClockList
!!
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
View file @
175d5a63
...
...
@@ -13,7 +13,7 @@ import androidx.core.content.ContextCompat
import
cn.sharesdk.framework.ShareSDK
import
cn.sharesdk.wechat.friends.Wechat
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.v
edi
o.TzVideoAdManager
import
com.mints.goodmoney.ad.v
ide
o.TzVideoAdManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.login.LoginApi
import
com.mints.goodmoney.login.OnLoginListener
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/TaskActivity.kt
View file @
175d5a63
...
...
@@ -78,7 +78,7 @@ class TaskActivity : BaseActivity(), OnItemClickListener, OnRefreshListener, Cor
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
ic_arrow_back
)
mCoralDownload
=
CoralDownload
(
CoralDownload
.
RELEASE_TASK_TYPE
).
setOnAdLoadListener
(
this
)
mCoralDownload
=
CoralDownload
().
setOnAdLoadListener
(
this
)
CacheUtil
.
clearAllCache
(
context
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/HorizonChannelFragment.kt
View file @
175d5a63
...
...
@@ -14,7 +14,7 @@ import com.daimajia.androidanimations.library.YoYo
import
com.mints.goodmoney.R
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.mvp.model.MainV
edi
oMsgBean
import
com.mints.goodmoney.mvp.model.MainV
ide
oMsgBean
import
com.mints.goodmoney.mvp.presenters.HorizChannelPresenter
import
com.mints.goodmoney.mvp.views.HorizChannelView
import
com.mints.goodmoney.ui.activitys.AwardActivity
...
...
@@ -131,8 +131,8 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
rope
=
null
}
cdvvYilanTime
?.
setCountDownV
edi
oListener
(
null
)
cdvvYilanTime
?.
onDest
or
y
()
cdvvYilanTime
?.
setCountDownV
ide
oListener
(
null
)
cdvvYilanTime
?.
onDest
ro
y
()
super
.
onDestroyView
()
}
...
...
@@ -165,7 +165,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
}
}
override
fun
getHomeVedioMsgSuc
(
data
:
MainV
edi
oMsgBean
)
{
override
fun
getHomeVedioMsgSuc
(
data
:
MainV
ide
oMsgBean
)
{
if
(
activity
==
null
||
requireActivity
().
isFinishing
)
{
return
}
...
...
@@ -208,7 +208,7 @@ class HorizonChannelFragment : BaseFragment(), HorizChannelView, View.OnClickLis
* 红包倒计时初始化
*/
private
fun
initTimeView
()
{
cdvvYilanTime
.
setCountDownV
edi
oListener
{
cdvvYilanTime
.
setCountDownV
ide
oListener
{
if
(
isFirstWatchVideo
)
{
// 第一次观看完视频提醒用户
vs_tips
.
visibility
=
View
.
VISIBLE
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/KuYinYuePageFragment.kt
View file @
175d5a63
...
...
@@ -7,14 +7,12 @@ import com.mints.goodmoney.mvp.model.Data
import
com.mints.goodmoney.mvp.model.KylVedioBean
import
com.mints.goodmoney.mvp.presenters.KuYinYuePagePresenter
import
com.mints.goodmoney.mvp.views.KuYinYuePageView
import
com.mints.goodmoney.ui.activitys.KylVedioActivity
import
com.mints.goodmoney.ui.activitys.XmlyPlayActivity
import
com.mints.goodmoney.ui.activitys.KylVideoActivity
import
com.mints.goodmoney.ui.adapter.KylPageAdapter
import
com.mints.goodmoney.ui.fragment.base.LazyLoadBaseFragment
import
com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
com.ximalaya.ting.android.opensdk.model.album.Album
import
kotlinx.android.synthetic.main.fragment_main_kyl_page.*
/**
...
...
@@ -58,8 +56,8 @@ class KuYinYuePageFragment(private val targetid: String) : LazyLoadBaseFragment(
override
fun
onItemClick
(
position
:
Int
)
{
if
(
kylData
!=
null
&&
kylData
.
size
>
0
)
{
val
bundle
=
Bundle
()
bundle
.
putString
(
KylV
edioActivity
.
VEDI
O_URL
,
kylData
[
position
].
url
)
readyGo
(
KylV
edi
oActivity
::
class
.
java
,
bundle
)
bundle
.
putString
(
KylV
ideoActivity
.
VIDE
O_URL
,
kylData
[
position
].
url
)
readyGo
(
KylV
ide
oActivity
::
class
.
java
,
bundle
)
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
175d5a63
...
...
@@ -16,11 +16,11 @@ import com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.express.PreLoadExpressManager
import
com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager
import
com.mints.goodmoney.ad.v
edio.Vedi
oAdingManager
import
com.mints.goodmoney.ad.v
ideo.Vide
oAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.*
import
com.mints.goodmoney.mvp.model.MainV
edi
oMsgBean
import
com.mints.goodmoney.mvp.model.MainV
ide
oMsgBean
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
import
com.mints.goodmoney.mvp.presenters.HomePresenter
import
com.mints.goodmoney.mvp.views.HomeView
...
...
@@ -67,15 +67,15 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
private
var
rewardCoin
=
0
// 小金币
private
var
littleVideoFragment
:
YLLittleVideoFragment
?
=
null
private
val
videoMaxCount
=
12
// 当前缓存视频id最大数
private
val
v
edi
oIdList
by
lazy
{
ArrayList
<
String
>()
}
//记录播放的视频id
private
val
v
ide
oIdList
by
lazy
{
ArrayList
<
String
>()
}
//记录播放的视频id
private
var
isToCreateReward
=
true
// 是否还有剩余红包 服务器返回
private
var
isFirstLoadV
edi
o
=
true
// 首次加载视频初始化 本地判断
private
var
isFirstLoadV
ide
o
=
true
// 首次加载视频初始化 本地判断
private
var
isAward
=
false
// 是否可以领金币 本地判断
private
var
isFirstWatchVideo
=
true
// 是否是第一次观看完视频
// 广告权重相关
private
var
v
edioAdingManager
:
Vedi
oAdingManager
?
=
null
private
var
v
ideoAdingManager
:
Vide
oAdingManager
?
=
null
// 福袋相关
private
var
rope
:
YoYoString
?
=
null
...
...
@@ -88,7 +88,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override
fun
initViewsAndEvents
()
{
homePresenter
.
attachView
(
this
)
v
edioAdingManager
=
Vedi
oAdingManager
.
getInstance
(
activity
)
v
ideoAdingManager
=
Vide
oAdingManager
.
getInstance
(
activity
)
// 奖励页预加载 信息流广告
PreLoadExpressManager
.
loadADFrameLayout
()
...
...
@@ -139,7 +139,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
if
(
isToCreateReward
)
{
// 防止界面切换 重置红包动画
// 好兔视频已加载 且 红包已转满
if
(!
isFirstLoadV
edi
o
&&
!
cdvvYilanTime
.
isPlaying
)
{
if
(!
isFirstLoadV
ide
o
&&
!
cdvvYilanTime
.
isPlaying
)
{
cdvvYilanTime
.
startAnim
()
}
}
...
...
@@ -174,7 +174,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
if
(
isToCreateReward
)
{
// 防止界面切换 重置红包动画
// 好兔视频已加载 且 红包已转满
if
(!
isFirstLoadV
edi
o
&&
!
cdvvYilanTime
.
isPlaying
)
{
if
(!
isFirstLoadV
ide
o
&&
!
cdvvYilanTime
.
isPlaying
)
{
cdvvYilanTime
.
stopAnim
()
}
}
...
...
@@ -191,8 +191,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
rope
=
null
}
cdvvYilanTime
?.
onDest
or
y
()
cdvvYilanTime
?.
setCountDownV
edi
oListener
(
null
)
cdvvYilanTime
?.
onDest
ro
y
()
cdvvYilanTime
?.
setCountDownV
ide
oListener
(
null
)
super
.
onDestroyView
()
}
...
...
@@ -252,7 +252,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
}
}
override
fun
getHomeVedioMsgSuc
(
data
:
MainV
edi
oMsgBean
)
{
override
fun
getHomeVedioMsgSuc
(
data
:
MainV
ide
oMsgBean
)
{
if
(
activity
==
null
||
requireActivity
().
isFinishing
)
{
return
}
...
...
@@ -266,7 +266,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
if
(
isToCreateReward
)
{
// 防止界面切换 重置倒计时
// 好兔视频已加载 且 红包已转满 且 奖励已领过
if
(!
isFirstLoadV
edi
o
&&
!
cdvvYilanTime
.
isPlaying
&&
!
isAward
)
{
if
(!
isFirstLoadV
ide
o
&&
!
cdvvYilanTime
.
isPlaying
&&
!
isAward
)
{
cdvvYilanTime
?.
stopRedbox
()
cdvvYilanTime
?.
reset
()
cdvvYilanTime
?.
start
()
...
...
@@ -333,8 +333,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
YLPlayerConfig
.
config
().
registerPlayerCallBack
(
object
:
OnPlayerCallBack
{
override
fun
onStart
(
pager
:
String
,
videoid
:
String
,
p2
:
String
?)
{
// 防止网络异常时, 第一次加载倒计时红包
if
(
isFirstLoadV
edi
o
)
{
isFirstLoadV
edi
o
=
false
if
(
isFirstLoadV
ide
o
)
{
isFirstLoadV
ide
o
=
false
initTimeview
()
}
else
{
resumeDownloadTime
(
videoid
)
...
...
@@ -355,7 +355,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
override
fun
onLoopComplete
(
pager
:
String
?,
videoID
:
String
,
taskID
:
String
?,
num
:
Int
)
{
// LogUtil.d(TAG, "registerPlayerCallBack onLoopComplete")
addV
edi
oIdList
(
videoID
)
addV
ide
oIdList
(
videoID
)
pauseDownloadTime
()
}
...
...
@@ -445,12 +445,12 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
/**
* 将播放的id记录到list中
*/
private
fun
addV
edi
oIdList
(
id
:
String
)
{
private
fun
addV
ide
oIdList
(
id
:
String
)
{
// 达到12个视频时 删除前10个记录
if
(
v
edi
oIdList
.
size
>=
videoMaxCount
)
{
v
edi
oIdList
.
subList
(
0
,
10
).
clear
()
if
(
v
ide
oIdList
.
size
>=
videoMaxCount
)
{
v
ide
oIdList
.
subList
(
0
,
10
).
clear
()
}
if
(!
v
edioIdList
.
contains
(
id
))
vedi
oIdList
.
add
(
id
)
if
(!
v
ideoIdList
.
contains
(
id
))
vide
oIdList
.
add
(
id
)
}
/**
...
...
@@ -465,7 +465,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
*/
private
fun
resumeDownloadTime
(
id
:
String
)
{
if
(!
TextUtils
.
isEmpty
(
id
))
{
if
(
v
edi
oIdList
.
contains
(
id
))
{
if
(
v
ide
oIdList
.
contains
(
id
))
{
cdvvYilanTime
?.
pause
()
return
}
...
...
@@ -488,7 +488,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 红包倒计时初始化
*/
private
fun
initTimeview
()
{
cdvvYilanTime
?.
setCountDownV
edi
oListener
{
cdvvYilanTime
?.
setCountDownV
ide
oListener
{
if
(
isFirstWatchVideo
)
{
// 第一次观看完视频提醒用户
vs_tips
?.
visibility
=
View
.
VISIBLE
...
...
@@ -503,8 +503,8 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
cdvvYilanTime
?.
showRedbox
()
stopDownloadTime
()
}
val
v
edi
oTime
=
ps
.
getInt
(
Constant
.
MAIN_VEDIO_TIME
,
30
)
cdvvYilanTime
?.
setTime
(
v
edi
oTime
)
val
v
ide
oTime
=
ps
.
getInt
(
Constant
.
MAIN_VEDIO_TIME
,
30
)
cdvvYilanTime
?.
setTime
(
v
ide
oTime
)
cdvvYilanTime
?.
start
()
}
...
...
@@ -565,16 +565,23 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
* 设置视频权重
*/
private
fun
initAdWeight
(
data
:
UserTaskMsgBean
)
{
vedioAdingManager
?.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate}"
+
" sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate}"
)
videoAdingManager
?.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate}"
)
// 广告视频数
AppConfig
.
csjV
edi
oAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
csjV
ide
oAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
ylhAdCount
=
data
.
vedioRules
.
ylH_VEDIO
.
surplus
AppConfig
.
wnVedioAdCount
=
data
.
vedioRules
.
sdhZ_VEDIO
.
surplus
AppConfig
.
flVedioAdCount
=
data
.
vedioRules
.
fL_VEDIO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount}"
+
" sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount}"
)
AppConfig
.
wnVideoAdCount
=
data
.
vedioRules
.
sdhZ_VEDIO
.
surplus
AppConfig
.
flVideoAdCount
=
data
.
vedioRules
.
fL_VEDIO
.
surplus
AppConfig
.
shVideoAdCount
=
data
.
vedioRules
.
corAl_VIDEO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount}"
)
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
175d5a63
...
...
@@ -13,12 +13,11 @@ import androidx.recyclerview.widget.DividerItemDecoration
import
com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open
import
com.fly.scenemodule.SceneUtil
import
com.mints.goodmoney.BuildConfig
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.banner.BannerManager
import
com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import
com.mints.goodmoney.ad.express.TTPreLoadExpressXmlyManager
import
com.mints.goodmoney.ad.v
edio.Vedi
oAdingManager
import
com.mints.goodmoney.ad.v
ideo.Vide
oAdingManager
import
com.mints.goodmoney.common.AppConfig
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.*
...
...
@@ -57,6 +56,8 @@ import net.grandcentrix.tray.AppPreferences
import
java.math.BigDecimal
import
java.util.*
private
val
TAG
=
MyFragment
::
class
.
java
.
simpleName
/**
* 描述:我
* 作者:孟崔广
...
...
@@ -70,12 +71,10 @@ class MyFragment : BaseFragment(),
View
.
OnClickListener
,
AdapterView
.
OnItemClickListener
{
private
val
TAG
=
MyFragment
::
class
.
java
.
simpleName
private
val
ps
by
lazy
{
AppPreferences
(
context
)
}
private
val
myPresenter
by
lazy
{
MyPresenter
()
}
private
val
userManager
by
lazy
{
UserManager
.
getInstance
()
}
private
lateinit
var
vedioAdingManager
:
V
edi
oAdingManager
private
lateinit
var
vedioAdingManager
:
V
ide
oAdingManager
private
var
loadVedioFailCount
=
0
private
var
userConfig
:
MyInfo
?
=
null
...
...
@@ -910,7 +909,7 @@ class MyFragment : BaseFragment(),
* 获取激励视频
*/
private
fun
awardVedio
(
coin
:
Int
,
carrierType
:
String
)
{
if
(
vedioAdingManager
.
v
edi
oFinishFlag
)
{
if
(
vedioAdingManager
.
v
ide
oFinishFlag
)
{
showToast
(
"今日视频已看完,请明天再来吧"
)
return
}
...
...
@@ -918,7 +917,7 @@ class MyFragment : BaseFragment(),
loadVedioFailCount
=
0
showLoading
(
"加载中..."
)
val
bean
=
V
edi
oAdingBean
()
val
bean
=
V
ide
oAdingBean
()
bean
.
carrierType
=
carrierType
bean
.
curCoin
=
coin
...
...
@@ -928,14 +927,14 @@ class MyFragment : BaseFragment(),
/**
* 加载激励视频
*/
private
fun
loadVideo
(
videoAdingManager
:
V
edioAdingManager
,
bean
:
Vedi
oAdingBean
,
isFirstLoad
:
Boolean
)
{
videoAdingManager
.
setV
edioAdingListener
(
object
:
VedioAdingManager
.
Vedi
oAdingListener
{
override
fun
v
edi
oAdingListenerError
(
adType
:
String
)
{
private
fun
loadVideo
(
videoAdingManager
:
V
ideoAdingManager
,
bean
:
Vide
oAdingBean
,
isFirstLoad
:
Boolean
)
{
videoAdingManager
.
setV
ideoAdingListener
(
object
:
VideoAdingManager
.
Vide
oAdingListener
{
override
fun
v
ide
oAdingListenerError
(
adType
:
String
)
{
showToast
(
"加载超时,请休息一下"
)
hideLoading
()
}
override
fun
v
edi
oAdingListenerFail
(
adType
:
String
)
{
override
fun
v
ide
oAdingListenerFail
(
adType
:
String
)
{
loadVedioFailCount
++
if
(
loadVedioFailCount
>=
2
)
{
hideLoading
()
...
...
@@ -945,7 +944,7 @@ class MyFragment : BaseFragment(),
}
}
override
fun
v
edi
oAdingListenerSuccess
(
adType
:
String
)
{
override
fun
v
ide
oAdingListenerSuccess
(
adType
:
String
)
{
hideLoading
()
videoAdingSuccess
(
adType
)
}
...
...
@@ -996,7 +995,7 @@ class MyFragment : BaseFragment(),
private
fun
initManager
()
{
BannerManager
.
init
()
vedioAdingManager
=
V
edi
oAdingManager
.
getInstance
(
activity
)
vedioAdingManager
=
V
ide
oAdingManager
.
getInstance
(
activity
)
if
(!
TextUtils
.
isEmpty
(
userManager
.
userID
))
{
// 登录成功的用户初始化鱼丸盒子
...
...
@@ -1046,14 +1045,23 @@ class MyFragment : BaseFragment(),
* 设置视频权重
*/
private
fun
initAdWeight
(
data
:
UserTaskMsgBean
)
{
vedioAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} flWeight:${data.vedioRules.fL_VEDIO.rate}"
)
vedioAdingManager
.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
data
.
vedioRules
.
sdhZ_VEDIO
.
rate
,
data
.
vedioRules
.
fL_VEDIO
.
rate
,
data
.
vedioRules
.
corAl_VIDEO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} "
+
"ylhWeight:${data.vedioRules.ylH_VEDIO.rate} "
+
"sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate} "
+
"shWeight:${data.vedioRules.corAl_VIDEO.rate} "
+
"flWeight:${data.vedioRules.fL_VEDIO.rate}"
)
// 广告视频数
AppConfig
.
csjV
edi
oAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
csjV
ide
oAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
ylhAdCount
=
data
.
vedioRules
.
ylH_VEDIO
.
surplus
AppConfig
.
wnVedioAdCount
=
data
.
vedioRules
.
sdhZ_VEDIO
.
surplus
AppConfig
.
flVedioAdCount
=
data
.
vedioRules
.
fL_VEDIO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount} sdhzCount:${AppConfig.wnVedioAdCount} flCount:${AppConfig.flVedioAdCount}"
)
AppConfig
.
wnVideoAdCount
=
data
.
vedioRules
.
sdhZ_VEDIO
.
surplus
AppConfig
.
flVideoAdCount
=
data
.
vedioRules
.
fL_VEDIO
.
surplus
AppConfig
.
shVideoAdCount
=
data
.
vedioRules
.
corAl_VIDEO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVideoAdCount} "
+
"ylhCount:${AppConfig.ylhAdCount} "
+
"sdhzCount:${AppConfig.wnVideoAdCount} "
+
"shCount:${AppConfig.shVideoAdCount} "
+
"flCount:${AppConfig.flVideoAdCount}"
)
}
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/CountDownV
edi
oView.java
→
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/CountDownV
ide
oView.java
View file @
175d5a63
...
...
@@ -13,9 +13,9 @@ import com.daimajia.androidanimations.library.YoYo;
import
com.mints.goodmoney.R
;
public
class
CountDownV
edi
oView
extends
LinearLayout
{
public
class
CountDownV
ide
oView
extends
LinearLayout
{
private
CountDownV
edioListener
countDownVedi
oListener
;
private
CountDownV
ideoListener
countDownVide
oListener
;
private
CountDownView
cdCountVedioView
;
private
ImageView
ivCountVedioRedbox
;
...
...
@@ -23,15 +23,15 @@ public class CountDownVedioView extends LinearLayout {
private
boolean
isPlaying
=
false
;
private
YoYo
.
YoYoString
rope
;
public
CountDownV
edi
oView
(
Context
context
)
{
public
CountDownV
ide
oView
(
Context
context
)
{
this
(
context
,
null
);
}
public
CountDownV
edi
oView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
public
CountDownV
ide
oView
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
0
);
}
public
CountDownV
edi
oView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
public
CountDownV
ide
oView
(
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
initView
(
context
);
...
...
@@ -47,8 +47,8 @@ public class CountDownVedioView extends LinearLayout {
private
void
initListener
()
{
cdCountVedioView
.
setOnLoadingFinishListener
(()
->
{
if
(
countDownV
edi
oListener
!=
null
)
{
countDownV
edi
oListener
.
finish
();
if
(
countDownV
ide
oListener
!=
null
)
{
countDownV
ide
oListener
.
finish
();
}
});
}
...
...
@@ -93,11 +93,11 @@ public class CountDownVedioView extends LinearLayout {
ivCountVedioRedbox
.
setImageResource
(
img
);
}
public
void
setCountDownV
edioListener
(
CountDownVedioListener
countDownVedi
oListener
)
{
this
.
countDownV
edioListener
=
countDownVedi
oListener
;
public
void
setCountDownV
ideoListener
(
CountDownVideoListener
countDownVide
oListener
)
{
this
.
countDownV
ideoListener
=
countDownVide
oListener
;
}
public
interface
CountDownV
edi
oListener
{
public
interface
CountDownV
ide
oListener
{
void
finish
();
}
...
...
@@ -135,7 +135,7 @@ public class CountDownVedioView extends LinearLayout {
}
}
public
void
onDest
or
y
()
{
public
void
onDest
ro
y
()
{
if
(
cdCountVedioView
.
callOnClick
())
if
(
rope
!=
null
)
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/widgets/DrawcashVideoDialog.kt
View file @
175d5a63
...
...
@@ -8,10 +8,10 @@ import android.view.View
import
android.view.WindowManager
import
android.widget.TextView
import
com.mints.goodmoney.R
import
com.mints.goodmoney.ad.v
edio.Vedi
oAdingManager
import
com.mints.goodmoney.ad.v
ideo.Vide
oAdingManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.mvp.model.V
edi
oAdingBean
import
com.mints.goodmoney.mvp.model.V
ide
oAdingBean
import
com.mints.goodmoney.utils.ToastUtil
import
com.mints.library.utils.nodoubleclick.AntiShake
...
...
@@ -23,8 +23,8 @@ class DrawcashVideoDialog(activity: Activity) :
private
var
onClickListener
:
OnClickListener
?
=
null
private
var
v
edioAdingManager
:
Vedi
oAdingManager
?
=
null
private
var
loadV
edi
oFailCount
=
0
private
var
v
ideoAdingManager
:
Vide
oAdingManager
?
=
null
private
var
loadV
ide
oFailCount
=
0
private
var
tvContent
:
TextView
private
var
tvNext
:
TextView
...
...
@@ -39,7 +39,7 @@ class DrawcashVideoDialog(activity: Activity) :
lp
.
windowAnimations
=
R
.
style
.
DialogAnimBottom
window
!!
.
attributes
=
lp
v
edioAdingManager
=
Vedi
oAdingManager
.
getInstance
(
activity
)
v
ideoAdingManager
=
Vide
oAdingManager
.
getInstance
(
activity
)
findViewById
<
View
>(
R
.
id
.
btn_dialog_drawcash_back
).
setOnClickListener
(
this
)
tvContent
=
findViewById
<
View
>(
R
.
id
.
btn_dialog_drawcash_content
)
as
TextView
...
...
@@ -49,8 +49,8 @@ class DrawcashVideoDialog(activity: Activity) :
}
fun
onDestory
(){
v
edioAdingManager
?.
setVedi
oAdingListener
(
null
)
v
edi
oAdingManager
?.
onDestory
()
v
ideoAdingManager
?.
setVide
oAdingListener
(
null
)
v
ide
oAdingManager
?.
onDestory
()
activity
=
null
}
...
...
@@ -63,7 +63,7 @@ class DrawcashVideoDialog(activity: Activity) :
onClickListener
?.
onClick
()
dismiss
()
}
else
{
awardV
edi
o
()
awardV
ide
o
()
}
}
R
.
id
.
btn_dialog_drawcash_back
->
{
...
...
@@ -83,40 +83,40 @@ class DrawcashVideoDialog(activity: Activity) :
/**
* 获取激励视频
*/
private
fun
awardV
edi
o
()
{
private
fun
awardV
ide
o
()
{
if
(
activity
==
null
)
return
loadV
edi
oFailCount
=
0
loadV
ide
oFailCount
=
0
ToastUtil
.
show
(
activity
,
"加载中..."
)
val
bean
=
V
edi
oAdingBean
()
val
bean
=
V
ide
oAdingBean
()
bean
.
carrierType
=
Constant
.
CARRIER_DRAWCASH
v
edioAdingManager
?.
let
{
loadVedi
o
(
it
,
bean
,
true
)
}
v
ideoAdingManager
?.
let
{
loadVide
o
(
it
,
bean
,
true
)
}
}
/**
* 加载激励视频
*/
private
fun
loadV
edio
(
vedioAdingManager
:
VedioAdingManager
?,
bean
:
Vedi
oAdingBean
,
isFirstLoad
:
Boolean
)
{
private
fun
loadV
ideo
(
videoAdingManager
:
VideoAdingManager
?,
bean
:
Vide
oAdingBean
,
isFirstLoad
:
Boolean
)
{
if
(
activity
==
null
)
return
v
edi
oAdingManager
?.
let
{
it
.
setV
edioAdingListener
(
object
:
VedioAdingManager
.
Vedi
oAdingListener
{
override
fun
v
edi
oAdingListenerError
(
adType
:
String
)
{
v
ide
oAdingManager
?.
let
{
it
.
setV
ideoAdingListener
(
object
:
VideoAdingManager
.
Vide
oAdingListener
{
override
fun
v
ide
oAdingListenerError
(
adType
:
String
)
{
ToastUtil
.
show
(
activity
,
"加载超时,请休息一下"
)
}
override
fun
v
edi
oAdingListenerFail
(
adType
:
String
)
{
loadV
edi
oFailCount
++
if
(
loadV
edi
oFailCount
>=
2
)
{
override
fun
v
ide
oAdingListenerFail
(
adType
:
String
)
{
loadV
ide
oFailCount
++
if
(
loadV
ide
oFailCount
>=
2
)
{
ToastUtil
.
show
(
activity
,
"加载超时,请休息一下"
)
}
else
{
loadV
edio
(
vedi
oAdingManager
,
bean
,
false
)
loadV
ideo
(
vide
oAdingManager
,
bean
,
false
)
}
}
override
fun
v
edi
oAdingListenerSuccess
(
adType
:
String
)
{
if
(
it
.
isV
edi
oAdDownload
)
{
override
fun
v
ide
oAdingListenerSuccess
(
adType
:
String
)
{
if
(
it
.
isV
ide
oAdDownload
)
{
TrackManager
.
getInstance
().
drawcashVideo
()
}
}
...
...
GoodMoney/app/src/main/res/layout/activity_kyl_v
edi
o.xml
→
GoodMoney/app/src/main/res/layout/activity_kyl_v
ide
o.xml
View file @
175d5a63
File moved
GoodMoney/app/src/main/res/layout/layout_red_box.xml
View file @
175d5a63
...
...
@@ -37,7 +37,7 @@
android:src=
"@mipmap/ic_main_box"
android:visibility=
"gone"
/>
<com.mints.goodmoney.ui.widgets.CountDownV
edi
oView
<com.mints.goodmoney.ui.widgets.CountDownV
ide
oView
android:id=
"@+id/cdvvYilanTime"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
...
...
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