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
9c6f453d
Commit
9c6f453d
authored
Dec 01, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加闪电盒子
parent
1c13d8ef
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
451 additions
and
106 deletions
+451
-106
build.gradle
GoodMoney/app/build.gradle
+4
-2
wannuosili_ad_2.0.0.aar
GoodMoney/app/libs/wannuosili_ad_2.0.0.aar
+0
-0
proguard-rules.pro
GoodMoney/app/proguard-rules.pro
+10
-1
AndroidManifest.xml
GoodMoney/app/src/main/AndroidManifest.xml
+12
-0
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+4
-0
BaseVideoAd.kt
...src/main/java/com/mints/goodmoney/ad/video/BaseVideoAd.kt
+42
-15
CsjVedioAdManager.java
.../java/com/mints/goodmoney/ad/video/CsjVedioAdManager.java
+0
-12
VedioAdingManager.java
.../java/com/mints/goodmoney/ad/video/VedioAdingManager.java
+55
-3
WnVedioAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/WnVedioAdManager.kt
+160
-0
YlhVedioAdManager.java
.../java/com/mints/goodmoney/ad/video/YlhVedioAdManager.java
+5
-32
AppConfig.java
...p/src/main/java/com/mints/goodmoney/common/AppConfig.java
+4
-0
Constant.kt
.../app/src/main/java/com/mints/goodmoney/common/Constant.kt
+2
-0
WnManager.kt
...pp/src/main/java/com/mints/goodmoney/manager/WnManager.kt
+37
-0
VedioRulesBean.java
...in/java/com/mints/goodmoney/mvp/model/VedioRulesBean.java
+18
-0
WnVedioAdPresenter.kt
.../com/mints/goodmoney/mvp/presenters/WnVedioAdPresenter.kt
+38
-0
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+11
-3
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+40
-38
wn_file_paths.xml
GoodMoney/app/src/main/res/xml/wn_file_paths.xml
+9
-0
No files found.
GoodMoney/app/build.gradle
View file @
9c6f453d
...
...
@@ -9,8 +9,8 @@ android {
applicationId
"com.mints.goodmoney"
minSdkVersion
rootProject
.
ext
.
androidMinSdkVersion
targetSdkVersion
rootProject
.
ext
.
androidTargetSdkVersion
versionCode
3
versionName
"1.0.
2
"
versionCode
4
versionName
"1.0.
3
"
flavorDimensions
"default"
// dex突破65535的限制
...
...
@@ -233,6 +233,8 @@ dependencies {
implementation
'androidx.fragment:fragment:1.0.0'
// 变现猫
implementation
(
name:
'bxmsdk-release-3.0.0-csj3300'
,
ext:
'aar'
)
// 闪电盒子
implementation
(
name:
'wannuosili_ad_2.0.0'
,
ext:
'aar'
)
// testImplementation 'junit:junit:4.13'
...
...
GoodMoney/app/libs/wannuosili_ad_2.0.0.aar
0 → 100644
View file @
9c6f453d
File added
GoodMoney/app/proguard-rules.pro
View file @
9c6f453d
...
...
@@ -481,3 +481,12 @@
public *;
}
# ======================= 变现猫 END ================
# ===================== 闪电盒子 START ================
-keep class com.wannuosili.sdk.
*
* {*;}
-dontwarn com.wannuosili.sdk.
*
*
# ======================= 闪电盒子 END ================
\ No newline at end of file
GoodMoney/app/src/main/AndroidManifest.xml
View file @
9c6f453d
...
...
@@ -311,6 +311,18 @@
android:configChanges=
"keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation=
"landscape"
tools:replace=
"android:screenOrientation"
/>
<!-- 闪电盒子广告 -->
<provider
android:name=
"com.wannuosili.sdk.ad.component.WNFileProvider"
android:authorities=
"${applicationId}.WNFileProvider"
android:exported=
"false"
android:grantUriPermissions=
"true"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/wn_file_paths"
/>
</provider>
</application>
</manifest>
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
9c6f453d
...
...
@@ -16,6 +16,7 @@ import com.mints.goodmoney.common.Constant;
import
com.mints.goodmoney.manager.LiebaoManager
;
import
com.mints.goodmoney.manager.MiitHelper
;
import
com.mints.goodmoney.manager.TtCsjAdManager
;
import
com.mints.goodmoney.manager.WnManager
;
import
com.mints.goodmoney.manager.YlVideoManager
;
import
com.mints.goodmoney.manager.YlhAdManager
;
import
com.mints.goodmoney.net.LoanService
;
...
...
@@ -118,6 +119,9 @@ public class MintsApplication extends MultiDexApplication {
// 穿山甲
TtCsjAdManager
.
init
(
this
);
// 闪电盒子
WnManager
.
INSTANCE
.
initWn
(
this
);
// 一览视频
YlVideoManager
.
INSTANCE
.
init
(
this
);
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/BaseVideoAd.kt
View file @
9c6f453d
...
...
@@ -5,12 +5,14 @@ import android.content.DialogInterface
import
android.text.TextUtils
import
android.view.KeyEvent
import
com.mints.goodmoney.MintsApplication
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.mvp.views.BaseView
import
com.mints.goodmoney.ui.widgets.LoadingDialog
import
com.mints.goodmoney.utils.ToastUtil
import
java.util.HashMap
open
class
BaseVideoAd
(
activity
:
Activity
)
:
BaseView
{
var
activity
:
Activity
open
var
activity
:
Activity
?
=
null
var
progressDialog
:
LoadingDialog
?
=
null
init
{
...
...
@@ -18,7 +20,7 @@ open class BaseVideoAd(activity: Activity) : BaseView {
}
override
fun
getBaseApplication
():
MintsApplication
{
return
activity
.
getApplication
()
as
MintsApplication
return
activity
?
.
getApplication
()
as
MintsApplication
}
/**
...
...
@@ -27,7 +29,8 @@ open class BaseVideoAd(activity: Activity) : BaseView {
* @param message
*/
override
fun
showLoading
(
message
:
String
?)
{
if
(
activity
.
getWindow
()
!=
null
&&
!
activity
.
isFinishing
())
{
if
(
activity
!=
null
)
{
if
(
activity
!!
.
getWindow
()
!=
null
&&
!
activity
!!
.
isFinishing
())
{
if
(
progressDialog
==
null
)
{
progressDialog
=
LoadingDialog
(
activity
)
progressDialog
!!
.
setLoadText
(
message
)
...
...
@@ -38,6 +41,8 @@ open class BaseVideoAd(activity: Activity) : BaseView {
}
}
}
/**
* 设置Progress是否手触消失
*
...
...
@@ -65,12 +70,14 @@ open class BaseVideoAd(activity: Activity) : BaseView {
*/
override
fun
hideLoading
()
{
try
{
if
(
activity
.
getWindow
()
!=
null
&&
!
activity
.
isFinishing
())
{
if
(
activity
!=
null
)
{
if
(
activity
!!
.
getWindow
()
!=
null
&&
!
activity
!!
.
isFinishing
())
{
if
(
progressDialog
!=
null
&&
progressDialog
!!
.
isShowing
())
{
progressDialog
!!
.
dismiss
()
progressDialog
=
null
}
}
}
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
}
finally
{
...
...
@@ -82,7 +89,27 @@ open class BaseVideoAd(activity: Activity) : BaseView {
if
(!
TextUtils
.
isEmpty
(
msg
))
ToastUtil
.
show
(
MintsApplication
.
getContext
(),
msg
)
}
open
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
){}
/**
* 激励视频请求接口封装
*/
fun
getAdMapVO
(
carrierType
:
String
,
adsource
:
String
,
extraId
:
String
?,
curCoin
:
Int
):
HashMap
<
String
,
Any
>
{
val
vo
=
HashMap
<
String
,
Any
>()
vo
[
"carrierType"
]
=
carrierType
vo
[
"adtype"
]
=
Constant
.
ADTYPE_VEDIO
vo
[
"adsource"
]
=
adsource
when
(
carrierType
)
{
Constant
.
CARRIER_VERSUS_VIDEO
->
vo
[
"coin"
]
=
curCoin
Constant
.
CARRIER_HOMEWATER
->
vo
[
"waterCoin"
]
=
curCoin
Constant
.
CARRIER_OFFLINE_DOUBLE
->
{
vo
[
"offline_income"
]
=
curCoin
vo
[
"turntableKey"
]
=
extraId
!!
}
Constant
.
CARRIER_CHALLENGE_TURN
,
Constant
.
CARRIER_CHALLENGE_CARD
->
vo
[
"turntableKey"
]
=
extraId
!!
}
return
vo
}
open
fun
loadAd
(
activity
:
Activity
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
)
{}
open
fun
onDestory
(){}
open
fun
onDestory
()
{}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/CsjVedioAdManager.java
View file @
9c6f453d
...
...
@@ -12,11 +12,8 @@ import com.mints.goodmoney.manager.TTNativeExpressManager;
import
com.mints.goodmoney.manager.TrackManager
;
import
com.mints.goodmoney.manager.TtCsjAdManager
;
import
com.mints.goodmoney.manager.UserManager
;
import
com.mints.goodmoney.mvp.presenters.CsjVedioAdPresenter
;
import
com.mints.goodmoney.mvp.views.VedioAdManagerView
;
import
com.mints.goodmoney.utils.LogUtil
;
import
com.mints.goodmoney.utils.MD5
;
import
com.mints.goodmoney.utils.SPUtil
;
import
com.mints.library.utils.json.JsonUtil
;
import
net.grandcentrix.tray.AppPreferences
;
...
...
@@ -32,7 +29,6 @@ public class CsjVedioAdManager extends BaseVideoAd {
private
AppPreferences
ps
;
private
int
curCoin
;
private
String
extraId
;
private
CsjVedioAdPresenter
csjVedioAdPresenter
;
private
CsjVedioAdListener
csjVedioAdListener
;
Activity
activity
;
...
...
@@ -64,9 +60,6 @@ public class CsjVedioAdManager extends BaseVideoAd {
TTNativeExpressManager
ttNativeExpressManager
=
new
TTNativeExpressManager
();
ttAdNative
=
ttNativeExpressManager
.
initTTAd
(
false
);
// csjVedioAdPresenter = new CsjVedioAdPresenter();
// csjVedioAdPresenter.attachView(this);
}
@Override
...
...
@@ -75,11 +68,6 @@ public class CsjVedioAdManager extends BaseVideoAd {
mttRewardVideoAd
.
setRewardAdInteractionListener
(
null
);
}
// if (csjVedioAdPresenter != null) {
// csjVedioAdPresenter.dispose();
// csjVedioAdPresenter.detachView();
// }
activity
=
null
;
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/VedioAdingManager.java
View file @
9c6f453d
...
...
@@ -23,9 +23,11 @@ public class VedioAdingManager {
private
VedioAdingListener
vedioAdingListener
;
private
WnVedioAdManager
wnVedioAdManager
;
private
CsjVedioAdManager
csjVedioAdManager
;
private
YlhVedioAdManager
ylhVedioAdManager
;
private
int
wnWeight
;
private
int
ylhWeight
;
private
int
csjVedioWeight
;
private
ArrayList
<
WeightBean
>
weightList
;
...
...
@@ -56,15 +58,17 @@ public class VedioAdingManager {
this
.
activity
=
activity
;
csjVedioAdManager
=
CsjVedioAdManager
.
getInstance
(
activity
);
ylhVedioAdManager
=
YlhVedioAdManager
.
getInstance
(
activity
);
wnVedioAdManager
=
WnVedioAdManager
.
Companion
.
getInstance
(
activity
);
weightList
=
new
ArrayList
<>();
}
/**
* 初始化广告权重
*/
public
void
initAdWeight
(
int
csjVedioWeight
,
int
ylhWeight
)
{
public
void
initAdWeight
(
int
csjVedioWeight
,
int
ylhWeight
,
int
wnWeight
)
{
this
.
csjVedioWeight
=
csjVedioWeight
;
this
.
ylhWeight
=
ylhWeight
;
this
.
wnWeight
=
wnWeight
;
}
/**
...
...
@@ -98,8 +102,10 @@ public class VedioAdingManager {
String
nextAdType
=
""
;
if
(
AppConfig
.
csjVedioAdCount
>
0
)
{
nextAdType
=
Constant
.
CSJ_VEDIO_AD
;
}
else
{
}
else
if
(
AppConfig
.
ylhAdCount
>
0
)
{
nextAdType
=
Constant
.
YLH_VEDIO_AD
;
}
else
{
nextAdType
=
Constant
.
SDHZ_VEDIO_AD
;
}
return
nextAdType
;
}
...
...
@@ -128,6 +134,11 @@ public class VedioAdingManager {
// 若没有视频完成数,不加入权重计算范围内
// 穿山甲激励> 优量汇
if
(
AppConfig
.
wnVedioAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
wnWeight
,
Constant
.
SDHZ_VEDIO_AD
));
weight
=
weight
+
wnWeight
;
LogUtil
.
d
(
TAG
,
"权重值:sdhzWeight:"
+
wnWeight
);
}
if
(
AppConfig
.
csjVedioAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
csjVedioWeight
,
Constant
.
CSJ_VEDIO_AD
));
weight
=
weight
+
csjVedioWeight
;
...
...
@@ -175,8 +186,9 @@ public class VedioAdingManager {
public
boolean
getVedioFinishFlag
()
{
int
csjVedioAdCount
=
AppConfig
.
csjVedioAdCount
;
int
ylhAdCount
=
AppConfig
.
ylhAdCount
;
int
wnAdCount
=
AppConfig
.
wnVedioAdCount
;
if
(
ylhAdCount
<=
0
&&
csjVedioAdCount
<=
0
)
{
if
(
ylhAdCount
<=
0
&&
csjVedioAdCount
<=
0
&&
wnAdCount
<=
0
)
{
// showToast("今日视频已看完,请明天再来吧");
return
true
;
}
...
...
@@ -198,6 +210,12 @@ public class VedioAdingManager {
ylhVedioAdManager
=
null
;
}
if
(
wnVedioAdManager
!=
null
)
{
wnVedioAdManager
.
setWnVedioAdListener
(
null
);
wnVedioAdManager
.
onDestory
();
wnVedioAdManager
=
null
;
}
activity
=
null
;
}
...
...
@@ -293,6 +311,40 @@ public class VedioAdingManager {
}
});
csjVedioAdManager
.
loadAd
(
activity
,
bean
.
getCurCoin
(),
bean
.
getCarrierType
(),
bean
.
getExtraId
());
}
else
if
(
TextUtils
.
equals
(
vedioAdType
,
Constant
.
SDHZ_VEDIO_AD
))
{
// 闪电盒子激励视频
if
(
wnVedioAdManager
==
null
)
{
if
(
activity
==
null
)
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerError
(
Constant
.
SDHZ_VEDIO_AD
);
}
return
;
}
wnVedioAdManager
=
WnVedioAdManager
.
Companion
.
getInstance
(
activity
);
}
wnVedioAdManager
.
setWnVedioAdListener
(
new
WnVedioAdManager
.
WnVedioAdListener
()
{
@Override
public
void
wnVedioAdSuccess
()
{
AppConfig
.
wnVedioAdCount
--;
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerSuccess
(
Constant
.
SDHZ_VEDIO_AD
);
}
}
@Override
public
void
wnVedioAdFail
()
{
if
(
vedioAdingListener
!=
null
)
{
vedioAdingListener
.
vedioAdingListenerFail
(
Constant
.
SDHZ_VEDIO_AD
);
}
}
@Override
public
void
wnVedioAdDownload
()
{
isVedioAdDownload
=
true
;
}
});
wnVedioAdManager
.
loadWnAd
(
bean
.
getDownloadCoin
(),
bean
.
getCurCoin
(),
bean
.
getCarrierType
(),
bean
.
getExtraId
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/WnVedioAdManager.kt
0 → 100644
View file @
9c6f453d
package
com.mints.goodmoney.ad.video
import
android.app.Activity
import
com.mints.goodmoney.common.Constant
import
com.mints.goodmoney.manager.TrackManager
import
com.mints.goodmoney.manager.WnManager
import
com.mints.goodmoney.mvp.presenters.WnVedioAdPresenter
import
com.mints.goodmoney.mvp.views.VedioAdManagerView
import
com.mints.goodmoney.utils.LogUtil
import
com.wannuosili.sdk.*
import
java.util.*
/**
* 闪电盒子视频
*/
class
WnVedioAdManager
private
constructor
(
activity
:
Activity
)
:
BaseVideoAd
(
activity
),
VedioAdManagerView
{
private
val
TAG
=
WnVedioAdManager
::
class
.
java
.
simpleName
lateinit
var
wnVedioAdPresenter
:
WnVedioAdPresenter
private
var
wnVedioAdListener
:
WnVedioAdListener
?
=
null
private
lateinit
var
mRewardVideoAd
:
WNRewardVideoAd
private
var
curCoin
=
0
private
var
extraId
:
String
?
=
null
private
var
downloadCoin
=
10
private
var
carrierType
=
""
private
var
isClickScreen
:
Boolean
=
true
override
var
activity
:
Activity
?
=
null
companion
object
{
private
var
_inst
:
WnVedioAdManager
?
=
null
fun
getInstance
(
activity
:
Activity
):
WnVedioAdManager
?
{
return
if
(
_inst
!=
null
)
{
_inst
}
else
{
_inst
=
WnVedioAdManager
(
activity
)
_inst
}
}
}
init
{
init
(
activity
)
}
private
fun
init
(
activity
:
Activity
)
{
this
.
activity
=
activity
wnVedioAdPresenter
=
WnVedioAdPresenter
()
wnVedioAdPresenter
.
attachView
(
this
)
}
fun
loadWnAd
(
downloadCoin
:
Int
,
curCoin
:
Int
,
carrierType
:
String
,
extraId
:
String
?)
{
if
(
activity
==
null
)
{
return
}
isClickScreen
=
true
this
.
downloadCoin
=
downloadCoin
this
.
carrierType
=
carrierType
this
.
curCoin
=
curCoin
this
.
extraId
=
extraId
var
postId
:
String
=
""
when
(
carrierType
)
{
Constant
.
CARRIER_VERSUS_VIDEO
->
postId
=
WnManager
.
WN_AD_VEDIO_MAIN_POSTID
Constant
.
CARRIER_HOMEWATER
->
postId
=
WnManager
.
WN_AD_VEDIO_DRINK_POSTID
Constant
.
CARRIER_CHALLENGE_TURN
->
postId
=
WnManager
.
WN_AD_VEDIO_TURNABLE_POSTID
Constant
.
CARRIER_CHALLENGE_CARD
->
postId
=
WnManager
.
WN_AD_VEDIO_ERASE_POSTID
else
->
postId
=
WnManager
.
WN_AD_VEDIO_MOREDIALOG_POSTID
}
val
slot
=
WNAdSlot
.
Builder
()
.
setSlotId
(
postId
)
.
setOrientation
(
WNAdConstant
.
REWARD_VIDEO_AD_PORTRAIT
)
.
build
()
WNAdSdk
.
getAdManager
().
loadRewardVideoAd
(
slot
,
object
:
WNRewardVideoAd
.
RewardVideoAdListener
{
override
fun
onError
(
code
:
Int
,
message
:
String
)
{
LogUtil
.
d
(
TAG
,
"onError $code:$message"
)
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_ONE
,
(
code
).
toString
(),
message
)
if
(
wnVedioAdListener
!=
null
)
{
wnVedioAdListener
?.
wnVedioAdFail
()
}
}
override
fun
onLoad
(
ad
:
WNRewardVideoAd
)
{
ad
.
interactionListener
=
object
:
WNRewardVideoAd
.
InteractionListener
{
override
fun
onAdShow
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_ZERO
,
""
,
""
)
}
override
fun
onAdClick
()
{
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_TWO
,
""
,
""
)
if
(
isClickScreen
)
{
// 防止重复
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_FOUR
,
""
,
""
)
isClickScreen
=
false
}
if
(
wnVedioAdListener
!=
null
)
{
wnVedioAdListener
?.
wnVedioAdDownload
()
}
}
override
fun
onAdClose
()
{
wnVedioAdPresenter
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_SDHZ
,
extraId
,
curCoin
))
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_SDHZ
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
)
if
(
wnVedioAdListener
!=
null
)
{
wnVedioAdListener
?.
wnVedioAdSuccess
()
}
}
override
fun
onVideoComplete
()
{
}
override
fun
onRewardVerify
(
rewardVerify
:
Boolean
,
rewardAmount
:
Int
,
rewardName
:
String
)
{
}
}
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
)
{
}
override
fun
onDownloadFailed
(
fileName
:
String
,
appName
:
String
)
{
}
}
}
mRewardVideoAd
=
ad
mRewardVideoAd
.
showRewardVideoAd
(
activity
)
}
})
}
fun
setWnVedioAdListener
(
wnVedioAdListener
:
WnVedioAdListener
?)
{
this
.
wnVedioAdListener
=
wnVedioAdListener
}
interface
WnVedioAdListener
{
fun
wnVedioAdSuccess
()
fun
wnVedioAdFail
()
fun
wnVedioAdDownload
()
}
override
fun
onDestory
()
{
wnVedioAdPresenter
.
dispose
()
wnVedioAdPresenter
.
detachView
()
activity
=
null
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/YlhVedioAdManager.java
View file @
9c6f453d
...
...
@@ -147,9 +147,9 @@ public class YlhVedioAdManager extends BaseVideoAd implements VedioAdManagerView
@Override
public
void
onReward
()
{
//激励视频广告激励发放
if
(
activity
!=
null
)
{
ylhVedioAdPresenter
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
));
}
//
if (activity != null) {
//
ylhVedioAdPresenter.reportAddCoinMsg(activity, getAdMapVO(carrierType));
//
}
}
@Override
...
...
@@ -175,6 +175,8 @@ public class YlhVedioAdManager extends BaseVideoAd implements VedioAdManagerView
public
void
onADClose
()
{
//激励视频广告被关闭
TrackManager
.
getInstance
().
addCallImp
(
Constant
.
AD_SOURCE_YLH
,
Constant
.
EVENT_TYPE_THREE
,
""
,
""
);
ylhVedioAdPresenter
.
reportAddCoinMsg
(
activity
,
getAdMapVO
(
carrierType
,
Constant
.
AD_SOURCE_YLH
,
extraId
,
curCoin
));
if
(
ylhVedioAdListener
!=
null
)
{
ylhVedioAdListener
.
ylhVedioAdSuccess
();
}
...
...
@@ -198,35 +200,6 @@ public class YlhVedioAdManager extends BaseVideoAd implements VedioAdManagerView
rewardVideoAD
.
loadAD
();
}
/**
* 第四步 封装广告数据,请求服务器
*
* @param carrierType
* @return
*/
private
HashMap
<
String
,
Object
>
getAdMapVO
(
String
carrierType
)
{
HashMap
<
String
,
Object
>
vo
=
new
HashMap
<>();
vo
.
put
(
"carrierType"
,
carrierType
);
vo
.
put
(
"adtype"
,
Constant
.
ADTYPE_VEDIO
);
vo
.
put
(
"adsource"
,
Constant
.
AD_SOURCE_YLH
);
switch
(
carrierType
)
{
case
Constant
.
CARRIER_VERSUS_VIDEO
:
// 每日任务-视频
vo
.
put
(
"coin"
,
curCoin
);
break
;
case
Constant
.
CARRIER_HOMEWATER
:
// 首页喝水汽泡
vo
.
put
(
"waterCoin"
,
curCoin
);
break
;
case
Constant
.
CARRIER_OFFLINE_DOUBLE
:
// 离线收益翻倍
vo
.
put
(
"offline_income"
,
curCoin
);
case
Constant
.
CARRIER_CHALLENGE_TURN
:
// 挑战大转盘
case
Constant
.
CARRIER_CHALLENGE_CARD
:
// 挑战刮刮乐
vo
.
put
(
"turntableKey"
,
extraId
);
break
;
}
return
vo
;
}
public
void
setYlhVedioAdListener
(
YlhVedioAdListener
ylhVedioAdListener
)
{
this
.
ylhVedioAdListener
=
ylhVedioAdListener
;
}
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/AppConfig.java
View file @
9c6f453d
...
...
@@ -27,5 +27,9 @@ public class AppConfig {
* csjVedio 剩余广告播放数
*/
public
static
int
csjVedioAdCount
=
5
;
/**
* wnVedio 剩余广告播放数
*/
public
static
int
wnVedioAdCount
=
5
;
}
GoodMoney/app/src/main/java/com/mints/goodmoney/common/Constant.kt
View file @
9c6f453d
...
...
@@ -129,6 +129,7 @@ object Constant {
const
val
AD_SOURCE_CSJ
=
"CSJ"
const
val
AD_SOURCE_YLH
=
"YLH"
const
val
AD_SOURCE_SDHZ
=
"SDHZ"
//闪电盒子
// 调用事件 0 成功 1失败 2点击 3-有效展示 4-去重
const
val
EVENT_TYPE_ZERO
=
"0"
...
...
@@ -146,6 +147,7 @@ object Constant {
// 视频广告类型
const
val
CSJ_VEDIO_AD
=
"CSJ_VEDIO_AD"
const
val
YLH_VEDIO_AD
=
"YLH_VEDIO_AD"
const
val
SDHZ_VEDIO_AD
=
"SDHZ_VEDIO_AD"
// 游戏类型
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/WnManager.kt
0 → 100644
View file @
9c6f453d
package
com.mints.goodmoney.manager
import
android.app.Application
import
com.mints.goodmoney.BuildConfig
import
com.wannuosili.sdk.WNAdConfig
import
com.wannuosili.sdk.WNAdSdk
/**
* 描述:闪电盒子(优量宝)
* 作者:孟崔广
*/
object
WnManager
{
private
const
val
APP_ID
=
"10000297"
const
val
WN_AD_VEDIO_DRINK_POSTID
=
"100000532009"
//喝水打卡
const
val
WN_AD_VEDIO_MAIN_POSTID
=
"100000542009"
//我的界面视频
const
val
WN_AD_VEDIO_ERASE_POSTID
=
"100000552009"
//刮刮乐
const
val
WN_AD_VEDIO_TURNABLE_POSTID
=
"100000562009"
//大转盘
const
val
WN_AD_VEDIO_MOREDIALOG_POSTID
=
"100000572009"
//签到、气泡、离线弹框
/**
* 初始化
*/
fun
initWn
(
application
:
Application
)
{
WNAdSdk
.
initialize
(
WNAdConfig
.
Builder
()
.
setAppId
(
APP_ID
)
// 平台申请的appId
.
setDebug
(
BuildConfig
.
DEBUG
)
// 是否是debug模式, 默认为false
.
setContext
(
application
)
.
build
())
}
fun
setOaid
(
oaid
:
String
)
{
WNAdSdk
.
setOaid
(
oaid
)
}
}
\ No newline at end of file
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/VedioRulesBean.java
View file @
9c6f453d
...
...
@@ -6,6 +6,7 @@ public class VedioRulesBean implements Serializable {
private
CsjVedioBean
CSJ_VEDIO
;
private
YlhVedioBean
YLH_VEDIO
;
private
SdhzVedioBean
SDHZ_VEDIO
;
public
class
CsjVedioBean
implements
Serializable
{
private
int
surplus
;
//剩余可看视频数
...
...
@@ -33,6 +34,19 @@ public class VedioRulesBean implements Serializable {
}
}
public
class
SdhzVedioBean
implements
Serializable
{
private
int
surplus
;
private
int
rate
;
public
int
getSurplus
()
{
return
surplus
;
}
public
int
getRate
()
{
return
rate
;
}
}
public
CsjVedioBean
getCSJ_VEDIO
()
{
return
CSJ_VEDIO
;
}
...
...
@@ -40,4 +54,8 @@ public class VedioRulesBean implements Serializable {
public
YlhVedioBean
getYLH_VEDIO
()
{
return
YLH_VEDIO
;
}
public
SdhzVedioBean
getSDHZ_VEDIO
()
{
return
SDHZ_VEDIO
;
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/presenters/WnVedioAdPresenter.kt
0 → 100644
View file @
9c6f453d
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
WnVedioAdPresenter
:
BasePresenter
<
VedioAdManagerView
>()
{
fun
reportAddCoinMsg
(
activity
:
Activity
?,
vo
:
HashMap
<
String
,
Any
>)
{
if
(
activity
==
null
)
return
loanApplication
=
activity
.
application
as
MintsApplication
loanService
=
loanApplication
.
getLoanService
()
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/fragment/MainFragment.kt
View file @
9c6f453d
...
...
@@ -15,6 +15,7 @@ import com.mints.goodmoney.manager.ShumeiManager
import
com.mints.goodmoney.manager.TTPreLoadCarrierExpressManager
import
com.mints.goodmoney.manager.TTPreLoadExpressManager
import
com.mints.goodmoney.manager.UserManager
import
com.mints.goodmoney.manager.WnManager
import
com.mints.goodmoney.mvp.model.MainVedioMsgBean
import
com.mints.goodmoney.mvp.model.UserTaskMsgBean
import
com.mints.goodmoney.mvp.presenters.HomePresenter
...
...
@@ -194,12 +195,14 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 设置视频权限
vedioAdingManager
?.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
)
LogUtil
.
d
(
TAG
,
"首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate}"
)
// vedioAdingManager?.initAdWeight(data.vedioRules.csJ_VEDIO.rate, data.vedioRules.ylH_VEDIO.rate,data.vedioRules.sdhZ_VEDIO.rate)
vedioAdingManager
?.
initAdWeight
(
data
.
vedioRules
.
csJ_VEDIO
.
rate
,
data
.
vedioRules
.
ylH_VEDIO
.
rate
,
0
)
// LogUtil.d(TAG, "首页权重值:csjWeight:${data.vedioRules.csJ_VEDIO.rate} ylhWeight:${data.vedioRules.ylH_VEDIO.rate} sdhzWeight:${data.vedioRules.sdhZ_VEDIO.rate}")
// 广告视频数
AppConfig
.
csjVedioAdCount
=
data
.
vedioRules
.
csJ_VEDIO
.
surplus
AppConfig
.
ylhAdCount
=
data
.
vedioRules
.
ylH_VEDIO
.
surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount}"
)
// AppConfig.wnVedioAdCount = data.vedioRules.sdhZ_VEDIO.surplus
LogUtil
.
d
(
TAG
,
"首页视频数:csjCount:${AppConfig.csjVedioAdCount} ylhCount:${AppConfig.ylhAdCount} sdhzCount:${AppConfig.wnVedioAdCount}"
)
// 调用金币视频信息接口
homePresenter
.
getHomeVedioMsg
()
...
...
@@ -254,6 +257,11 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
// 数美初始化
ShumeiManager
.
getInstance
().
initShumei
()
}
//闪电盒子传入oaid
if
(!
TextUtils
.
isEmpty
(
MintsApplication
.
OAID
))
{
WnManager
.
setOaid
(
MintsApplication
.
OAID
)
}
}
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
9c6f453d
...
...
@@ -386,13 +386,13 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
item_title_avatar
.
setImageResource
(
R
.
mipmap
.
ic_my
)
}
if
(
BuildConfig
.
DEBUG
)
{
item_title_invitecode
.
text
=
"-"
+
item_title_invitecode
.
text
}
var
userGold
=
"0.00"
if
(
userConfig
!=
null
)
{
if
(
BuildConfig
.
DEBUG
)
{
item_title_invitecode
.
text
=
"-邀请码:"
+
userConfig
!!
.
userMsg
.
idcode
}
else
{
item_title_invitecode
.
text
=
"邀请码:"
+
userConfig
!!
.
userMsg
.
idcode
}
val
allcoinBig
=
BigDecimal
(
userConfig
!!
.
userMsg
.
coin
.
toString
())
val
rateBig
=
BigDecimal
(
"10000"
)
val
cashStr
:
String
=
allcoinBig
.
divide
(
rateBig
).
setScale
(
2
,
BigDecimal
.
ROUND_DOWN
).
toString
()
...
...
@@ -619,6 +619,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
if
(
hotList
!!
.
isNotEmpty
())
{
val
hotBean
:
BannerBean
.
ListBean
=
hotList
!!
[
position
]
if
(!
TextUtils
.
isEmpty
(
hotBean
.
toUrl
))
{
// 自有界面
when
(
hotBean
.
toUrl
)
{
Constant
.
HOT_ACTIVITY_WATER
->
{
...
...
@@ -657,6 +658,7 @@ class MyFragment : BaseFragment(), MyView, OnItemChildClickListener, OnRefreshLi
}
}
}
}
/**
* 获取激励视频
...
...
GoodMoney/app/src/main/res/xml/wn_file_paths.xml
0 → 100755
View file @
9c6f453d
<?xml version="1.0" encoding="utf-8"?>
<paths
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<!--为了适配所有路径可以设置 path = "." -->
<external-path
name=
"download"
path=
"."
/>
<external-files-path
name=
"external_file"
path=
"."
/>
<external-cache-path
name=
"external_cache"
path=
"."
/>
<files-path
name=
"files"
path=
"."
/>
<cache-path
name=
"cache"
path=
"。"
/>
</paths>
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