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
2e5ae5df
Commit
2e5ae5df
authored
Jan 14, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
天卓激励视频
parent
15b989a1
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
373 additions
and
105 deletions
+373
-105
build.gradle
GoodMoney/app/build.gradle
+15
-10
GDTSDK.tbsNoPlugin.4.290.1160.aar
GoodMoney/app/libs/GDTSDK.tbsNoPlugin.4.290.1160.aar
+0
-0
discovery-2.0.14.aar
GoodMoney/app/libs/discovery-2.0.14.aar
+0
-0
ks_adsdk-2.6.8.aar
GoodMoney/app/libs/ks_adsdk-2.6.8.aar
+0
-0
shanhuAD.1.2.0.aar
GoodMoney/app/libs/shanhuAD.1.2.0.aar
+0
-0
tzsdk_coral-2.0.0-20200807131516-release.aar
...ney/app/libs/tzsdk_coral-2.0.0-20200807131516-release.aar
+0
-0
tzsdk_core-3.0.0-20200807131516-release.aar
...oney/app/libs/tzsdk_core-3.0.0-20200807131516-release.aar
+0
-0
tzsdk_reporter-3.0.0-20200807131516-release.aar
.../app/libs/tzsdk_reporter-3.0.0-20200807131516-release.aar
+0
-0
AndroidManifest.xml
GoodMoney/app/src/main/AndroidManifest.xml
+6
-16
40805.dat
GoodMoney/app/src/main/assets/40805.dat
+0
-0
InitAppService.kt
...y/app/src/main/java/com/mints/goodmoney/InitAppService.kt
+15
-0
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+1
-3
ADType.java
...pp/src/main/java/com/mints/goodmoney/ad/tz_ad/ADType.java
+0
-50
CoralDownload.java
...main/java/com/mints/goodmoney/ad/tz_ad/CoralDownload.java
+95
-18
BaseVedioAd.kt
...src/main/java/com/mints/goodmoney/ad/vedio/BaseVedioAd.kt
+1
-3
MhVedioAdManager.kt
...ain/java/com/mints/goodmoney/ad/vedio/MhVedioAdManager.kt
+2
-2
TzVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/vedio/TzVideoAdManager.kt
+193
-0
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+1
-0
TzManager.kt
...pp/src/main/java/com/mints/goodmoney/manager/TzManager.kt
+2
-2
TzVideoAdPresenter.kt
.../com/mints/goodmoney/mvp/presenters/TzVideoAdPresenter.kt
+38
-0
SettingsActivity.kt
...java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
+4
-1
No files found.
GoodMoney/app/build.gradle
View file @
2e5ae5df
...
...
@@ -33,7 +33,7 @@ android {
UMENG_KEY
:
RELEASE_UMENG_KEY
,
SHARE_KEY
:
RELEASE_SHARESDK_KEY
,
SHARE_SECRET
:
RELEASE_SHARESDK_SECRET
,
"APPLICATION_ID"
:
applicationId
]
"APPLICATION_ID"
:
applicationId
]
}
...
...
@@ -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'
)
...
...
@@ -262,21 +262,26 @@ dependencies {
implementation
'com.just.agentweb:agentweb:4.1.2'
// 喜马拉雅 已集成
// 微转阅读
implementation
(
name:
'articlesdk-v1.0.6.202012121917-x'
,
ext:
'aar'
)
//天卓SDK的珊瑚2.1组件
//快手SDK 2.6.5之后的版本,SDK有依赖appcompat-v7
// implementation 'com.android.support:appcompat-v7:28.0.0'
// implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation
(
name:
'tzsdk_coral-2.1.0-20200807130815-release'
,
ext:
'aar'
)
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
(
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'
)
// testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
...
...
GoodMoney/app/libs/GDTSDK.tbsNoPlugin.4.290.1160.aar
0 → 100755
View file @
2e5ae5df
File added
GoodMoney/app/libs/discovery-2.0.14.aar
0 → 100644
View file @
2e5ae5df
File added
GoodMoney/app/libs/ks_adsdk-2.6.8.aar
0 → 100644
View file @
2e5ae5df
File added
GoodMoney/app/libs/shanhuAD.1.2.0.aar
0 → 100644
View file @
2e5ae5df
File added
GoodMoney/app/libs/tzsdk_coral-2.0.0-20200807131516-release.aar
0 → 100644
View file @
2e5ae5df
File added
GoodMoney/app/libs/tzsdk_core-3.0.0-20200807131516-release.aar
0 → 100644
View file @
2e5ae5df
File added
GoodMoney/app/libs/tzsdk_reporter-3.0.0-20200807131516-release.aar
0 → 100644
View file @
2e5ae5df
File added
GoodMoney/app/src/main/AndroidManifest.xml
View file @
2e5ae5df
...
...
@@ -12,17 +12,11 @@
<uses-permission
android:name=
"android.permission.REQUEST_INSTALL_PACKAGES"
/>
<uses-permission
android:name=
"android.permission.GET_TASKS"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.WRITE_SETTINGS"
tools:ignore=
"ProtectedPermissions"
/>
<uses-permission
android:name=
"android.permission.WRITE_SETTINGS"
/>
<uses-permission
android:name=
"android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"
/>
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
tools:ignore=
"ProtectedPermissions"
/>
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
/>
<permission
android:name=
"com.mints.goodmoney.permission.JPUSH_MESSAGE"
android:protectionLevel=
"signature"
/>
<permission
android:name=
"com.mints.goodmoney.permission.JPUSH_MESSAGE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
...
...
@@ -30,17 +24,13 @@
<uses-permission
android:name=
"com.mints.goodmoney.permission.JPUSH_MESSAGE"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_USER_PRESENT"
/>
<uses-permission
android:name=
"android.permission.VIBRATE"
/>
<uses-permission
android:name=
"android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
tools:ignore=
"ProtectedPermissions"
/>
<uses-permission
android:name=
"android.permission.MOUNT_UNMOUNT_FILESYSTEMS"
/>
<uses-permission
android:name=
"android.permission.SYSTEM_ALERT_WINDOW"
/>
<uses-permission
android:name=
"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"
/>
<uses-permission
android:name=
"android.permission.CHANGE_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.ACCESS_BACKGROUND_LOCATION"
/>
<uses-permission
android:name=
"android.permission.SET_WALLPAPER"
/>
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
tools:ignore=
"ProtectedPermissions"
/>
<uses-permission
android:name=
"android.permission.PACKAGE_USAGE_STATS"
/>
<application
android:name=
".MintsApplication"
...
...
@@ -257,7 +247,7 @@
<receiver
android:name=
".service.PushMessageReceiver"
>
<intent-filter>
<action
android:name=
"cn.jpush.android.intent.RECEIVE_MESSAGE"
/>
<category
android:name=
"${applicationId}"
/>
<category
android:name=
"${applicationId}"
/>
</intent-filter>
</receiver>
...
...
GoodMoney/app/src/main/assets/40805.dat
View file @
2e5ae5df
No preview for this file type
GoodMoney/app/src/main/java/com/mints/goodmoney/InitAppService.kt
View file @
2e5ae5df
...
...
@@ -6,6 +6,8 @@ import android.content.Context
import
android.content.Intent
import
cn.jpush.android.api.BasicPushNotificationBuilder
import
cn.jpush.android.api.JPushInterface
import
com.downloader.PRDownloader
import
com.downloader.PRDownloaderConfig
import
com.mints.goodmoney.manager.BxmManager.initBxm
import
com.mob.MobSDK
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
...
...
@@ -64,6 +66,19 @@ class InitAppService : IntentService("InitializeService") {
// 变现猫
initBxm
(
this
.
application
)
// PR下载附件
initPRDownloader
()
}
/**
* PR下载附件
*/
private
fun
initPRDownloader
()
{
val
config
=
PRDownloaderConfig
.
newBuilder
()
.
setDatabaseEnabled
(
true
)
.
build
()
PRDownloader
.
initialize
(
this
,
config
)
}
private
fun
initWzShare
()
{
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
2e5ae5df
...
...
@@ -14,7 +14,6 @@ import com.downloader.PRDownloader;
import
com.downloader.PRDownloaderConfig
;
import
com.hjq.toast.ToastUtils
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.BxmManager
;
import
com.mints.goodmoney.manager.ChannelManager
;
import
com.mints.goodmoney.manager.LiebaoManager
;
import
com.mints.goodmoney.manager.MhManager
;
...
...
@@ -101,7 +100,6 @@ public class MintsApplication extends MultiDexApplication {
@Override
protected
void
attachBaseContext
(
Context
base
)
{
super
.
attachBaseContext
(
base
);
// MultiDex.install(this);
// 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前
androidPWebView
();
...
...
@@ -161,7 +159,7 @@ public class MintsApplication extends MultiDexApplication {
bindLogger
();
// PR下载附件
initPRDownloader
();
//
initPRDownloader();
// 天卓
TzManager
.
INSTANCE
.
initTz
(
this
);
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/tz_ad/ADType.java
deleted
100644 → 0
View file @
15b989a1
package
com
.
mints
.
goodmoney
.
ad
.
tz_ad
;
public
enum
ADType
{
CoralCard
(
102
,
"卡券"
,
1
),
CoralDownload
(
103
,
"下载"
,
2
),
CoralDownloadGdt
(
134
,
"下载"
,
3
),
CoralRewardVideo
(
104
,
"视频"
,
4
),
CoralRewardVideoGdt
(
131
,
"视频"
,
5
),
CoralRewardVideoKs
(
132
,
"视频"
,
6
),
CoralSplashImage
(
125
,
"开屏"
,
7
),
CoralBanner
(
130
,
"横幅"
,
8
),
CoralInfoFeed
(
128
,
"信息流"
,
9
),
CoralFullScreenVideo
(
137
,
"全屏"
,
10
),
CoralVideoFeed
(
138
,
"联盟"
,
11
);
private
int
mTaskType
;
private
String
mName
;
private
int
mColumnIndex
;
ADType
(
int
taskType
,
String
name
,
int
columnIndex
)
{
mTaskType
=
taskType
;
mName
=
name
;
mColumnIndex
=
columnIndex
;
}
static
ADType
of
(
int
taskType
)
{
for
(
ADType
adType
:
values
())
{
if
(
adType
.
mTaskType
==
taskType
)
{
return
adType
;
}
}
return
null
;
}
public
int
getTaskType
()
{
return
mTaskType
;
}
public
String
getName
()
{
return
mName
;
}
public
int
getColumnIndex
()
{
return
mColumnIndex
;
}
public
String
getCombinedName
()
{
return
mName
+
(
mTaskType
!=
0
?
mTaskType
:
""
);
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/tz_ad/CoralDownload.java
View file @
2e5ae5df
...
...
@@ -26,23 +26,12 @@ public final class CoralDownload {
private
int
mTaskType
;
/**
*
* taskType 珊瑚的任务类型 103正式环境 134测试环境
*/
public
CoralDownload
(
int
taskType
)
{
mTaskType
=
taskType
;
}
// public boolean i = true;
/**
* i用于判断如果已经在下载了,那就在download回调里return false,不进行重复的下载
*
* @return
*/
// public com.mints.goodmoney.ad.tz_ad.ADType getADType() {
// return com.mints.goodmoney.ad.tz_ad.ADType.CoralDownload;
// }
public
void
pull
()
{
new
ADLoader
(
MintsApplication
.
getContext
())
.
get
(
ADType
.
APP_DOWNLOAD
)
...
...
@@ -57,34 +46,63 @@ public final class CoralDownload {
}
})
.
load
(
new
CoralADListener
()
{
/**
* 任务拉取成功
*
* @param rewardTask 积分任务
* @return true:继续拉取广告,false:不拉取广告。默认:继续拉取广告
*/
@Override
public
boolean
onTaskAvailable
(
RewardTask
rewardTask
)
{
return
super
.
onTaskAvailable
(
rewardTask
);
}
/**
* 任务拉取失败
*
* @param taskType 任务类型
* @param adError 错误信息
* @return true:继续拉取广告,false:不拉取广告。默认:继续拉取广告
*/
@Override
public
boolean
onTaskNotAvailable
(
int
taskType
,
ADError
adError
)
{
return
super
.
onTaskNotAvailable
(
taskType
,
adError
);
}
/**
* 跳转h5
*
* @param ad 广告
* @param h5Url h5地址
* @return true:使用sdk内部跳转,如果绑定了积分任务,sdk会自动提交任务。
* false:接入方自行跳转显示页面,如果绑定了积分任务,需要接入方手动提交任务。
*/
@Override
public
boolean
openH5
(
CoralAD
ad
,
String
h5Url
)
{
return
super
.
openH5
(
ad
,
h5Url
);
}
/**
* 非广点通的App下载被点击触发
*
* @param downloadProcess 下载数据
* @return true:使用sdk内部进行下载,并自动上报数据,如果绑定了积分任务,可以在后续事件中选择由sdk自动提交任务。
* false:接入方自行创建下载流程,但需要手动上报下载、安装、打开等事件,如果绑定了积分任务,还需要手动提交任务。
*/
@Override
public
boolean
download
(
DownloadProcess
downloadProcess
)
{
// if (!i) {
// return false;
// }
if
(
mOnAdLoadListener
!=
null
)
{
mOnAdLoadListener
.
onGetDownloadProcess
(
downloadProcess
);
}
// downloadProcess.reportDownloadStart();
return
false
;
}
/**
* 广告拉取失败
*
* @param adError 错误信息 {@link ADError}
*/
@Override
public
void
onAdFailed
(
ADError
adError
)
{
super
.
onAdFailed
(
adError
);
...
...
@@ -93,6 +111,11 @@ public final class CoralDownload {
}
}
/**
* 广告拉取成功
*
* @param adList 广告列表
*/
@Override
public
void
onAdLoaded
(
List
<
CoralAD
>
adList
)
{
if
(
adList
!=
null
&&
adList
.
size
()
>
0
)
{
...
...
@@ -106,36 +129,90 @@ public final class CoralDownload {
}
}
/**
* 广告已显示
*
* @param ad 广告(部分广告类型返回为空)
* @return true:如果绑定了积分任务,则sdk立即提交任务,并忽略后续的提交。
* false:如果绑定了积分任务,不做提交,由后续事件决定。
* 默认:不提交
*/
@Override
public
boolean
onAdShow
(
@Nullable
CoralAD
ad
)
{
return
false
;
}
/**
* 广告被点击
*
* @param ad 广告(部分广告类型返回为空)
* @return true:如果绑定了积分任务,则sdk立即提交任务,并忽略后续的提交。
* false:如果绑定了积分任务,不做提交,由后续事件决定。
* 默认:不提交
*/
@Override
public
boolean
onAdClicked
(
@Nullable
CoralAD
ad
)
{
return
false
;
}
/**
* App开始下载
*
* @param ad 广告(广点通下载类返回为空)
* @param downloadUrl 下载地址
* @return true:如果绑定了积分任务,则sdk立即提交任务,并忽略后续的提交。
* false:如果绑定了积分任务,不做提交,由后续事件决定。
* 默认:不提交
*/
@Override
public
boolean
onAppDownloading
(
@Nullable
CoralAD
ad
,
@Nullable
String
downloadUrl
)
{
// i = false;
return
false
;
}
/**
* App下载完成
*
* @param ad 广告(广点通下载类返回为空)
* @param downloadUrl 下载地址
* @param localFile 本地保存文件
* @return true:如果绑定了积分任务,则sdk立即提交任务,并忽略后续的提交。
* false:如果绑定了积分任务,不做提交,由后续事件决定。
* 默认:不提交
*/
@Override
public
boolean
onAppDownloaded
(
@Nullable
CoralAD
ad
,
@Nullable
String
downloadUrl
,
@Nullable
String
localFile
)
{
// i = true;
return
false
;
}
/**
* App已安装
*
* @param ad 广告(广点通下载类返回为空)
* @param downloadUrl 下载地址
* @param localFile 本地保存文件
* @return true:如果绑定了积分任务,则sdk立即提交任务,并忽略后续的提交。
* false:如果绑定了积分任务,不做提交,由后续事件决定。
* 默认:不提交
*/
@Override
public
boolean
onAppInstalled
(
@Nullable
CoralAD
ad
,
@Nullable
String
downloadUrl
,
@Nullable
String
localFile
)
{
return
false
;
}
/**
* App已打开激活
*
* @param ad 广告(广点通下载类返回为空)
* @param downloadUrl 下载地址
* @param localFile 本地保存文件
* @return true:如果绑定了积分任务,则sdk立即提交任务,并忽略后续的提交。
* false:如果绑定了积分任务,不做提交,由后续事件决定。
* 默认:提交
*/
@Override
public
boolean
onAppActivated
(
CoralAD
ad
,
String
downloadUrl
,
String
localFile
)
{
return
super
.
onAppActivated
(
ad
,
downloadUrl
,
localFile
)
;
return
false
;
}
});
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/vedio/BaseVedioAd.kt
View file @
2e5ae5df
...
...
@@ -58,9 +58,7 @@ open class BaseVedioAd(activity: Activity) : BaseView {
fun
setProgressNoDismiss
()
{
if
(
progressDialog
!=
null
&&
progressDialog
!!
.
isShowing
())
{
progressDialog
!!
.
setOnKeyListener
(
DialogInterface
.
OnKeyListener
{
dialog
,
keyCode
,
event
->
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
true
}
else
false
keyCode
==
KeyEvent
.
KEYCODE_BACK
})
}
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/vedio/MhVedioAdManager.kt
View file @
2e5ae5df
...
...
@@ -10,14 +10,14 @@ import com.mints.goodmoney.mvp.presenters.MhVedioAdPresenter
import
com.mints.goodmoney.mvp.views.VedioAdManagerView
import
com.mints.goodmoney.utils.LogUtil
private
val
TAG
=
MhVedioAdManager
::
class
.
java
.
simpleName
/**
* 枫岚广告视频
*/
class
MhVedioAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVedioAd
(
activity
),
VedioAdManagerView
{
private
val
TAG
=
MhVedioAdManager
::
class
.
java
.
simpleName
private
var
mhVdedioAdPresenter
:
MhVedioAdPresenter
?
=
null
private
var
mhVedioAdListener
:
MhVedioAdListener
?
=
null
private
var
mRewardVideoAd
:
RewardVideoAd
?
=
null
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/vedio/TzVideoAdManager.kt
0 → 100644
View file @
2e5ae5df
package
com.mints.goodmoney.ad.vedio
import
android.app.Activity
import
androidx.annotation.Nullable
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.VedioAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.tz.sdk.coral.ad.CoralAD
import
com.tz.sdk.coral.callback.CoralVideoListener
import
com.tz.sdk.core.ad.ADError
import
com.tz.sdk.core.ad.ADSource
import
com.tz.sdk.core.ad.ADType
import
com.tz.sdk.core.loader.ADLoader
private
val
TAG
=
TzVideoAdManager
::
class
.
java
.
simpleName
/**
* 天卓广告视频
*/
class
TzVideoAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVedioAd
(
activity
),
VedioAdManagerView
{
private
var
isClickScreen
:
Boolean
=
true
private
var
tzVideoAdPresenter
:
TzVideoAdPresenter
?
=
null
private
var
tzVideoAdListener
:
TzVideoAdListener
?
=
null
companion
object
{
/**
* taskType 珊瑚的任务类型
* 104(正式环境使用,珊瑚和广点通、快手视频混出)
* 131(测试环境使用,广点通视频单出)
*/
const
val
TZ_REWRAD_TYPE
=
132
private
var
_inst
:
TzVideoAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
TzVideoAdManager
?
{
return
if
(
_inst
!=
null
)
{
_inst
}
else
{
_inst
=
TzVideoAdManager
(
activity
)
_inst
}
}
}
init
{
init
(
activity
)
}
private
fun
init
(
activity
:
Activity
)
{
this
.
activity
=
activity
tzVideoAdPresenter
=
TzVideoAdPresenter
()
tzVideoAdPresenter
?.
attachView
(
this
)
}
override
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{
this
.
activity
=
activity
isClickScreen
=
true
ADLoader
(
activity
)
.
get
(
ADType
.
REWARD_VIDEO
)
.
from
(
ADSource
.
CORAL
)
.
reward
(
true
)
.
count
(
1
)
.
with
(
object
:
HashMap
<
String
?,
Any
?>()
{
init
{
put
(
CoralAD
.
Key
.
TASK_TYPE
,
TZ_REWRAD_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
}
})
.
load
(
object
:
CoralVideoListener
()
{
override
fun
onAdLoaded
(
adList
:
List
<
CoralAD
>?)
{
LogUtil
.
d
(
TAG
,
"onAdLoaded"
)
if
(
adList
!=
null
&&
adList
.
isNotEmpty
())
{
val
ad
=
adList
[
0
]
// ad.playVideo(activity)
}
else
{
}
}
override
fun
onAdFailed
(
adError
:
ADError
)
{
LogUtil
.
d
(
TAG
,
"onAdFailed"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_TZ
,
Constant
.
EVENT_TYPE_ONE
,
(
adError
.
code
).
toString
(),
""
)
if
(
tzVideoAdListener
!=
null
)
{
tzVideoAdListener
?.
tzVideoAdFail
()
}
}
override
fun
onAdShow
(
@Nullable
ad
:
CoralAD
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onAdShow"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_TZ
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
)
return
super
.
onAdShow
(
ad
)
}
override
fun
onAdClicked
(
@Nullable
ad
:
CoralAD
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onADClick"
)
if
(
AppConfig
.
needReportClickAdEvent
)
{
TrackManager
.
getInstance
().
reportClickAdEvent
()
}
if
(
isClickScreen
)
{
// 防止重复
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_FL
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
tzVideoAdListener
!=
null
)
{
tzVideoAdListener
?.
tzVideoAdDownload
()
}
return
super
.
onAdClicked
(
ad
)
}
override
fun
onAppDownloading
(
@Nullable
ad
:
CoralAD
?,
@Nullable
downloadUrl
:
String
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onAppDownloading"
)
return
super
.
onAppDownloading
(
ad
,
downloadUrl
)
}
override
fun
onAppDownloaded
(
@Nullable
ad
:
CoralAD
?,
@Nullable
downloadUrl
:
String
?,
@Nullable
localFile
:
String
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onAppDownloaded"
)
return
super
.
onAppDownloaded
(
ad
,
downloadUrl
,
localFile
)
}
override
fun
onAppInstalled
(
@Nullable
ad
:
CoralAD
?,
@Nullable
downloadUrl
:
String
?,
@Nullable
localFile
:
String
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onAppInstalled"
)
return
super
.
onAppInstalled
(
ad
,
downloadUrl
,
localFile
)
}
override
fun
onAppActivated
(
ad
:
CoralAD
?,
downloadUrl
:
String
?,
localFile
:
String
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onAppActivated"
)
return
super
.
onAppActivated
(
ad
,
downloadUrl
,
localFile
)
}
override
fun
onVideoFinished
(
@Nullable
coralAD
:
CoralAD
?,
@Nullable
s
:
String
?):
Boolean
{
LogUtil
.
d
(
TAG
,
"onVideoFinished"
)
return
super
.
onVideoFinished
(
coralAD
,
s
)
}
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
))
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_TZ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
tzVideoAdListener
!=
null
)
{
tzVideoAdListener
?.
tzVideoAdSuccess
()
}
return
super
.
onVideoClosed
(
coralAD
,
s
)
}
})
}
fun
setTzVedioAdListener
(
tzVideoAdListener
:
TzVideoAdListener
?)
{
this
.
tzVideoAdListener
=
tzVideoAdListener
}
interface
TzVideoAdListener
{
fun
tzVideoAdSuccess
()
fun
tzVideoAdFail
()
fun
tzVideoAdDownload
()
}
override
fun
onDestory
()
{
tzVideoAdPresenter
?.
let
{
it
.
dispose
()
it
.
detachView
()
}
activity
=
null
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
2e5ae5df
...
...
@@ -138,6 +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"
//天卓
// 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
const
val
EVENT_TYPE_ZERO
=
"0"
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/TzManager.kt
View file @
2e5ae5df
...
...
@@ -17,13 +17,13 @@ object TzManager {
* 初始化
*/
fun
initTz
(
application
:
Application
)
{
val
td_channel_id
=
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
ADEngine
.
getInstance
(
application
)
.
start
(
ADEngineConfig
.
Builder
(
application
)
.
appKey
(
"547ffff6446c5a8acd4175fb7a71a0d1"
)
.
appSecret
(
"1c00e59f2257bdfdd4ad9363b41621b5"
)
.
appChannel
(
td_channel_id
)
.
appChannel
(
CommonUtils
.
getAppMetaData
(
MintsApplication
.
getContext
(),
"CHANNEL_NAME"
)
)
.
forTest
(
BuildConfig
.
DEBUG
)
.
verbose
(
BuildConfig
.
DEBUG
)
.
build
(),
object
:
IADEngineState
{
override
fun
onIdle
()
{}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/TzVideoAdPresenter.kt
0 → 100644
View file @
2e5ae5df
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.VedioAdManagerView
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
<
VedioAdManagerView
>()
{
fun
reportAddCoinMsg
(
activity
:
Activity
?,
vo
:
HashMap
<
String
,
Any
>)
{
if
(
activity
==
null
)
return
loanApplication
=
activity
.
application
as
MintsApplication
loanService
=
loanApplication
.
loanService
subscription
=
loanService
.
reportAddCoinMsg
(
vo
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribeOn
(
loanApplication
.
defaultSubscribeScheduler
())
.
subscribe
(
object
:
BaseSubscriber
<
BaseResponse
<
Any
>>()
{
override
fun
onCompleted
()
{}
override
fun
onError
(
e
:
Throwable
)
{
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
Any
>)
{}
})
}
fun
dispose
()
{
loanService
=
null
loanApplication
=
null
if
(
subscription
!=
null
&&
!
subscription
.
isUnsubscribed
())
{
subscription
.
unsubscribe
()
}
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SettingsActivity.kt
View file @
2e5ae5df
...
...
@@ -13,6 +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.vedio.TzVideoAdManager
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.login.LoginApi
import
com.mints.goodmoney.login.OnLoginListener
...
...
@@ -187,7 +188,9 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
submitInvitedCode
()
}
R
.
id
.
item_cleanCache
->
{
clearDialog
()
// clearDialog()
TzVideoAdManager
.
getInstance
(
this
)
?.
loadAd
(
this
,
10
,
"A"
,
"0"
)
}
R
.
id
.
item_userAgree
->
{
val
bundle
=
Bundle
()
...
...
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