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
28b8c385
Commit
28b8c385
authored
Dec 14, 2020
by
Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[李俊岐]福利页添加广告间隔
parent
30c75055
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
77 additions
and
8 deletions
+77
-8
WelfareActivity.kt
...rc/main/java/com/ym/msdh/game/activity/WelfareActivity.kt
+20
-2
WelfareTaskAdpater.kt
.../main/java/com/ym/msdh/game/adapter/WelfareTaskAdpater.kt
+1
-0
WelfareContract.kt
...rc/main/java/com/ym/msdh/game/contract/WelfareContract.kt
+1
-0
WelfarePresenter.kt
.../main/java/com/ym/msdh/game/presenter/WelfarePresenter.kt
+14
-0
activity_welfare.xml
app/src/main/res/layout/activity_welfare.xml
+1
-2
item_welfare_task.xml
app/src/main/res/layout/item_welfare_task.xml
+0
-1
ExchangeEntity.kt
...ary/src/main/java/com/ym/library/module/ExchangeEntity.kt
+1
-0
IGameApi.kt
library/src/main/java/com/ym/library/net/IGameApi.kt
+15
-0
NetConfig.java
library/src/main/java/com/ym/library/net/NetConfig.java
+2
-1
AdUtils.kt
library/src/main/java/com/ym/library/utils/AdUtils.kt
+22
-1
activity_user_info.xml
userinfo/src/main/res/layout/activity_user_info.xml
+0
-1
No files found.
app/src/main/java/com/ym/msdh/game/activity/WelfareActivity.kt
View file @
28b8c385
...
@@ -7,6 +7,7 @@ import android.content.DialogInterface
...
@@ -7,6 +7,7 @@ import android.content.DialogInterface
import
android.view.View
import
android.view.View
import
android.view.animation.AnimationUtils
import
android.view.animation.AnimationUtils
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
btmsdkobf.cd
import
com.ym.msdh.game.adapter.WelfareDiamondAdapter
import
com.ym.msdh.game.adapter.WelfareDiamondAdapter
import
com.ym.msdh.game.adapter.WelfareTaskAdpater
import
com.ym.msdh.game.adapter.WelfareTaskAdpater
...
@@ -109,8 +110,8 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
...
@@ -109,8 +110,8 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
0
->
{
0
->
{
EventUtils
.
onEvent
(
"fuli_go_click_${data.sid}"
)
EventUtils
.
onEvent
(
"fuli_go_click_${data.sid}"
)
if
(
data
.
opentype
==
NewsEntity
.
AD_TYPE_SDK
)
{
if
(
data
.
opentype
==
NewsEntity
.
AD_TYPE_SDK
)
{
if
(
data
.
sid
!=
null
)
{
if
(
data
?
.
sid
!=
null
)
{
showAd
(
data
.
sid
!!
)
mPresenter
?.
getWelfareVideoCd
(
data
?
.
sid
!!
)
}
}
}
else
{
}
else
{
JumpUtils
.
adJump
(
data
,
this
)
JumpUtils
.
adJump
(
data
,
this
)
...
@@ -253,6 +254,23 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
...
@@ -253,6 +254,23 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
}
}
}
}
override
fun
welfareVideoCdResult
(
sid
:
Int
,
result
:
ExchangeEntity
?)
{
if
(
result
!=
null
)
{
if
(
result
?.
cd
!=
null
)
{
if
(
result
?.
cd
==
0
)
{
showAd
(
sid
)
}
else
{
Utils
.
showToast
(
this
,
"手速太快啦,${result?.cd}秒后再来吧"
)
}
}
else
{
showAd
(
sid
)
}
}
else
{
showAd
(
sid
)
}
}
fun
showAd
(
sId
:
Int
)
{
fun
showAd
(
sId
:
Int
)
{
AdUtils
.
playRewardAd
(
this
,
"welfare_task"
,
object
:
IAdVideoListener
{
AdUtils
.
playRewardAd
(
this
,
"welfare_task"
,
object
:
IAdVideoListener
{
override
fun
onAdClose
()
{
override
fun
onAdClose
()
{
...
...
app/src/main/java/com/ym/msdh/game/adapter/WelfareTaskAdpater.kt
View file @
28b8c385
...
@@ -96,6 +96,7 @@ class WelfareTaskAdpater :
...
@@ -96,6 +96,7 @@ class WelfareTaskAdpater :
resetAnimator
(
holder
?.
layoutStatus
)
resetAnimator
(
holder
?.
layoutStatus
)
holder
.
ivStatus
.
setImageResource
(
R
.
drawable
.
icon_item_welfare_task_receiveed
)
holder
.
ivStatus
.
setImageResource
(
R
.
drawable
.
icon_item_welfare_task_receiveed
)
holder
?.
tvStatus
.
text
=
"已领取"
holder
?.
tvStatus
.
text
=
"已领取"
holder
?.
layoutBg
.
setBackgroundResource
(
R
.
drawable
.
icon_record_bg
)
}
}
2
->
{
2
->
{
holder
.
ivStatus
.
setImageResource
(
R
.
drawable
.
icon_item_welfare_task_receive
)
holder
.
ivStatus
.
setImageResource
(
R
.
drawable
.
icon_item_welfare_task_receive
)
...
...
app/src/main/java/com/ym/msdh/game/contract/WelfareContract.kt
View file @
28b8c385
...
@@ -9,6 +9,7 @@ class WelfareContract {
...
@@ -9,6 +9,7 @@ class WelfareContract {
fun
taskReceiveListResult
(
result
:
TaskCompleteEntity
?)
fun
taskReceiveListResult
(
result
:
TaskCompleteEntity
?)
fun
taskCashResult
(
result
:
List
<
FlyBoxEntity
>?)
fun
taskCashResult
(
result
:
List
<
FlyBoxEntity
>?)
fun
welfareTaskCashResult
(
result
:
ExchangeEntity
?)
fun
welfareTaskCashResult
(
result
:
ExchangeEntity
?)
fun
welfareVideoCdResult
(
sid
:
Int
,
result
:
ExchangeEntity
?)
}
}
interface
Presenter
{
interface
Presenter
{
...
...
app/src/main/java/com/ym/msdh/game/presenter/WelfarePresenter.kt
View file @
28b8c385
...
@@ -97,4 +97,18 @@ class WelfarePresenter : WelfareContract.Presenter {
...
@@ -97,4 +97,18 @@ class WelfarePresenter : WelfareContract.Presenter {
}
}
})
})
}
}
fun
getWelfareVideoCd
(
sid
:
Int
)
{
GameApiClient
.
gameApi
.
getWelfareVideoCd
().
compose
(
RxSchedulers
.
observableIO2Main
()
).
subscribe
(
object
:
BaseObserver
<
ExchangeEntity
>()
{
override
fun
onSuccess
(
result
:
ExchangeEntity
?)
{
mView
?.
welfareVideoCdResult
(
sid
,
result
)
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
mView
?.
welfareVideoCdResult
(
sid
,
null
)
}
})
}
}
}
\ No newline at end of file
app/src/main/res/layout/activity_welfare.xml
View file @
28b8c385
...
@@ -172,8 +172,7 @@
...
@@ -172,8 +172,7 @@
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recycler_welfare_task"
android:id=
"@+id/recycler_welfare_task"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:layout_marginTop=
"16dp"
/>
</LinearLayout>
</LinearLayout>
...
...
app/src/main/res/layout/item_welfare_task.xml
View file @
28b8c385
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
android:id=
"@+id/layout_welfare_item_bg"
android:id=
"@+id/layout_welfare_item_bg"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"76dp"
android:layout_height=
"76dp"
android:layout_marginBottom=
"10dp"
android:background=
"@drawable/icon_record_bg"
android:background=
"@drawable/icon_record_bg"
android:paddingLeft=
"@dimen/dp_21"
>
android:paddingLeft=
"@dimen/dp_21"
>
...
...
library/src/main/java/com/ym/library/module/ExchangeEntity.kt
View file @
28b8c385
...
@@ -8,4 +8,5 @@ class ExchangeEntity {
...
@@ -8,4 +8,5 @@ class ExchangeEntity {
var
buttonStatus
:
Int
?
=
0
var
buttonStatus
:
Int
?
=
0
var
title
:
String
?
=
""
var
title
:
String
?
=
""
var
type
:
Int
?
=
0
var
type
:
Int
?
=
0
var
cd
:
Int
?
=
0
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/IGameApi.kt
View file @
28b8c385
...
@@ -176,6 +176,15 @@ interface IGameApi {
...
@@ -176,6 +176,15 @@ interface IGameApi {
@POST
(
NetConfig
.
Game
.
URL_GAME_AD_VIDEO_REPORT
)
@POST
(
NetConfig
.
Game
.
URL_GAME_AD_VIDEO_REPORT
)
fun
adVideoReport
():
Observable
<
Response
<
StatusEntity
>>
fun
adVideoReport
():
Observable
<
Response
<
StatusEntity
>>
/**
* 看视频上报
* @param
* @paramq
* @return
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_AD_VIDEO_REPORT
)
fun
adVideoReport
(
@Query
(
"slot"
)
slot
:
String
):
Observable
<
Response
<
Any
>>
/**
/**
* 任务领取奖励
* 任务领取奖励
* @param
* @param
...
@@ -308,6 +317,12 @@ interface IGameApi {
...
@@ -308,6 +317,12 @@ interface IGameApi {
@POST
(
NetConfig
.
Game
.
URL_GAME_WELFARE_TASK_CASH
)
@POST
(
NetConfig
.
Game
.
URL_GAME_WELFARE_TASK_CASH
)
fun
getWelfareTaskCash
():
Observable
<
Response
<
ExchangeEntity
>>
fun
getWelfareTaskCash
():
Observable
<
Response
<
ExchangeEntity
>>
/**
* 福利提现广告cd
*/
@GET
(
NetConfig
.
Game
.
URL_GAME_WELFARE_VIDEO_CD
)
fun
getWelfareVideoCd
():
Observable
<
Response
<
ExchangeEntity
>>
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD
)
@GET
(
NetConfig
.
Game
.
URL_COLLECT_CARD
)
fun
getCollectCard
():
Observable
<
Response
<
PuzzleEntity
?
>>
fun
getCollectCard
():
Observable
<
Response
<
PuzzleEntity
?
>>
...
...
library/src/main/java/com/ym/library/net/NetConfig.java
View file @
28b8c385
...
@@ -192,7 +192,7 @@ public class NetConfig {
...
@@ -192,7 +192,7 @@ public class NetConfig {
public
static
final
String
URL_USER_GS_PAGE_INFO
=
"app/v1/gs/gs_page_info"
;
//用户剩余货币
public
static
final
String
URL_USER_GS_PAGE_INFO
=
"app/v1/gs/gs_page_info"
;
//用户剩余货币
public
static
final
String
URL_USER_GS_DO_WD
=
"app/v1/game/msdh/do_wd"
;
//提现
public
static
final
String
URL_USER_GS_DO_WD
=
"app/v1/game/msdh/do_wd"
;
//提现
public
static
final
String
URL_USER_GS_COIN2CASH
=
"app/v1/gs/coin2cash"
;
//金币兑换现金
public
static
final
String
URL_USER_GS_COIN2CASH
=
"app/v1/gs/coin2cash"
;
//金币兑换现金
public
static
final
String
URL_USER_WD_HISTORY
=
"app/v1/g
s/wd/
history"
;
//提现记录
public
static
final
String
URL_USER_WD_HISTORY
=
"app/v1/g
ame/msdh/wd_
history"
;
//提现记录
public
static
final
String
URL_USER_GS_DO_LOTTERY_WD
=
"app/v2/game/lottery_wd"
;
//我的抽奖提现
public
static
final
String
URL_USER_GS_DO_LOTTERY_WD
=
"app/v2/game/lottery_wd"
;
//我的抽奖提现
}
}
...
@@ -262,6 +262,7 @@ public class NetConfig {
...
@@ -262,6 +262,7 @@ public class NetConfig {
public
static
final
String
URL_GAME_WELFARE_VIDEO_REPORT
=
"app/v1/game/welfare_video_report"
;
//福利中心看视频任务
public
static
final
String
URL_GAME_WELFARE_VIDEO_REPORT
=
"app/v1/game/welfare_video_report"
;
//福利中心看视频任务
public
static
final
String
URL_GAME_WELFARE_TASK_BOX
=
"app/v1/game/farm/welfare_task_box"
;
//福利中心宝箱领取
public
static
final
String
URL_GAME_WELFARE_TASK_BOX
=
"app/v1/game/farm/welfare_task_box"
;
//福利中心宝箱领取
public
static
final
String
URL_GAME_WELFARE_TASK_CASH
=
"app/v1/game/task_cash"
;
//福利中心红包领取
public
static
final
String
URL_GAME_WELFARE_TASK_CASH
=
"app/v1/game/task_cash"
;
//福利中心红包领取
public
static
final
String
URL_GAME_WELFARE_VIDEO_CD
=
"app/v1/game/video_cd"
;
//福利中心广告cd
public
static
final
String
URL_COLLECT_CARD
=
"app/v1/collect-card/list"
;
//宝箱卡片列表
public
static
final
String
URL_COLLECT_CARD
=
"app/v1/collect-card/list"
;
//宝箱卡片列表
public
static
final
String
URL_COLLECT_CARD_PUT
=
"app/v1/collect-card/put"
;
//宝箱卡片拼图
public
static
final
String
URL_COLLECT_CARD_PUT
=
"app/v1/collect-card/put"
;
//宝箱卡片拼图
public
static
final
String
URL_COLLECT_CARD_ADV
=
"app/v1/collect-card/adv"
;
//看广告一键拼图
public
static
final
String
URL_COLLECT_CARD_ADV
=
"app/v1/collect-card/adv"
;
//看广告一键拼图
...
...
library/src/main/java/com/ym/library/utils/AdUtils.kt
View file @
28b8c385
...
@@ -11,6 +11,7 @@ import com.ym.admodule.config.ZXADSizeConfig
...
@@ -11,6 +11,7 @@ import com.ym.admodule.config.ZXADSizeConfig
import
com.ym.admodule.listener.ZXADVideoListener
import
com.ym.admodule.listener.ZXADVideoListener
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.listener.IAdVideoListener
import
com.ym.library.module.StatusEntity
import
com.ym.library.module.StatusEntity
import
com.ym.library.net.ApiClient
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.GameApiClient
import
com.ym.library.net.GameApiClient
import
com.ym.library.net.RxSchedulers
import
com.ym.library.net.RxSchedulers
...
@@ -49,7 +50,12 @@ object AdUtils {
...
@@ -49,7 +50,12 @@ object AdUtils {
//预加载
//预加载
loadNextCacheRewardVideoAd
(
activity
)
loadNextCacheRewardVideoAd
(
activity
)
//看视频上报
//看视频上报
if
(
actionName
.
equals
(
"welfare_task"
))
{
getVideoAcceleratorsReceive
(
"center_video_cd"
)
}
else
{
getVideoAcceleratorsReceive
();
getVideoAcceleratorsReceive
();
}
handler
?.
removeCallbacksAndMessages
(
null
)
handler
?.
removeCallbacksAndMessages
(
null
)
}
}
...
@@ -126,4 +132,19 @@ object AdUtils {
...
@@ -126,4 +132,19 @@ object AdUtils {
}
}
})
})
}
}
//看视频复活上报
fun
getVideoAcceleratorsReceive
(
slot
:
String
)
{
GameApiClient
.
gameApi
.
adVideoReport
(
slot
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
Any
>()
{
override
fun
onSuccess
(
result
:
Any
?)
{
}
override
fun
onFailure
(
e
:
Throwable
?,
code
:
String
?,
errorMsg
:
String
?)
{
}
})
}
}
}
\ No newline at end of file
userinfo/src/main/res/layout/activity_user_info.xml
View file @
28b8c385
...
@@ -430,7 +430,6 @@
...
@@ -430,7 +430,6 @@
android:layout_marginBottom=
"5dp"
android:layout_marginBottom=
"5dp"
android:textColor=
"#663408"
android:textColor=
"#663408"
android:textSize=
"16sp"
android:textSize=
"16sp"
android:textStyle=
"bold"
tools:text=
"提现说明"
/>
tools:text=
"提现说明"
/>
<com.ym.library.widget.MediumBoldTextView
<com.ym.library.widget.MediumBoldTextView
...
...
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