Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_highgold_pro
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_highgold_pro
Commits
4d0eb8b3
Commit
4d0eb8b3
authored
Mar 08, 2021
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化激励视频统一接口回调,强升弹窗,个人中心任务下载等
parent
7f907dbc
Changes
25
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
333 additions
and
342 deletions
+333
-342
build.gradle
app/build.gradle
+7
-12
BaseVideoAd.kt
...src/main/java/com/mints/goldspace/ad/video/BaseVideoAd.kt
+2
-76
CsjFullVideoAdManager.java
...a/com/mints/goldspace/ad/video/CsjFullVideoAdManager.java
+14
-29
CsjVideoAdManager.java
.../java/com/mints/goldspace/ad/video/CsjVideoAdManager.java
+22
-32
MhVideoAdManager.kt
...ain/java/com/mints/goldspace/ad/video/MhVideoAdManager.kt
+10
-28
ShVideoAdManager.kt
...ain/java/com/mints/goldspace/ad/video/ShVideoAdManager.kt
+18
-21
VideoAdingManager.java
.../java/com/mints/goldspace/ad/video/VideoAdingManager.java
+36
-34
WnVideoAdManager.kt
...ain/java/com/mints/goldspace/ad/video/WnVideoAdManager.kt
+10
-30
YlhVideoAdManager.java
.../java/com/mints/goldspace/ad/video/YlhVideoAdManager.java
+20
-49
VedioAdStatusListener.kt
...om/mints/goldspace/ad/video/base/VedioAdStatusListener.kt
+21
-0
Constant.kt
app/src/main/java/com/mints/goldspace/common/Constant.kt
+1
-0
TrackManager.java
...c/main/java/com/mints/goldspace/manager/TrackManager.java
+15
-0
MyInfo.java
app/src/main/java/com/mints/goldspace/mvp/model/MyInfo.java
+27
-0
MyPresenter.kt
...in/java/com/mints/goldspace/mvp/presenters/MyPresenter.kt
+9
-2
TrackPresenter.java
...va/com/mints/goldspace/mvp/presenters/TrackPresenter.java
+33
-0
UpdateService.java
.../main/java/com/mints/goldspace/service/UpdateService.java
+1
-1
AwardActivity.kt
...in/java/com/mints/goldspace/ui/activitys/AwardActivity.kt
+10
-1
KylVideoActivity.kt
...java/com/mints/goldspace/ui/activitys/KylVideoActivity.kt
+1
-1
MainActivity.kt
...ain/java/com/mints/goldspace/ui/activitys/MainActivity.kt
+1
-1
MainMyAdapter.kt
...main/java/com/mints/goldspace/ui/adapter/MainMyAdapter.kt
+4
-1
MainFragment.kt
...main/java/com/mints/goldspace/ui/fragment/MainFragment.kt
+1
-1
MyFragment.kt
...c/main/java/com/mints/goldspace/ui/fragment/MyFragment.kt
+57
-15
TaskCpdFragment.kt
...n/java/com/mints/goldspace/ui/fragment/TaskCpdFragment.kt
+11
-6
DrawcashVideoDialog.kt
...ava/com/mints/goldspace/ui/widgets/DrawcashVideoDialog.kt
+1
-1
gradle.properties
gradle.properties
+1
-1
No files found.
app/build.gradle
View file @
4d0eb8b3
...
...
@@ -9,8 +9,8 @@ android {
applicationId
"com.mints.goldspace"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
3
3
versionName
"1.3.
3
"
versionCode
3
5
versionName
"1.3.
5
"
flavorDimensions
"default"
// dex突破65535的限制
...
...
@@ -62,16 +62,11 @@ android {
debug
{
// 不显示Log
// buildConfigField "boolean", "LOG_DEBUG", "true"
// buildConfigField "String", "AppKeyPre", "\"abcd\""
// buildConfigField "String", "MainIp", DEBUG_URL
// manifestPlaceholders = [TD_SCHEMA_KEY: DEBUG_TD_SCHEMA_KEY,
// TD_KEY : DEBUG_TD_KEY]
buildConfigField
"boolean"
,
"LOG_DEBUG"
,
"true"
buildConfigField
"String"
,
"AppKeyPre"
,
"\"abcd\""
buildConfigField
"String"
,
"MainIp"
,
RELEASE
_URL
manifestPlaceholders
=
[
TD_SCHEMA_KEY:
RELEASE
_TD_SCHEMA_KEY
,
TD_KEY
:
RELEASE
_TD_KEY
]
buildConfigField
"String"
,
"MainIp"
,
DEBUG
_URL
manifestPlaceholders
=
[
TD_SCHEMA_KEY:
DEBUG
_TD_SCHEMA_KEY
,
TD_KEY
:
DEBUG
_TD_KEY
]
//混淆
minifyEnabled
false
...
...
@@ -215,8 +210,8 @@ dependencies {
implementation
'com.umeng.umsdk:crash:0.0.4'
// native crash包依赖(必选)
// TalkingDada(已集成)
// 一览视频
implementation
(
"com.yilan.sdk:ui:3.
1.0.4
"
)
{
exclude
group:
'com.yilan.sdk'
,
module:
'
toutiao
'
implementation
(
"com.yilan.sdk:ui:3.
3.1.2
"
)
{
exclude
group:
'com.yilan.sdk'
,
module:
'
yb_extra
'
exclude
group:
'com.yilan.sdk'
,
module:
'gdt'
exclude
group:
'com.yilan.sdk'
,
module:
'ks'
}
...
...
app/src/main/java/com/mints/goldspace/ad/video/BaseVideoAd.kt
View file @
4d0eb8b3
...
...
@@ -11,82 +11,7 @@ import com.mints.goldspace.ui.widgets.LoadingDialog
import
com.mints.goldspace.utils.ToastUtil
import
java.util.HashMap
open
class
BaseVideoAd
(
activity
:
Activity
)
:
BaseView
{
open
var
activity
:
Activity
?
=
null
var
progressDialog
:
LoadingDialog
?
=
null
init
{
this
.
activity
=
activity
}
override
fun
getBaseApplication
():
MintsApplication
{
return
activity
?.
getApplication
()
as
MintsApplication
}
/**
* 显示加载进度条(自定义message)
*
* @param message
*/
override
fun
showLoading
(
message
:
String
?)
{
if
(
activity
!=
null
)
{
if
(
activity
!!
.
getWindow
()
!=
null
&&
!
activity
!!
.
isFinishing
())
{
if
(
progressDialog
==
null
)
{
progressDialog
=
LoadingDialog
(
activity
)
progressDialog
!!
.
setLoadText
(
message
)
}
progressDialog
?.
show
()
setProgressOnTouchOutside
(
false
)
setProgressNoDismiss
()
}
}
}
/**
* 设置Progress是否手触消失
*
* @param onTouchOutside
*/
open
fun
setProgressOnTouchOutside
(
onTouchOutside
:
Boolean
)
{
if
(
progressDialog
!=
null
)
progressDialog
!!
.
setCanceledOnTouchOutside
(
onTouchOutside
)
}
/**
* 设置点击返回是否消失加载进度条
*/
fun
setProgressNoDismiss
()
{
if
(
progressDialog
!=
null
&&
progressDialog
!!
.
isShowing
())
{
progressDialog
!!
.
setOnKeyListener
(
DialogInterface
.
OnKeyListener
{
dialog
,
keyCode
,
event
->
keyCode
==
KeyEvent
.
KEYCODE_BACK
})
}
}
/**
* 消失加载进度条
*/
override
fun
hideLoading
()
{
try
{
if
(
activity
!=
null
)
{
if
(
activity
!!
.
getWindow
()
!=
null
&&
!
activity
!!
.
isFinishing
())
{
if
(
progressDialog
!=
null
&&
progressDialog
!!
.
isShowing
())
{
progressDialog
!!
.
dismiss
()
progressDialog
=
null
}
}
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
finally
{
progressDialog
=
null
}
}
override
fun
showToast
(
msg
:
String
?)
{
if
(!
TextUtils
.
isEmpty
(
msg
))
ToastUtil
.
show
(
MintsApplication
.
getContext
(),
msg
)
}
open
class
BaseVideoAd
{
/**
* 激励视频请求接口封装
*/
...
...
@@ -112,4 +37,5 @@ open class BaseVideoAd(activity: Activity) : BaseView {
open
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{}
open
fun
onDestroy
()
{}
}
\ No newline at end of file
app/src/main/java/com/mints/goldspace/ad/video/CsjFullVideoAdManager.java
View file @
4d0eb8b3
...
...
@@ -7,6 +7,7 @@ import com.bytedance.sdk.openadsdk.TTAdConstant;
import
com.bytedance.sdk.openadsdk.TTAdNative
;
import
com.bytedance.sdk.openadsdk.TTAdSdk
;
import
com.bytedance.sdk.openadsdk.TTFullScreenVideoAd
;
import
com.mints.goldspace.ad.video.base.VideoAdStatusListener
;
import
com.mints.goldspace.common.Constant
;
import
com.mints.goldspace.manager.TrackManager
;
import
com.mints.goldspace.manager.TtCsjAdManager
;
...
...
@@ -16,12 +17,11 @@ import com.mints.goldspace.mvp.views.VideoAdManagerView;
/**
* 穿山甲全屏广告
*/
public
class
CsjFullVideoAdManager
extends
BaseVideoAd
implements
VideoAdManagerView
{
public
class
CsjFullVideoAdManager
extends
BaseVideoAd
{
private
static
CsjFullVideoAdManager
_inst
;
private
CsjFullVedioAdPresenter
csjFullVedioAdPresenter
;
private
CsjFullVedioAdListener
csjFullVedioAdListener
;
private
VideoAdStatusListener
videoAdStatusListener
;
Activity
activity
;
private
TTAdNative
ttAdNative
;
...
...
@@ -39,15 +39,12 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
private
CsjFullVideoAdManager
(
Activity
activity
)
{
super
(
activity
);
init
(
activity
);
}
private
void
init
(
Activity
activity
)
{
this
.
activity
=
activity
;
ttAdNative
=
TTAdSdk
.
getAdManager
().
createAdNative
(
activity
);
csjFullVedioAdPresenter
=
new
CsjFullVedioAdPresenter
();
csjFullVedioAdPresenter
.
attachView
(
this
);
}
/**
...
...
@@ -72,8 +69,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
public
void
onError
(
int
code
,
String
message
)
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dFail
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dFail
();
}
}
...
...
@@ -96,19 +93,19 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_TWO
,
""
,
""
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedio
Download
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
ad
Download
();
}
}
@Override
public
void
onAdClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dSuccess
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dSuccess
();
}
if
(
activity
!=
null
)
{
csjFullVedioAdPresenter
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_CSJFULL
,
extraId
,
curCoin
));
TrackManager
.
getInstance
()
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_CSJFULL
,
extraId
,
curCoin
));
}
}
...
...
@@ -133,8 +130,8 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJFULL
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
if
(
csjFullVedioAd
Listener
!=
null
)
{
csjFullVedioAdListener
.
csjFullVedioA
dFail
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dFail
();
}
}
}
...
...
@@ -147,22 +144,10 @@ public class CsjFullVideoAdManager extends BaseVideoAd implements VideoAdManager
mttFullVideoAd
.
setFullScreenVideoAdInteractionListener
(
null
);
}
if
(
csjFullVedioAdPresenter
!=
null
)
{
csjFullVedioAdPresenter
.
dispose
();
csjFullVedioAdPresenter
.
detachView
();
}
activity
=
null
;
}
public
void
setCsjFullVedioAdListener
(
CsjFullVedioAdListener
csjFullVedioAdListener
)
{
this
.
csjFullVedioAdListener
=
csjFullVedioAdListener
;
}
public
interface
CsjFullVedioAdListener
{
void
csjFullVedioAdFail
();
void
csjFullVedioAdSuccess
();
void
csjFullVedioDownload
();
public
void
setVideoAdStatusListener
(
VideoAdStatusListener
videoAdStatusListener
)
{
this
.
videoAdStatusListener
=
videoAdStatusListener
;
}
}
app/src/main/java/com/mints/goldspace/ad/video/CsjVideoAdManager.java
View file @
4d0eb8b3
...
...
@@ -9,6 +9,7 @@ import com.bytedance.sdk.openadsdk.TTAdNative;
import
com.bytedance.sdk.openadsdk.TTAppDownloadListener
;
import
com.bytedance.sdk.openadsdk.TTRewardVideoAd
;
import
com.mints.goldspace.BuildConfig
;
import
com.mints.goldspace.ad.video.base.VideoAdStatusListener
;
import
com.mints.goldspace.common.AppConfig
;
import
com.mints.goldspace.common.Constant
;
import
com.mints.goldspace.manager.TTNativeExpressManager
;
...
...
@@ -32,7 +33,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
private
AppPreferences
ps
;
private
int
curCoin
;
private
String
extraId
;
private
CsjVideoAdListener
csjVideoAd
Listener
;
private
VideoAdStatusListener
videoAdStatus
Listener
;
Activity
activity
;
private
TTAdNative
ttAdNative
;
...
...
@@ -42,16 +43,13 @@ public class CsjVideoAdManager extends BaseVideoAd {
private
boolean
isClickScreen
=
true
;
// 是否点击屏幕跳转广告
public
static
CsjVideoAdManager
getInstance
(
Activity
activity
)
{
if
(
_inst
!=
null
)
{
return
_inst
;
}
else
{
if
(
_inst
==
null
)
{
_inst
=
new
CsjVideoAdManager
(
activity
);
return
_inst
;
}
return
_inst
;
}
private
CsjVideoAdManager
(
Activity
activity
)
{
super
(
activity
);
init
(
activity
);
}
...
...
@@ -69,7 +67,7 @@ public class CsjVideoAdManager extends BaseVideoAd {
if
(
mttRewardVideoAd
!=
null
)
{
mttRewardVideoAd
.
setRewardAdInteractionListener
(
null
);
}
ps
=
null
;
activity
=
null
;
}
...
...
@@ -84,7 +82,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
isClickScreen
=
true
;
this
.
curCoin
=
curCoin
;
this
.
extraId
=
extraId
;
String
codeId
=
TtCsjAdManager
.
TT_AD_VEDIO_MAIN_DEV
;
if
(!
BuildConfig
.
DEBUG
)
{
switch
(
carrierType
)
{
...
...
@@ -166,9 +163,9 @@ public class CsjVideoAdManager extends BaseVideoAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
code
),
message
);
LogUtil
.
d
(
"
csjVideoAd
Listener"
,
"onError "
+
code
+
message
);
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
LogUtil
.
d
(
"
vedioAdStatus
Listener"
,
"onError "
+
code
+
message
);
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dFail
();
}
}
...
...
@@ -181,8 +178,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
}
else
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Cached Fail"
);
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dFail
();
}
}
}
...
...
@@ -193,7 +190,6 @@ public class CsjVideoAdManager extends BaseVideoAd {
mttRewardVideoAd
=
ad
;
if
(
mttRewardVideoAd
!=
null
)
{
mttRewardVideoAd
.
setRewardAdInteractionListener
(
new
TTRewardVideoAd
.
RewardAdInteractionListener
()
{
@Override
...
...
@@ -214,8 +210,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
}
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideo
Download
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
ad
Download
();
}
}
...
...
@@ -223,8 +219,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
public
void
onAdClose
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dSuccess
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dSuccess
();
}
}
...
...
@@ -236,8 +232,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
public
void
onVideoError
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_CSJ
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"VideoError"
);
if
(
csjVideoAd
Listener
!=
null
)
{
csjVideoAdListener
.
csjVideoA
dFail
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dFail
();
}
}
...
...
@@ -295,9 +291,10 @@ public class CsjVideoAdManager extends BaseVideoAd {
vo
.
put
(
"adtype"
,
Constant
.
ADTYPE_VEDIO
);
vo
.
put
(
"tid"
,
tid
);
vo
.
put
(
"adsource"
,
Constant
.
AD_SOURCE_CSJ
);
if
(
ps
!
=
null
)
{
vo
.
put
(
"ip"
,
ps
.
getString
(
Constant
.
CSJ_VEDIO_APPIP
,
""
)
);
if
(
ps
=
=
null
)
{
ps
=
new
AppPreferences
(
activity
);
}
vo
.
put
(
"ip"
,
ps
.
getString
(
Constant
.
CSJ_VEDIO_APPIP
,
""
));
switch
(
carrierType
)
{
case
Constant
.
CARRIER_VERSUS_VIDEO
:
// 每日任务-视频
...
...
@@ -316,15 +313,8 @@ public class CsjVideoAdManager extends BaseVideoAd {
return
vo
;
}
public
void
set
CsjVideoAdListener
(
CsjVideoAdListener
csjVideoAd
Listener
)
{
this
.
csjVideoAdListener
=
csjVideoAd
Listener
;
public
void
set
VideoAdStatusListener
(
VideoAdStatusListener
videoAdStatus
Listener
)
{
this
.
videoAdStatusListener
=
videoAdStatus
Listener
;
}
public
interface
CsjVideoAdListener
{
void
csjVideoAdFail
();
void
csjVideoAdSuccess
();
void
csjVideoDownload
();
}
}
}
\ No newline at end of file
app/src/main/java/com/mints/goldspace/ad/video/MhVideoAdManager.kt
View file @
4d0eb8b3
...
...
@@ -2,6 +2,7 @@ package com.mints.goldspace.ad.video
import
android.app.Activity
import
com.maplehaze.adsdk.video.RewardVideoAd
import
com.mints.goldspace.ad.video.base.VideoAdStatusListener
import
com.mints.goldspace.common.AppConfig
import
com.mints.goldspace.common.Constant
import
com.mints.goldspace.manager.MhManager
...
...
@@ -16,14 +17,13 @@ private val TAG = MhVideoAdManager::class.java.simpleName
* 枫岚广告视频
*/
class
MhVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
),
VideoAdManagerView
{
BaseVideoAd
(
)
{
private
var
mhVideoAdPresenter
:
MhVideoAdPresenter
?
=
null
private
var
mhVideoAdListener
:
MhVideoAdListener
?
=
null
private
var
videoAdStatusListener
:
VideoAdStatusListener
?
=
null
private
var
mRewardVideoAd
:
RewardVideoAd
?
=
null
private
var
isClickScreen
:
Boolean
=
true
overrid
e
var
activity
:
Activity
?
=
null
privat
e
var
activity
:
Activity
?
=
null
companion
object
{
private
var
_inst
:
MhVideoAdManager
?
=
null
...
...
@@ -43,8 +43,6 @@ class MhVideoAdManager private constructor(activity: Activity) :
private
fun
init
(
activity
:
Activity
)
{
this
.
activity
=
activity
mhVideoAdPresenter
=
MhVideoAdPresenter
()
mhVideoAdPresenter
?.
attachView
(
this
)
}
override
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{
...
...
@@ -88,9 +86,7 @@ class MhVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
mhVideoAdListener
!=
null
)
{
mhVideoAdListener
?.
mhVideoAdDownload
()
}
videoAdStatusListener
?.
adDownload
()
}
override
fun
onVideoComplete
()
{
...
...
@@ -100,13 +96,11 @@ class MhVideoAdManager private constructor(activity: Activity) :
override
fun
onADClose
()
{
LogUtil
.
d
(
TAG
,
"onADClose"
)
mhVideoAdPresenter
?
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_FL
,
extraId
,
curCoin
))
TrackManager
.
getInstance
()
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_FL
,
extraId
,
curCoin
))
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
mhVideoAdListener
!=
null
)
{
mhVideoAdListener
?.
mhVideoAdSuccess
()
}
videoAdStatusListener
?.
adSuccess
()
}
override
fun
onADError
(
p0
:
Int
)
{
...
...
@@ -114,9 +108,7 @@ class MhVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_ONE
,
(
p0
).
toString
(),
""
)
if
(
mhVideoAdListener
!=
null
)
{
mhVideoAdListener
?.
mhVideoAdFail
()
}
videoAdStatusListener
?.
adFail
()
}
})
...
...
@@ -124,22 +116,12 @@ class MhVideoAdManager private constructor(activity: Activity) :
mRewardVideoAd
?.
loadAd
()
}
fun
set
MhVideoAdListener
(
mhVideoAdListener
:
MhVideoAd
Listener
?)
{
this
.
mhVideoAdListener
=
mhVideoAd
Listener
fun
set
VideoAdStatusListener
(
videoAdStatusListener
:
VideoAdStatus
Listener
?)
{
this
.
videoAdStatusListener
=
videoAdStatus
Listener
}
interface
MhVideoAdListener
{
fun
mhVideoAdSuccess
()
fun
mhVideoAdFail
()
fun
mhVideoAdDownload
()
}
override
fun
onDestroy
()
{
mhVideoAdPresenter
?.
let
{
it
.
dispose
()
it
.
detachView
()
}
mRewardVideoAd
=
null
activity
=
null
}
...
...
app/src/main/java/com/mints/goldspace/ad/video/ShVideoAdManager.kt
View file @
4d0eb8b3
...
...
@@ -3,6 +3,8 @@ package com.mints.goldspace.ad.video
import
android.app.Activity
import
android.text.TextUtils
import
androidx.annotation.Nullable
import
com.mints.goldspace.BuildConfig
import
com.mints.goldspace.ad.video.base.VideoAdStatusListener
import
com.mints.goldspace.common.AppConfig
import
com.mints.goldspace.common.Constant
import
com.mints.goldspace.manager.TrackManager
...
...
@@ -24,11 +26,12 @@ private val TAG = ShVideoAdManager::class.java.simpleName
* 天卓珊瑚广告视频
*/
class
ShVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
)
{
BaseVideoAd
()
{
private
var
isClickScreen
:
Boolean
=
true
private
var
activity
:
Activity
?
=
null
private
var
shVideoAdListener
:
ShVideoAd
Listener
?
=
null
private
var
videoAdStatusListener
:
VideoAdStatus
Listener
?
=
null
private
lateinit
var
ps
:
AppPreferences
companion
object
{
...
...
@@ -65,7 +68,13 @@ class ShVideoAdManager private constructor(activity: Activity) :
this
.
activity
=
activity
isClickScreen
=
true
val
type
=
TZ_REWRAD_TYPE_RELEASE
// val type = TZ_REWRAD_TYPE_RELEASE
val
type
=
if
(
BuildConfig
.
DEBUG
)
{
TZ_REWRAD_TYPE_DEBUG
}
else
{
TZ_REWRAD_TYPE_RELEASE
}
ADLoader
(
activity
)
.
get
(
ADType
.
REWARD_VIDEO
)
...
...
@@ -94,11 +103,9 @@ class ShVideoAdManager private constructor(activity: Activity) :
override
fun
onAdFailed
(
adError
:
ADError
)
{
LogUtil
.
d
(
TAG
,
"onAdFailed"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_ONE
,
(
adError
.
code
).
toString
(),
""
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_ONE
,
(
adError
.
code
).
toString
(),
adError
.
description
)
if
(
shVideoAdListener
!=
null
)
{
shVideoAdListener
?.
shVideoAdFail
()
}
videoAdStatusListener
?.
adFail
()
}
override
fun
onAdShow
(
@Nullable
ad
:
CoralAD
?):
Boolean
{
...
...
@@ -120,9 +127,7 @@ class ShVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
shVideoAdListener
!=
null
)
{
shVideoAdListener
?.
shVideoAdDownload
()
}
videoAdStatusListener
?.
adDownload
()
return
super
.
onAdClicked
(
ad
)
}
...
...
@@ -161,9 +166,7 @@ class ShVideoAdManager private constructor(activity: Activity) :
LogUtil
.
d
(
TAG
,
"onVideoClosed"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
shVideoAdListener
!=
null
)
{
shVideoAdListener
?.
shVideoAdSuccess
()
}
videoAdStatusListener
?.
adSuccess
()
return
super
.
onVideoClosed
(
coralAD
,
s
)
}
...
...
@@ -171,14 +174,8 @@ class ShVideoAdManager private constructor(activity: Activity) :
}
fun
setShVideoAdListener
(
shVideoAdListener
:
ShVideoAdListener
?)
{
this
.
shVideoAdListener
=
shVideoAdListener
}
interface
ShVideoAdListener
{
fun
shVideoAdSuccess
()
fun
shVideoAdFail
()
fun
shVideoAdDownload
()
fun
setVideoAdStatusListener
(
videoAdStatusListener
:
VideoAdStatusListener
?)
{
this
.
videoAdStatusListener
=
videoAdStatusListener
}
override
fun
onDestroy
()
{
...
...
app/src/main/java/com/mints/goldspace/ad/video/VideoAdingManager.java
View file @
4d0eb8b3
This diff is collapsed.
Click to expand it.
app/src/main/java/com/mints/goldspace/ad/video/WnVideoAdManager.kt
View file @
4d0eb8b3
package
com.mints.goldspace.ad.video
import
android.app.Activity
import
com.mints.goldspace.ad.video.base.VideoAdStatusListener
import
com.mints.goldspace.common.AppConfig
import
com.mints.goldspace.common.Constant
import
com.mints.goldspace.manager.TrackManager
...
...
@@ -16,14 +17,13 @@ private val TAG = WnVideoAdManager::class.java.simpleName
* 闪电盒子视频
*/
class
WnVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
),
VideoAdManagerView
{
BaseVideoAd
(
)
{
private
var
wnVideoAdPresenter
:
WnVideoAdPresenter
?
=
null
private
var
wnVideoAdListener
:
WnVideoAdListener
?
=
null
private
var
videoAdStatusListener
:
VideoAdStatusListener
?
=
null
private
var
mRewardVideoAd
:
WNRewardVideoAd
?
=
null
private
var
isClickScreen
:
Boolean
=
true
overrid
e
var
activity
:
Activity
?
=
null
privat
e
var
activity
:
Activity
?
=
null
companion
object
{
private
var
_inst
:
WnVideoAdManager
?
=
null
...
...
@@ -43,8 +43,6 @@ class WnVideoAdManager private constructor(activity: Activity) :
private
fun
init
(
activity
:
Activity
)
{
this
.
activity
=
activity
wnVideoAdPresenter
=
WnVideoAdPresenter
()
wnVideoAdPresenter
?.
attachView
(
this
)
}
override
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{
...
...
@@ -69,9 +67,7 @@ class WnVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_ONE
,
(
code
).
toString
(),
message
)
if
(
wnVideoAdListener
!=
null
)
{
wnVideoAdListener
?.
wnVideoAdFail
()
}
videoAdStatusListener
?.
adFail
()
}
override
fun
onLoad
(
ad
:
WNRewardVideoAd
)
{
...
...
@@ -92,19 +88,15 @@ class WnVideoAdManager private constructor(activity: Activity) :
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
wnVideoAdListener
!=
null
)
{
wnVideoAdListener
?.
wnVideoAdDownload
()
}
videoAdStatusListener
?.
adDownload
()
}
override
fun
onAdClose
()
{
wnVideoAdPresenter
?
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_SDHZ
,
extraId
,
curCoin
))
TrackManager
.
getInstance
()
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_SDHZ
,
extraId
,
curCoin
))
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
wnVideoAdListener
!=
null
)
{
wnVideoAdListener
?.
wnVideoAdSuccess
()
}
videoAdStatusListener
?.
adSuccess
()
}
override
fun
onVideoComplete
()
{
...
...
@@ -116,7 +108,6 @@ class WnVideoAdManager private constructor(activity: Activity) :
if
(
ad
.
type
==
WNAdConstant
.
AD_TYPE_DOWNLOAD
)
{
ad
.
downloadListener
=
object
:
WNAdDownloadListener
{
override
fun
onDownloadStarted
(
totalBytes
:
Long
,
fileName
:
String
,
appName
:
String
)
{
showToast
(
"开始下载"
)
}
override
fun
onDownloadFinished
(
totalBytes
:
Long
,
fileName
:
String
,
appName
:
String
)
{}
...
...
@@ -130,22 +121,11 @@ class WnVideoAdManager private constructor(activity: Activity) :
})
}
fun
setWnVideoAdListener
(
wnVideoAdListener
:
WnVideoAdListener
?)
{
this
.
wnVideoAdListener
=
wnVideoAdListener
}
interface
WnVideoAdListener
{
fun
wnVideoAdSuccess
()
fun
wnVideoAdFail
()
fun
wnVideoAdDownload
()
fun
setVideoAdStatusListener
(
videoAdStatusListener
:
VideoAdStatusListener
?)
{
this
.
videoAdStatusListener
=
videoAdStatusListener
}
override
fun
onDestroy
()
{
wnVideoAdPresenter
?.
let
{
it
.
dispose
()
it
.
detachView
()
}
mRewardVideoAd
?.
let
{
it
.
downloadListener
=
null
it
.
interactionListener
=
null
...
...
app/src/main/java/com/mints/goldspace/ad/video/YlhVideoAdManager.java
View file @
4d0eb8b3
...
...
@@ -4,6 +4,7 @@ import android.app.Activity;
import
android.os.SystemClock
;
import
com.mints.goldspace.MintsApplication
;
import
com.mints.goldspace.ad.video.base.VideoAdStatusListener
;
import
com.mints.goldspace.common.AppConfig
;
import
com.mints.goldspace.common.Constant
;
import
com.mints.goldspace.manager.TrackManager
;
...
...
@@ -21,50 +22,29 @@ import java.lang.ref.WeakReference;
/**
* 优量汇视频
*/
public
class
YlhVideoAdManager
extends
BaseVideoAd
implements
VideoAdManagerView
{
public
class
YlhVideoAdManager
extends
BaseVideoAd
{
private
static
YlhVideoAdManager
_inst
;
// 优量汇激励视频
private
RewardVideoAD
rewardVideoAD
;
private
YlhVideoAdPresenter
ylhVideoAdPresenter
;
private
YlhVideoAdListener
ylhVideoAdListener
;
Activity
activity
;
private
VideoAdStatusListener
videoAdStatusListener
;
private
boolean
isClickScreen
=
true
;
// 是否点击屏幕跳转广告
public
static
YlhVideoAdManager
getInstance
(
Activity
activity
)
{
public
static
YlhVideoAdManager
getInstance
()
{
if
(
_inst
!=
null
)
{
return
_inst
;
}
else
{
WeakReference
<
Activity
>
activityWeakReference
=
new
WeakReference
<>(
activity
);
_inst
=
new
YlhVideoAdManager
(
activityWeakReference
);
_inst
=
new
YlhVideoAdManager
();
return
_inst
;
}
}
private
YlhVideoAdManager
(
WeakReference
<
Activity
>
activity
)
{
super
(
activity
.
get
());
init
(
activity
.
get
());
}
private
void
init
(
Activity
activity
)
{
this
.
activity
=
activity
;
ylhVideoAdPresenter
=
new
YlhVideoAdPresenter
();
ylhVideoAdPresenter
.
attachView
(
this
);
}
@Override
public
void
onDestroy
()
{
if
(
ylhVideoAdPresenter
!=
null
)
{
ylhVideoAdPresenter
.
dispose
();
ylhVideoAdPresenter
.
detachView
();
}
activity
=
null
;
rewardVideoAD
=
null
;
}
/**
...
...
@@ -72,7 +52,6 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
*/
@Override
public
void
loadAd
(
Activity
activity
,
int
curCoin
,
String
carrierType
,
String
extraId
)
{
this
.
activity
=
activity
;
isClickScreen
=
true
;
String
ylhPostId
;
...
...
@@ -155,7 +134,7 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
}
rewardVideoAD
=
new
RewardVideoAD
(
activity
,
YlhAdManager
.
YLH_AD_APPID
,
ylhPostId
,
new
RewardVideoADListener
()
{
rewardVideoAD
=
new
RewardVideoAD
(
activity
,
ylhPostId
,
new
RewardVideoADListener
()
{
@Override
public
void
onADLoad
()
{
//广告加载成功,可在此回调后进行广告展示,此时广告过期时间确定,可通过RewardVideoAD.getExpireTimestamp()获取
try
{
...
...
@@ -165,17 +144,17 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
if
(
SystemClock
.
elapsedRealtime
()
<
(
rewardVideoAD
.
getExpireTimestamp
()
-
delta
))
{
rewardVideoAD
.
showAD
();
}
else
{
showToast
(
"广告已过期,请再次请求广告后进行广告展示!"
);
//
showToast("广告已过期,请再次请求广告后进行广告展示!");
}
}
else
{
showToast
(
"此条广告已经展示过,请再次请求广告后进行广告展示!"
);
//
showToast("此条广告已经展示过,请再次请求广告后进行广告展示!");
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
"999999"
,
"Load Fail"
);
if
(
ylhVideoAd
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dFail
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dFail
();
}
}
}
...
...
@@ -216,8 +195,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
);
isClickScreen
=
false
;
}
if
(
ylhVideoAd
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dDownload
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dDownload
();
}
}
...
...
@@ -230,10 +209,10 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
public
void
onADClose
()
{
//激励视频广告被关闭
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
ylhVideoAdPresenter
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_YLH
,
extraId
,
curCoin
));
TrackManager
.
getInstance
()
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_YLH
,
extraId
,
curCoin
));
if
(
ylhVideoAd
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dSuccess
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dSuccess
();
}
}
...
...
@@ -246,8 +225,8 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
// 0 成功 1失败 2点击 3-有效展示
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_ONE
,
String
.
valueOf
(
adError
.
getErrorCode
()),
adError
.
getErrorMsg
());
}
if
(
ylhVideoAd
Listener
!=
null
)
{
ylhVideoAdListener
.
ylhVideoA
dFail
();
if
(
videoAdStatus
Listener
!=
null
)
{
videoAdStatusListener
.
a
dFail
();
}
}
});
...
...
@@ -255,15 +234,7 @@ public class YlhVideoAdManager extends BaseVideoAd implements VideoAdManagerView
rewardVideoAD
.
loadAD
();
}
public
void
setYlhVideoAdListener
(
YlhVideoAdListener
ylhVideoAdListener
)
{
this
.
ylhVideoAdListener
=
ylhVideoAdListener
;
}
public
interface
YlhVideoAdListener
{
void
ylhVideoAdFail
();
void
ylhVideoAdSuccess
();
void
ylhVideoAdDownload
();
public
void
setVideoAdStatusListener
(
VideoAdStatusListener
videoAdStatusListener
)
{
this
.
videoAdStatusListener
=
videoAdStatusListener
;
}
}
app/src/main/java/com/mints/goldspace/ad/video/base/VedioAdStatusListener.kt
0 → 100644
View file @
4d0eb8b3
package
com.mints.goldspace.ad.video.base
/**
* 广告状态触发事件
*/
interface
VideoAdStatusListener
{
/**
* 广告加载失败
*/
fun
adFail
()
/**
* 广告加载成功
*/
fun
adSuccess
()
/**
* 点击广告
*/
fun
adDownload
()
}
\ No newline at end of file
app/src/main/java/com/mints/goldspace/common/Constant.kt
View file @
4d0eb8b3
...
...
@@ -139,6 +139,7 @@ object Constant {
const
val
CARRIER_FULLVEDIO_COMMON
=
"FULLVEDIO_COMMON"
//全屏视频-通用
const
val
CARRIER_EXPRESS_COMMON
=
"EXPRESS_COMMON"
//信息流-通用
const
val
CARRIER_EXPRESS_DIALOG
=
"EXPRESS_DIALOG"
//信息流-弹窗
const
val
CARRIER_FIRSTDOWNLOADS
=
"FIRSTDOWNLOADS"
// 其他下载奖励
const
val
AD_SOURCE_CSJ
=
"CSJ"
...
...
app/src/main/java/com/mints/goldspace/manager/TrackManager.java
View file @
4d0eb8b3
package
com
.
mints
.
goldspace
.
manager
;
import
android.app.Activity
;
import
android.text.TextUtils
;
import
com.mints.goldspace.MintsApplication
;
import
com.mints.goldspace.common.AppConfig
;
import
com.mints.goldspace.mvp.presenters.TrackPresenter
;
import
java.util.HashMap
;
/**
* 描述:离线管理器
*/
...
...
@@ -118,4 +121,16 @@ public class TrackManager {
trackPresenter
.
updataCodeIdForPkgChannel
();
}
}
/**
* 穿山甲和珊瑚由回调发放奖励
*
* @param activity
* @param vo
*/
public
void
reportAddCoinMsg
(
Activity
activity
,
HashMap
<
String
,
Object
>
vo
)
{
if
(
trackPresenter
!=
null
)
{
trackPresenter
.
reportAddCoinMsg
(
activity
,
vo
);
}
}
}
app/src/main/java/com/mints/goldspace/mvp/model/MyInfo.java
View file @
4d0eb8b3
...
...
@@ -199,12 +199,39 @@ public class MyInfo implements Serializable {
private
int
max
;
private
String
carrierType
;
private
String
doubleCarrierType
;
private
String
pkg
;
private
String
key
;
private
String
downloadUrl
;
private
int
complete
;
private
int
status
=
0
;
private
int
coin
;
private
int
readCoin
;
private
int
needSeconds
;
public
String
getDownloadUrl
()
{
return
downloadUrl
;
}
public
void
setDownloadUrl
(
String
downloadUrl
)
{
this
.
downloadUrl
=
downloadUrl
;
}
public
String
getPkg
()
{
return
pkg
;
}
public
void
setPkg
(
String
pkg
)
{
this
.
pkg
=
pkg
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
int
getNeedSeconds
()
{
return
needSeconds
;
}
...
...
app/src/main/java/com/mints/goldspace/mvp/presenters/MyPresenter.kt
View file @
4d0eb8b3
...
...
@@ -246,15 +246,22 @@ open class MyPresenter : BasePresenter<MyView>() {
})
}
fun
setHighTaskType
(
carrierType
:
String
,
value
:
String
)
{
this
.
setHighTaskType
(
carrierType
,
value
,
""
)
}
/**
* 设置高额任务状态
*
* value
*/
fun
setHighTaskType
(
value
:
String
)
{
fun
setHighTaskType
(
carrierType
:
String
,
value
:
String
,
key
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
Constant
.
CARRIER_HIGH_ACTIVITY
vo
[
"carrierType"
]
=
carrierType
vo
[
"value"
]
=
value
if
(!
TextUtils
.
isEmpty
(
key
))
{
vo
[
"key"
]
=
key
}
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
setStatusInOneDayByCarrierType
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
Any
>>()
{
override
fun
onCompleted
()
{
...
...
app/src/main/java/com/mints/goldspace/mvp/presenters/TrackPresenter.java
View file @
4d0eb8b3
package
com
.
mints
.
goldspace
.
mvp
.
presenters
;
import
android.app.Activity
;
import
com.google.gson.JsonObject
;
import
com.mints.goldspace.MintsApplication
;
import
com.mints.goldspace.common.AppConfig
;
import
com.mints.goldspace.common.Constant
;
import
com.mints.goldspace.manager.AppHttpManager
;
...
...
@@ -14,6 +17,8 @@ import com.mints.library.net.neterror.Throwable;
import
java.util.HashMap
;
import
rx.android.schedulers.AndroidSchedulers
;
public
class
TrackPresenter
extends
BaseTrackPresenter
{
/**
...
...
@@ -272,4 +277,32 @@ public class TrackPresenter extends BaseTrackPresenter {
}
});
}
/**
* 上送金币信息
*/
public
void
reportAddCoinMsg
(
Activity
activity
,
HashMap
<
String
,
Object
>
vo
)
{
if
(
activity
==
null
)
return
;
loanApplication
=
(
MintsApplication
)
activity
.
getApplication
();
loanService
=
loanApplication
.
getLoanService
();
subscription
=
loanService
.
reportAddCoinMsg
(
vo
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribeOn
(
loanApplication
.
defaultSubscribeScheduler
())
.
subscribe
(
new
BaseSubscriber
<
BaseResponse
<
Object
>>()
{
@Override
public
void
onCompleted
()
{
}
@Override
public
void
onError
(
Throwable
e
)
{
}
@Override
public
void
onNext
(
BaseResponse
<
Object
>
baseResponse
)
{
}
});
}
}
app/src/main/java/com/mints/goldspace/service/UpdateService.java
View file @
4d0eb8b3
...
...
@@ -254,7 +254,7 @@ public class UpdateService extends Service {
* 每次增张5%
*/
if
(
updateCount
==
0
||
(
downloadCount
*
100
/
totalSize
-
down_step
)
>=
updateCount
)
{
||
(
downloadCount
/
(
totalSize
/
100
)
-
down_step
)
>=
updateCount
)
{
updateCount
+=
down_step
;
message
=
new
Message
();
message
.
what
=
DOWN_PROGRESS
;
...
...
app/src/main/java/com/mints/goldspace/ui/activitys/AwardActivity.kt
View file @
4d0eb8b3
...
...
@@ -181,6 +181,15 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
tvAwardContent
.
text
=
"${curCoin}金币已到账"
tvAwardNext
.
text
=
"我知道了"
}
Constant
.
CARRIER_FIRSTDOWNLOADS
->
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
carrierType
vo
[
"key"
]
=
extraId
awardPresenter
.
reportAddCoinMsg
(
vo
)
tvAwardContent
.
text
=
"${curCoin}金币已到账"
tvAwardNext
.
text
=
"我知道了"
}
Constant
.
CARRIER_BLESSINGBAG
->
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
carrierType
...
...
@@ -383,7 +392,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
flAwardAd
?.
removeAllViews
()
videoAdingManager
.
setVideoAdingListener
(
null
)
videoAdingManager
.
onDest
or
y
()
videoAdingManager
.
onDest
ro
y
()
if
(
mReceiverBroadcastReceiver
!=
null
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
...
...
app/src/main/java/com/mints/goldspace/ui/activitys/KylVideoActivity.kt
View file @
4d0eb8b3
...
...
@@ -99,7 +99,7 @@ class KylVideoActivity : BaseActivity(), View.OnClickListener, KylVideoView {
PRDownloader
.
cancel
(
downloadId
)
}
videoAdingManager
.
setVideoAdingListener
(
null
)
videoAdingManager
.
onDest
or
y
()
videoAdingManager
.
onDest
ro
y
()
kylVideoPresenter
.
detachView
()
}
...
...
app/src/main/java/com/mints/goldspace/ui/activitys/MainActivity.kt
View file @
4d0eb8b3
...
...
@@ -92,7 +92,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
TTPreLoadCarrierExpressManager
.
getInstance
().
onDestroy
()
VideoAdingManager
.
getInstance
(
this
).
setVideoAdingListener
(
null
)
VideoAdingManager
.
getInstance
(
this
).
onDest
or
y
()
VideoAdingManager
.
getInstance
(
this
).
onDest
ro
y
()
}
public
override
fun
onSaveInstanceState
(
outState
:
Bundle
)
{
...
...
app/src/main/java/com/mints/goldspace/ui/adapter/MainMyAdapter.kt
View file @
4d0eb8b3
...
...
@@ -54,6 +54,9 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>
// 喜马拉雅
const
val
TO_XMLY
=
"TO_XMLY"
// 其他下载应用
const
val
TO_DOWNLOADS
=
"TO_DOWNLOADS"
}
private
var
mContext
:
Context
=
context
...
...
@@ -143,7 +146,7 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>
}
else
{
holder
.
itemTaskPb
.
visibility
=
View
.
GONE
}
if
(
taskBean
.
baseConfig
.
runingText
!=
null
&&
taskBean
.
otherConfig
.
max
!=
0
)
{
if
(
taskBean
.
baseConfig
.
runingText
!=
null
&&
taskBean
.
otherConfig
!=
null
&&
taskBean
.
otherConfig
.
max
!=
0
)
{
holder
.
itemTaskProgress
.
visibility
=
View
.
VISIBLE
holder
.
itemTaskProgress
.
text
=
taskBean
.
baseConfig
.
runingText
}
else
{
...
...
app/src/main/java/com/mints/goldspace/ui/fragment/MainFragment.kt
View file @
4d0eb8b3
...
...
@@ -399,7 +399,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
rl_fragment_main_redbox
.
isClickable
=
false
// 广告回调
YLUIConfig
.
getInstance
().
registerAdListener
(
object
:
YLAdListener
{
YLUIConfig
.
getInstance
().
registerAdListener
(
object
:
YLAdListener
()
{
override
fun
onSuccess
(
p0
:
String
?,
p1
:
Int
,
p2
:
String
?,
p3
:
String
?)
{
}
...
...
app/src/main/java/com/mints/goldspace/ui/fragment/MyFragment.kt
View file @
4d0eb8b3
...
...
@@ -85,6 +85,11 @@ class MyFragment : BaseFragment(),
private
var
carrierType
=
""
private
var
curSignCoin
=
50
// 牧场人生安装奖励金币
private
var
pkgMCRSName
=
""
private
var
pkgMCRSCarrier
=
""
private
var
pkgMCRSKey
=
""
// 签到信息
private
var
signCardBean
:
SignCardBean
?
=
null
...
...
@@ -149,14 +154,14 @@ class MyFragment : BaseFragment(),
private
fun
refreshHighTask
()
{
if
(
AppConfig
.
isHighTask
&&
mCurrentPkg
!=
null
)
{
if
(
AppTryPlayManager
.
getTryPlayIsOK
(
mCurrentPkg
!!
,
30
))
{
myPresenter
.
setHighTaskType
(
"1"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"1"
)
}
else
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
0
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_HIGH_ACTIVITY
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
myPresenter
.
setHighTaskType
(
"0"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"0"
)
}
AppConfig
.
isHighTask
=
false
}
...
...
@@ -174,10 +179,7 @@ class MyFragment : BaseFragment(),
BannerManager
.
onDestroy
()
myPresenter
.
detachView
()
if
(
mReceiverBroadcastReceiver
!=
null
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
}
onDestroyBroadcastReceiver
()
}
override
fun
getUserTaskMsgSuc
(
data
:
MyInfo
?)
{
...
...
@@ -282,6 +284,8 @@ class MyFragment : BaseFragment(),
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
onDestroyBroadcastReceiver
()
if
(
userManager
.
userID
.
isNotEmpty
())
{
myPresenter
.
getAutoUserHallBaseMsg
()
}
else
{
...
...
@@ -506,7 +510,7 @@ class MyFragment : BaseFragment(),
// if (TextUtils.isEmpty(mCurrentPkg)) {
if
(
mCurrentPkg
==
null
)
{
showToast
(
"任务异常,请重试~"
)
myPresenter
.
setHighTaskType
(
"0"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"0"
)
AppConfig
.
isHighTask
=
false
}
else
{
...
...
@@ -516,7 +520,7 @@ class MyFragment : BaseFragment(),
AppConfig
.
isHighTask
=
true
}
else
{
showToast
(
"未找到当前APP、可能被卸载,请重试~"
)
myPresenter
.
setHighTaskType
(
"0"
)
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"0"
)
AppConfig
.
isHighTask
=
false
}
...
...
@@ -706,6 +710,29 @@ class MyFragment : BaseFragment(),
}
}
MainMyAdapter
.
TO_DOWNLOADS
->
{
if
(
taskBean
.
otherConfig
!=
null
)
{
when
(
taskBean
.
otherConfig
.
status
)
{
0
->
{
pkgMCRSCarrier
=
Constant
.
CARRIER_FIRSTDOWNLOADS
pkgMCRSKey
=
taskBean
.
otherConfig
.
key
pkgMCRSName
=
taskBean
.
otherConfig
.
pkg
DownloadApkManager
.
downloadApk
(
requireActivity
(),
taskBean
.
otherConfig
.
downloadUrl
,
pkgMCRSName
)
// 开启广播监听安装事件
registerBroad
()
}
1
->
{
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
MAIN_CUR_COIN
,
taskBean
.
otherConfig
.
coin
)
bundle
.
putString
(
Constant
.
MAIN_CARRIER_TYPE
,
Constant
.
CARRIER_FIRSTDOWNLOADS
)
bundle
.
putString
(
Constant
.
MAIN_EXTRA_ID
,
taskBean
.
otherConfig
.
key
)
readyGo
(
AwardActivity
::
class
.
java
,
bundle
)
onDestroyBroadcastReceiver
()
}
}
}
}
}
}
}
...
...
@@ -1286,18 +1313,22 @@ class MyFragment : BaseFragment(),
override
fun
onReceive
(
context
:
Context
?,
intent
:
Intent
?)
{
if
(
intent
==
null
)
return
// 非高额任务不监听下载安装
if
(
TextUtils
.
equals
(
carrierType
,
Constant
.
CARRIER_HIGH_ACTIVITY
))
{
try
{
val
pkg
=
intent
.
getStringExtra
(
"pkg"
)
try
{
val
pkg
=
intent
.
getStringExtra
(
"pkg"
)
// 非高额任务不监听下载安装
if
(
TextUtils
.
equals
(
carrierType
,
Constant
.
CARRIER_HIGH_ACTIVITY
))
{
mCurrentPkg
=
pkg
// ps.put(Constant.HIGH_TASK_PKG_NAME, pkg)
myPresenter
.
setHighTaskType
(
"3"
)
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
myPresenter
.
setHighTaskType
(
Constant
.
CARRIER_HIGH_ACTIVITY
,
"3"
)
}
else
if
(
TextUtils
.
equals
(
pkg
,
pkgMCRSName
))
{
// 上报后台更新按钮状态
myPresenter
.
setHighTaskType
(
pkgMCRSCarrier
,
"1"
,
pkgMCRSKey
)
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
}
}
...
...
@@ -1322,4 +1353,15 @@ class MyFragment : BaseFragment(),
}
}
}
/**
* 下载安装广播回收
*/
private
fun
onDestroyBroadcastReceiver
()
{
if
(
mReceiverBroadcastReceiver
!=
null
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mReceiverBroadcastReceiver
=
null
}
}
}
\ No newline at end of file
app/src/main/java/com/mints/goldspace/ui/fragment/TaskCpdFragment.kt
View file @
4d0eb8b3
...
...
@@ -109,6 +109,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
}
private
fun
initListener
()
{
onDestroyBroadcastReceiver
()
srl_task
.
setOnRefreshListener
(
this
)
}
...
...
@@ -382,11 +383,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
mDownloadProcess
=
null
DownloadApkManager
.
destroy
()
if
(
mReceiverBroadcastReceiver
!=
null
)
{
activity
?.
stopService
(
Intent
(
activity
,
AppInstallService
::
class
.
java
))
activity
?.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mReceiverBroadcastReceiver
=
null
}
onDestroyBroadcastReceiver
()
taskPresenter
.
detachView
()
super
.
onDestroy
()
...
...
@@ -558,7 +555,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
val
currentPkgName
=
mFakeTaskList
[
position
].
currentPkgName
if
(
currentPkgName
!=
null
)
{
onDestroyBroadcastReceiver
()
// 时间为0
if
(
needUseTime
==
0
)
{
mFakeTaskList
[
position
].
state
=
2
...
...
@@ -667,4 +664,12 @@ class TaskCpdFragment : BaseFragment(), TaskView,
}
}
}
private
fun
onDestroyBroadcastReceiver
()
{
if
(
mReceiverBroadcastReceiver
!=
null
)
{
mContext
.
stopService
(
Intent
(
context
,
AppInstallService
::
class
.
java
))
mContext
.
unregisterReceiver
(
mReceiverBroadcastReceiver
)
mReceiverBroadcastReceiver
=
null
}
}
}
\ No newline at end of file
app/src/main/java/com/mints/goldspace/ui/widgets/DrawcashVideoDialog.kt
View file @
4d0eb8b3
...
...
@@ -50,7 +50,7 @@ class DrawcashVideoDialog(activity: Activity) :
fun
onDestory
(){
videoAdingManager
?.
setVideoAdingListener
(
null
)
videoAdingManager
?.
onDest
or
y
()
videoAdingManager
?.
onDest
ro
y
()
activity
=
null
}
...
...
gradle.properties
View file @
4d0eb8b3
...
...
@@ -39,7 +39,7 @@ RELEASE_TD_SCHEMA_KEY=talkingdata.b2d6d7525094470ea990c3f94278b404
RELEASE_UMENG_KEY
=
601f8398425ec25f10efbe06
#JPush
RELEASE_JPUSH_KEY
=
d1fc227e2d3ec3c7a8cafa69
RELEASE_JPUSH_KEY
=
e864052800b70b287c0fef43
android.useAndroidX
=
true
android.enableJetifier
=
true
\ No newline at end of file
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