Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
L
LuckyFarm
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王雪伟
LuckyFarm
Commits
74f14bf7
Commit
74f14bf7
authored
Nov 20, 2020
by
Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[李俊岐] 修复广告
parent
e4db3f85
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
67 additions
and
166 deletions
+67
-166
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+1
-1
WelfareActivity.kt
app/src/main/java/com/ym/game/activity/WelfareActivity.kt
+0
-19
MainDialog.kt
app/src/main/java/com/ym/game/view/MainDialog.kt
+4
-4
SiginDropsPopupwindow.kt
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
+12
-42
SpeedWaterPopupWindow.kt
app/src/main/java/com/ym/game/view/SpeedWaterPopupWindow.kt
+12
-42
TurntableDialog.kt
app/src/main/java/com/ym/game/view/TurntableDialog.kt
+3
-5
AdUtils.kt
library/src/main/java/com/ym/library/utils/AdUtils.kt
+25
-6
CenterDialog.kt
library/src/main/java/com/ym/library/utils/CenterDialog.kt
+1
-1
EventUtils.kt
library/src/main/java/com/ym/library/utils/EventUtils.kt
+0
-23
JumpUtils.java
library/src/main/java/com/ym/library/utils/JumpUtils.java
+8
-22
SettingActivity.kt
...n/java/com/ym/userinfo/module/activity/SettingActivity.kt
+1
-1
No files found.
app/src/main/java/com/ym/game/GameActivity.kt
View file @
74f14bf7
...
...
@@ -86,7 +86,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
openNotif
()
Event
Utils
.
loadNextCacheRewardVideoAd
(
this
)
Ad
Utils
.
loadNextCacheRewardVideoAd
(
this
)
AdManager
.
loadFeedAdToCache
(
ADConfig
.
AD_IMG_FADE
,
this
,
ZXADSizeConfig
(
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
this
).
toFloat
())
-
40
,
280
))
...
...
app/src/main/java/com/ym/game/activity/WelfareActivity.kt
View file @
74f14bf7
...
...
@@ -5,8 +5,6 @@ import android.text.Html
import
android.view.View
import
androidx.recyclerview.widget.GridLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.listener.ZXADVideoListener
import
com.ym.ddcy.R
import
com.ym.game.adapter.WelfareDiamondAdapter
import
com.ym.game.adapter.WelfareTaskAdpater
...
...
@@ -19,8 +17,6 @@ import com.ym.library.listener.OnRecycleItemClickListener
import
com.ym.library.module.*
import
com.ym.library.net.BaseActivity
import
com.ym.library.utils.*
import
com.ym.library.utils.EventUtils.loadNextCacheRewardVideoAd
import
com.ym.library.utils.EventUtils.requestReport
import
kotlinx.android.synthetic.main.activity_welfare.*
class
WelfareActivity
:
BaseActivity
(),
WelfareContract
.
View
,
...
...
@@ -165,21 +161,6 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
}
})
AdManager
.
playRewardAd
(
ADConfig
.
AD_REWARD_VIDIO
,
"welfare_task"
,
this
,
object
:
ZXADVideoListener
{
override
fun
onSuccess
()
{}
override
fun
onError
(
s
:
String
?)
{}
override
fun
onAdShow
()
{}
override
fun
onAdVideoBarClick
()
{}
override
fun
onAdClose
()
{
requestReport
()
loadNextCacheRewardVideoAd
(
this
@WelfareActivity
)
}
})
}
private
var
isPause
=
false
...
...
app/src/main/java/com/ym/game/view/MainDialog.kt
View file @
74f14bf7
...
...
@@ -79,7 +79,7 @@ object MainDialog {
mDialog
.
setOnDismissListener
(
object
:
DialogInterface
.
OnDismissListener
{
override
fun
onDismiss
(
p0
:
DialogInterface
?)
{
onDestroy
()
Event
Utils
.
loadFeedCacheAdToCache
(
activity
)
Ad
Utils
.
loadFeedCacheAdToCache
(
activity
)
}
})
...
...
@@ -191,7 +191,7 @@ object MainDialog {
mDialog
.
setOnDismissListener
(
object
:
DialogInterface
.
OnDismissListener
{
override
fun
onDismiss
(
p0
:
DialogInterface
?)
{
onDestroy
()
Event
Utils
.
loadFeedCacheAdToCache
(
context
)
Ad
Utils
.
loadFeedCacheAdToCache
(
context
)
}
})
...
...
@@ -326,7 +326,7 @@ object MainDialog {
mDialog
.
setOnDismissListener
(
object
:
DialogInterface
.
OnDismissListener
{
override
fun
onDismiss
(
p0
:
DialogInterface
?)
{
onDestroy
()
Event
Utils
.
loadFeedCacheAdToCache
(
context
)
Ad
Utils
.
loadFeedCacheAdToCache
(
context
)
}
})
...
...
@@ -399,7 +399,7 @@ object MainDialog {
mDialog
.
setOnDismissListener
(
object
:
DialogInterface
.
OnDismissListener
{
override
fun
onDismiss
(
p0
:
DialogInterface
?)
{
onDestroy
()
Event
Utils
.
loadFeedCacheAdToCache
((
context
as
Activity
))
Ad
Utils
.
loadFeedCacheAdToCache
((
context
as
Activity
))
}
})
...
...
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
View file @
74f14bf7
...
...
@@ -27,15 +27,13 @@ import com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.rxbus.Subscribe
import
com.ym.library.rxbus.ThreadMode
import
com.ym.library.utils.ADConfig
import
com.ym.library.utils.EventUtils
import
com.ym.library.utils.JumpUtils
import
com.ym.library.utils.LogUtils
import
com.ym.ddcy.R
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.SinginEntity
import
com.ym.library.module.StatusEntity
import
com.ym.library.module.WateringTaskEntity
import
com.ym.library.net.GameApiClient
import
com.ym.library.utils.*
/**
*Craeted by ${junqi.li}
...
...
@@ -130,25 +128,14 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
}
4
->
{
EventUtils
.
onEvent
(
"click_receive_coin_task_video_btn"
,
"领金币任务视频"
)
AdManager
.
playRewardAd
(
ADConfig
.
AD_REWARD_VIDIO
,
"receive_coin_task"
,
(
mContext
as
Activity
),
object
:
ZXADVideoListener
{
override
fun
onAdClose
()
{
getVideoAcceleratorsReceive2
();
}
override
fun
onAdShow
()
{
}
AdUtils
.
playRewardAd
((
mContext
as
Activity
),
"receive_coin_task"
,
object
:
IAdVideoListener
{
override
fun
onAdClose
()
{
override
fun
onAdVideoBarClick
()
{
}
override
fun
onError
(
errorMsg
:
String
?)
{
}
override
fun
onSuccess
()
{
}
})
}
...
...
@@ -227,21 +214,4 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
this
.
animationStyle
=
R
.
style
.
main_photo_anim
isClippingEnabled
=
false
}
//看视频领上报
fun
getVideoAcceleratorsReceive2
()
{
EventUtils
.
loadNextCacheRewardVideoAd
(
mContext
!!
)
GameApiClient
.
gameApi
.
adVideoReport
()
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
StatusEntity
>()
{
override
fun
onSuccess
(
result
:
StatusEntity
?)
{
Log
.
d
(
"wxw"
,
"看视频上报 Success"
)
mPresenter
?.
getRrchardDailyTask
()
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
Log
.
d
(
"wxw"
,
"看视频上报 error"
)
}
})
}
}
\ No newline at end of file
app/src/main/java/com/ym/game/view/SpeedWaterPopupWindow.kt
View file @
74f14bf7
...
...
@@ -25,13 +25,11 @@ import com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.rxbus.Subscribe
import
com.ym.library.rxbus.ThreadMode
import
com.ym.library.utils.ADConfig
import
com.ym.library.utils.EventUtils
import
com.ym.library.utils.JumpUtils
import
com.ym.library.utils.Utils
import
com.ym.ddcy.R
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.WateringTaskEntity
import
com.ym.library.net.GameApiClient
import
com.ym.library.utils.*
class
SpeedWaterPopupWindow
:
PopupWindow
(),
SpeedWaterContract
.
View
,
OnRecycleItemClickListener
<
WateringTaskEntity
>
{
...
...
@@ -101,25 +99,14 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
}
4
->
{
EventUtils
.
onEvent
(
"click_jiasuji_task_video_btn"
,
"领加速剂任务视频"
)
AdManager
.
playRewardAd
(
ADConfig
.
AD_REWARD_VIDIO
,
"accelerator_task"
,
(
mContext
as
Activity
),
object
:
ZXADVideoListener
{
AdUtils
.
playRewardAd
((
mContext
as
Activity
),
"accelerator_task"
,
object
:
IAdVideoListener
{
override
fun
onAdClose
()
{
getVideoAcceleratorsReceive2
(
data
.
id
)
}
override
fun
onAdShow
()
{
}
override
fun
onAdVideoBarClick
()
{
}
override
fun
onError
(
errorMsg
:
String
?)
{
}
override
fun
onSuccess
()
{
}
})
}
...
...
@@ -179,23 +166,6 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
isClippingEnabled
=
false
}
//看视频领上报
fun
getVideoAcceleratorsReceive2
(
id
:
Int
)
{
EventUtils
.
loadNextCacheRewardVideoAd
(
mContext
!!
)
GameApiClient
.
gameApi
.
thirdParty
(
id
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
Any
>()
{
override
fun
onSuccess
(
result
:
Any
?)
{
Log
.
d
(
"wxw"
,
"看视频上报 Success"
)
mPresenter
?.
getAcceleratorsTask
()
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
Log
.
d
(
"wxw"
,
"看视频上报 error"
)
}
})
}
override
fun
AcceleratorsTaskResult
(
result
:
List
<
WateringTaskEntity
>)
{
speedadapter
?.
clear
()
speedadapter
?.
appendToList
(
result
)
...
...
app/src/main/java/com/ym/game/view/TurntableDialog.kt
View file @
74f14bf7
...
...
@@ -22,14 +22,12 @@ import com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.rxbus.Subscribe
import
com.ym.library.rxbus.ThreadMode
import
com.ym.library.utils.ADConfig
import
com.ym.library.utils.EventUtils
import
com.ym.library.utils.LogUtils
import
com.ym.library.utils.Utils
import
com.ym.ddcy.R
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.StatusEntity
import
com.ym.library.module.TurntableEntity
import
com.ym.library.net.GameApiClient
import
com.ym.library.utils.*
/**
...
...
@@ -152,7 +150,7 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
}
override
fun
onError
(
errorMsg
:
String
?)
{
getVideoAcceleratorsReceive3
();
//
getVideoAcceleratorsReceive3();
reset
()
btnTurntableLottery
?.
isEnabled
=
false
isStartAnim
=
true
...
...
library/src/main/java/com/ym/library/utils/AdUtils.kt
View file @
74f14bf7
...
...
@@ -15,7 +15,7 @@ import java.lang.Exception
object
AdUtils
{
fun
playRewardAd
(
activity
:
Activity
,
actionName
:
String
,
listener
:
IAdVideoListener
)
{
fun
playRewardAd
(
activity
:
Activity
,
actionName
:
String
,
listener
:
IAdVideoListener
)
{
AdManager
.
playRewardAd
(
ADConfig
.
AD_REWARD_VIDIO
,
actionName
,
...
...
@@ -26,7 +26,7 @@ object AdUtils {
override
fun
onAdClose
()
{
listener
?.
onAdClose
()
//预加载
EventUtils
.
loadNextCacheRewardVideoAd
(
activity
)
loadNextCacheRewardVideoAd
(
activity
)
//看视频上报
getVideoAcceleratorsReceive
();
}
...
...
@@ -43,15 +43,34 @@ object AdUtils {
}
fun
showFeedAd
(
activity
:
Activity
,
actionName
:
String
,
view
:
FrameLayout
)
{
fun
showFeedAd
(
activity
:
Activity
,
actionName
:
String
,
view
:
FrameLayout
)
{
try
{
AdManager
.
showFeedAd
(
ADConfig
.
AD_IMG_FADE
,
actionName
,
ZXADSizeConfig
(
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
activity
).
toFloat
())
-
40
,
280
),
ZXADSizeConfig
(
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
activity
).
toFloat
())
-
40
,
280
),
activity
,
view
)
}
catch
(
e
:
Exception
)
{}
view
)
}
catch
(
e
:
Exception
)
{
}
}
//预加载激励
fun
loadNextCacheRewardVideoAd
(
activity
:
Activity
)
{
AdManager
.
loadNextCacheRewardVideoAd
(
ADConfig
.
AD_REWARD_VIDIO
,
activity
)
}
//预加载信息流
fun
loadFeedCacheAdToCache
(
activity
:
Activity
)
{
AdManager
.
loadFeedAdToCache
(
ADConfig
.
AD_IMG_FADE
,
activity
,
ZXADSizeConfig
(
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
activity
).
toFloat
())
-
40
,
280
)
)
}
//看视频领上报
...
...
library/src/main/java/com/ym/library/utils/CenterDialog.kt
View file @
74f14bf7
...
...
@@ -406,7 +406,7 @@ object CenterDialog : BaseDialog() {
mDialog
?.
setOnCancelListener
{
listener
.
onCancel
(
it
)
Event
Utils
.
loadFeedCacheAdToCache
(
context
)
Ad
Utils
.
loadFeedCacheAdToCache
(
context
)
}
mDialog
?.
setCanceledOnTouchOutside
(
false
)
...
...
library/src/main/java/com/ym/library/utils/EventUtils.kt
View file @
74f14bf7
...
...
@@ -319,27 +319,4 @@ object EventUtils {
}
})
}
//预加载激励
public
fun
loadNextCacheRewardVideoAd
(
activity
:
Activity
)
{
AdManager
.
loadNextCacheRewardVideoAd
(
ADConfig
.
AD_REWARD_VIDIO
,
activity
)
}
//预加载信息流
public
fun
loadFeedCacheAdToCache
(
activity
:
Activity
)
{
AdManager
.
loadFeedAdToCache
(
ADConfig
.
AD_IMG_FADE
,
activity
,
ZXADSizeConfig
(
Utils
.
px2dip
(
PhoneUtils
.
getScreenWidth
(
activity
).
toFloat
())
-
40
,
280
)
)
}
//看视频上报
public
fun
requestReport
()
{
GameApiClient
.
gameApi
.
adVideoReport
()
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
StatusEntity
>()
{
override
fun
onSuccess
(
result
:
StatusEntity
)
{}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{}
})
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/utils/JumpUtils.java
View file @
74f14bf7
...
...
@@ -8,6 +8,7 @@ import android.util.Log;
import
com.bird.angel.AdConfig
;
import
com.ym.admodule.config.AdManager
;
import
com.ym.admodule.listener.ZXADVideoListener
;
import
com.ym.library.listener.IAdVideoListener
;
import
com.ym.library.module.NewsEntity
;
import
com.ym.library.module.ShaveListEntity
;
import
com.ym.library.net.GameApiClient
;
...
...
@@ -427,27 +428,12 @@ public class JumpUtils {
}
public
static
void
showAd
(
Activity
activity
,
NewsEntity
data
)
{
AdManager
.
INSTANCE
.
playRewardAd
(
"common_video"
,
"box_click"
,
activity
,
new
ZXADVideoListener
()
{
AdUtils
.
INSTANCE
.
playRewardAd
(
activity
,
"box_click"
,
new
IAdVideoListener
()
{
@Override
public
void
onSuccess
()
{
}
public
void
onAdClose
()
{
}
@Override
public
void
onError
(
@Nullable
String
s
)
{
}
@Override
public
void
onAdShow
()
{
}
@Override
public
void
onAdVideoBarClick
()
{
}
@Override
public
void
onAdClose
()
{
EventUtils
.
INSTANCE
.
requestReport
();
EventUtils
.
INSTANCE
.
loadNextCacheRewardVideoAd
(
activity
);
}
public
void
onError
(
@Nullable
String
errorMsg
)
{
}
});
}
...
...
userinfo/src/main/java/com/ym/userinfo/module/activity/SettingActivity.kt
View file @
74f14bf7
...
...
@@ -105,7 +105,7 @@ class SettingActivity : BaseActivity() {
super
.
onPause
()
MobclickAgent
.
onPause
(
this
)
Event
Utils
.
loadFeedCacheAdToCache
(
this
)
Ad
Utils
.
loadFeedCacheAdToCache
(
this
)
}
...
...
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