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
96064363
Commit
96064363
authored
May 24, 2021
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
好兔更换快手内容联盟,添加高额任务权重逻辑
parent
17ae2018
Changes
13
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
214 additions
and
146 deletions
+214
-146
build.gradle
GoodMoney/app/build.gradle
+7
-7
kssdk-ad-3.3.6-publishRelease.aar
GoodMoney/app/libs/kssdk-ad-3.3.6-publishRelease.aar
+0
-0
kssdk-all--3.3.16-publishRelease-9ffe2b94e.aar
...y/app/libs/kssdk-all--3.3.16-publishRelease-9ffe2b94e.aar
+0
-0
KsPreLoadExpressManager.kt
...com/mints/goodmoney/ad/express/KsPreLoadExpressManager.kt
+6
-1
KsVideoAdManager.kt
...ain/java/com/mints/goodmoney/ad/video/KsVideoAdManager.kt
+2
-0
VideoAdingManager.java
.../java/com/mints/goodmoney/ad/video/VideoAdingManager.java
+44
-29
AppConfig.java
...p/src/main/java/com/mints/goodmoney/common/AppConfig.java
+14
-0
KsManager.kt
...pp/src/main/java/com/mints/goodmoney/manager/KsManager.kt
+3
-0
UserTaskMsgBean.java
...n/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
+27
-0
AwardActivity.kt
...in/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
+1
-0
SplashKsADActivity.kt
...va/com/mints/goodmoney/ui/activitys/SplashKsADActivity.kt
+3
-0
MainFragment.kt
...main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
+100
-109
MyFragment.kt
...c/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
+7
-0
No files found.
GoodMoney/app/build.gradle
View file @
96064363
...
...
@@ -263,9 +263,9 @@ dependencies {
implementation
(
name:
'xrsdk-release_tbs'
,
ext:
'aar'
)
implementation
(
name:
'xrsharesdk-release_tbs'
,
ext:
'aar'
)
implementation
(
name:
'windAd-2.25.0'
,
ext:
'aar'
)
implementation
'com.scwang.smart:refresh-layout-kernel:2.0.3'
implementation
'com.scwang.smart:refresh-header-classics:2.0.3'
implementation
'com.scwang.smart:refresh-footer-classics:2.0.3'
implementation
'com.scwang.smart:refresh-layout-kernel:2.0.3'
implementation
'com.scwang.smart:refresh-header-classics:2.0.3'
implementation
'com.scwang.smart:refresh-footer-classics:2.0.3'
// 枫岚
implementation
(
name:
'mh-adsdk'
,
ext:
'aar'
)
implementation
(
name:
'mh-adsdk-ext'
,
ext:
'aar'
)
...
...
@@ -287,7 +287,7 @@ dependencies {
implementation
(
name:
'tzsdk_core-3.0.0-20200807131516-release'
,
ext:
'aar'
)
implementation
(
name:
'tzsdk_reporter-3.0.0-20200807131516-release'
,
ext:
'aar'
)
// 快手
implementation
(
name:
'kssdk-a
d-3.3.6-publishReleas
e'
,
ext:
'aar'
)
implementation
(
name:
'kssdk-a
ll--3.3.16-publishRelease-9ffe2b94
e'
,
ext:
'aar'
)
// 抖音滑动LayoutManager
implementation
(
name:
'LayoutManagerGroup'
,
ext:
'aar'
)
// 蘑菇星球
...
...
@@ -327,7 +327,7 @@ dependencies {
implementation
"org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutinesVersion"
implementation
"com.google.dagger:hilt-android:$rootProject.hiltVersion"
implementation
"androidx.hilt:hilt-lifecycle-viewmodel:$rootProject.hiltViewModelVersion"
implementation
"com.scwang.smart:refresh-header-material:$rootProject.refresh_version"
implementation
"com.scwang.smart:refresh-header-material:$rootProject.refresh_version"
implementation
'com.github.pdog18:dimension-extensions:1.0'
implementation
'com.github.zhpanvip:BannerViewPager:3.2.0'
api
"androidx.navigation:navigation-fragment-ktx:$navigationVersion"
...
...
@@ -347,8 +347,8 @@ dependencies {
implementation
'com.sensorsdata.analytics.android:SensorsAnalyticsSDK:4.4.3'
api
'org.aspectj:aspectjrt:1.9.5'
//小满
implementation
(
"com.bx:adsdk:1.4.2.2"
)
{
exclude
group:
"com.miit.sdk"
implementation
(
"com.bx:adsdk:1.4.2.2"
)
{
exclude
group:
"com.miit.sdk"
transitive
=
true
changing
=
true
}
...
...
GoodMoney/app/libs/kssdk-ad-3.3.6-publishRelease.aar
deleted
100644 → 0
View file @
17ae2018
File deleted
GoodMoney/app/libs/kssdk-all--3.3.16-publishRelease-9ffe2b94e.aar
0 → 100644
View file @
96064363
File added
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/express/KsPreLoadExpressManager.kt
View file @
96064363
package
com.mints.goodmoney.ad.express
import
android.annotation.SuppressLint
import
android.content.DialogInterface
import
android.text.TextUtils
import
android.util.Log
import
android.view.LayoutInflater
...
...
@@ -95,7 +96,7 @@ object KsPreLoadExpressManager {
}
override
fun
onVideoPlayError
(
what
:
Int
,
extra
:
Int
)
{
LogUtil
.
d
(
"KsPreLoadExpressManager"
,
"id=${what} extra=${extra}"
)
LogUtil
.
d
(
"KsPreLoadExpressManager"
,
"id=${what} extra=${extra}"
)
}
})
...
...
@@ -191,6 +192,10 @@ object KsPreLoadExpressManager {
// Toast.makeText(mContext, "广告" + ad.appName + "展示", Toast.LENGTH_SHORT).show()
}
}
override
fun
handleDownloadDialog
(
p0
:
DialogInterface
.
OnClickListener
?):
Boolean
{
return
false
}
})
// 广告描述
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/KsVideoAdManager.kt
View file @
96064363
...
...
@@ -120,6 +120,8 @@ class KsVideoAdManager private constructor(activity: Activity) :
}
}
override
fun
onRequestResult
(
p0
:
Int
)
{}
})
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ad/video/VideoAdingManager.java
View file @
96064363
...
...
@@ -6,8 +6,6 @@ import android.content.Context;
import
android.content.Intent
;
import
android.content.IntentFilter
;
import
android.text.TextUtils
;
import
com.mints.goodmoney.MintsApplication
;
import
com.mints.goodmoney.ad.video.base.VideoAdStatusListener
;
import
com.mints.goodmoney.common.AppConfig
;
import
com.mints.goodmoney.common.Constant
;
...
...
@@ -17,8 +15,6 @@ import com.mints.goodmoney.mvp.model.WeightBean;
import
com.mints.goodmoney.service.AppInstallService
;
import
com.mints.goodmoney.utils.AppUtil
;
import
com.mints.goodmoney.utils.LogUtil
;
import
com.mints.goodmoney.utils.ToastUtil
;
import
java.lang.ref.WeakReference
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
...
...
@@ -64,8 +60,6 @@ public class VideoAdingManager {
// 是否是高额视频任务
private
boolean
isHighWeight
=
false
;
private
boolean
isTTVideoAd
=
false
;
private
int
highIndex
=
0
;
//0-穿山甲 1-优量汇 2-快手
private
Activity
activity
;
private
boolean
isVideoAdDownload
=
false
;
// 是否点击广告下载 true-点击
...
...
@@ -235,31 +229,52 @@ public class VideoAdingManager {
/**
* 高额任务广告类型
*
* @return
_
* @return
*/
private
String
getHighWeight
()
{
// isTTVideoAd = !isTTVideoAd;
// if (isTTVideoAd) {
// return Constant.CSJ_VEDIO_AD;
// } else {
// return Constant.YLH_VEDIO_AD;
// }
String
adType
=
""
;
switch
(
highIndex
)
{
case
0
:
highIndex
=
1
;
adType
=
Constant
.
CSJ_VEDIO_AD
;
break
;
case
1
:
highIndex
=
2
;
adType
=
Constant
.
YLH_VEDIO_AD
;
break
;
case
2
:
highIndex
=
0
;
adType
=
Constant
.
KS_VEDIO_AD
;
break
;
public
String
getHighWeight
()
{
int
weight
=
0
;
if
(
weightList
!=
null
)
{
weightList
.
clear
();
}
return
adType
;
// 穿山甲
if
(
AppConfig
.
csjHighVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
AppConfig
.
csjHighVideoAdCount
,
Constant
.
CSJ_VEDIO_AD
));
weight
=
weight
+
AppConfig
.
csjHighVideoAdCount
;
LogUtil
.
d
(
TAG
,
"高额任务 -> 权重值:csjVideoWeight:"
+
AppConfig
.
csjHighVideoAdCount
);
}
// 优量汇
if
(
AppConfig
.
ylhHighVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
AppConfig
.
ylhHighVideoAdCount
,
Constant
.
YLH_VEDIO_AD
));
weight
=
weight
+
AppConfig
.
ylhHighVideoAdCount
;
LogUtil
.
d
(
TAG
,
"高额任务 -> 权重值:ylhVideoWeight:"
+
AppConfig
.
ylhHighVideoAdCount
);
}
// 快手
if
(
AppConfig
.
ksHighVideoAdCount
>
0
)
{
weightList
.
add
(
new
WeightBean
(
AppConfig
.
ksHighVideoAdCount
,
Constant
.
KS_VEDIO_AD
));
weight
=
weight
+
AppConfig
.
ksHighVideoAdCount
;
LogUtil
.
d
(
TAG
,
"高额任务 -> 权重值:ksVideoWeight:"
+
AppConfig
.
ksHighVideoAdCount
);
}
// 权重随机
if
(
weightList
!=
null
&&
weightList
.
size
()
>
0
&&
weight
>
0
)
{
LogUtil
.
d
(
TAG
,
"高额任务 -> 1、权重总值:"
+
weight
);
Random
r
=
new
Random
();
int
randomWeight
=
r
.
nextInt
(
weight
)
+
1
;
LogUtil
.
d
(
TAG
,
"高额任务 -> 2、权重随机值:"
+
randomWeight
);
for
(
WeightBean
weightBean
:
weightList
)
{
randomWeight
-=
weightBean
.
getWeight
();
if
(
randomWeight
<=
0
)
{
LogUtil
.
d
(
TAG
,
"高额任务 -> 3、权重结果:"
+
weightBean
.
getType
());
return
weightBean
.
getType
();
}
}
}
return
Constant
.
CSJ_VEDIO_AD
;
}
/**
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/common/AppConfig.java
View file @
96064363
...
...
@@ -100,6 +100,20 @@ public class AppConfig {
* rtaVideo 剩余广告播放数
*/
public
static
int
rtaVideoAdCount
=
0
;
/**
* 高额任务和超级翻倍 csjVideo 剩余广告播放数
*/
public
static
int
csjHighVideoAdCount
=
0
;
/**
* 高额任务和超级翻倍 ylhVideo 剩余广告播放数
*/
public
static
int
ylhHighVideoAdCount
=
0
;
/**
* 高额任务和超级翻倍 ksVideo 剩余广告播放数
*/
public
static
int
ksHighVideoAdCount
=
0
;
/**
* 高额试玩任务标识
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/manager/KsManager.kt
View file @
96064363
...
...
@@ -23,6 +23,9 @@ object KsManager {
/* vedio-postid */
const
val
KS_AD_VEDIO_POSTID
=
5746000022
/* 内容联盟id */
const
val
KS_CONTENT_POSTID
=
5746000049
/**
* 初始化
*/
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/mvp/model/UserTaskMsgBean.java
View file @
96064363
...
...
@@ -13,6 +13,7 @@ public class UserTaskMsgBean implements Serializable {
private
UserRiskAppsBean
userRiskApps
;
private
AdcodeBean
adcode_v1
=
null
;
private
FlowAdRulesBean
flowAdRules
;
private
HighRatePlanBean
highRatePlan
;
private
String
ip
;
private
String
channel
;
...
...
@@ -135,4 +136,30 @@ public class UserTaskMsgBean implements Serializable {
public
FlowAdRulesBean
getFlowAdRules
()
{
return
flowAdRules
;
}
public
HighRatePlanBean
getHighRatePlan
()
{
return
highRatePlan
;
}
public
void
setHighRatePlan
(
HighRatePlanBean
highRatePlan
)
{
this
.
highRatePlan
=
highRatePlan
;
}
public
static
class
HighRatePlanBean
implements
Serializable
{
private
int
YLH
;
private
int
KS
;
private
int
CSJ
;
public
int
getYLH
()
{
return
YLH
;
}
public
int
getKS
()
{
return
KS
;
}
public
int
getCSJ
()
{
return
CSJ
;
}
}
}
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/AwardActivity.kt
View file @
96064363
...
...
@@ -425,6 +425,7 @@ class AwardActivity : BaseActivity(), AwardView, View.OnClickListener {
// 是否开启应用使用情况权限
if
(
AppUtil
.
isOpenUsageStats
())
{
registerBroad
()
videoAdingManager
.
setIsHighWeight
(
true
)
awardVideo
()
}
else
{
AppTryPlayManager
.
openAppUsageStats
(
this
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/activitys/SplashKsADActivity.kt
View file @
96064363
...
...
@@ -29,6 +29,7 @@ class SplashKsADActivity : BaseActivity() {
* 记录拉取广告的时间
*/
private
val
handler
=
Handler
(
Looper
.
getMainLooper
())
override
fun
getContentViewLayoutID
():
Int
{
return
R
.
layout
.
activity_splash_ylh
}
...
...
@@ -100,6 +101,8 @@ class SplashKsADActivity : BaseActivity() {
next
()
}
override
fun
onRequestResult
(
p0
:
Int
)
{}
override
fun
onSplashScreenAdLoad
(
p0
:
KsSplashScreenAd
?)
{
LogUtil
.
d
(
TAG
,
"onSplashScreenAdLoad"
)
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MainFragment.kt
View file @
96064363
This diff is collapsed.
Click to expand it.
GoodMoney/app/src/main/java/com/mints/goodmoney/ui/fragment/MyFragment.kt
View file @
96064363
...
...
@@ -324,6 +324,13 @@ class MyFragment : BaseFragment(),
return
}
// 高额任务及超级翻倍次数
if
(
data
.
highRatePlan
!=
null
)
{
AppConfig
.
csjHighVideoAdCount
=
data
.
highRatePlan
.
csj
AppConfig
.
ylhHighVideoAdCount
=
data
.
highRatePlan
.
ylh
AppConfig
.
ksHighVideoAdCount
=
data
.
highRatePlan
.
ks
}
if
(
data
.
shareNews
!=
null
)
{
AppConfig
.
wzReadCoin
=
data
.
shareNews
.
readCoin
}
...
...
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