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
f8fed3fd
Commit
f8fed3fd
authored
Oct 16, 2020
by
wangxuewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :幸福农场 [实现方案] :加入广告
parent
a4d3a63b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
170 additions
and
79 deletions
+170
-79
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+155
-52
IGameApi.kt
app/src/main/java/com/ym/game/net/IGameApi.kt
+13
-4
NetConfig.java
library/src/main/java/com/ym/library/net/NetConfig.java
+1
-0
PermissionsActivity.java
...src/main/java/com/ym/library/net/PermissionsActivity.java
+0
-22
ToponManager.kt
toponad/src/main/java/com/ym/module/toponad/ToponManager.kt
+1
-1
No files found.
app/src/main/java/com/ym/game/GameActivity.kt
View file @
f8fed3fd
This diff is collapsed.
Click to expand it.
app/src/main/java/com/ym/game/net/IGameApi.kt
View file @
f8fed3fd
...
...
@@ -124,7 +124,6 @@ interface IGameApi {
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_INCR_SEED
)
fun
getVideoSeedReceive
(
@Query
(
"id"
)
id
:
Int
):
Observable
<
Response
<
StatusEntity
>>
/**
* 看视频获得加速剂
* @param
...
...
@@ -132,15 +131,25 @@ interface IGameApi {
* @return
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_INCR_ACCELERATORS
)
fun
getVideoAcceleratorsReceive
():
Observable
<
Response
<
StatusEntity
>>
fun
getVideoAcceleratorsReceive
(
@Query
(
"id"
)
id
:
Int
):
Observable
<
Response
<
StatusEntity
>>
/**
*
看视频获得加速剂
*
开宝箱
* @param
* @paramq
* @return
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_OPEN_BOX
)
fun
getopenBox
():
Observable
<
Response
<
StatusEntity
>>
fun
getVideoAcceleratorsReceive
(
@Query
(
"id"
)
id
:
Int
):
Observable
<
Response
<
StatusEntity
>>
/**
* 看视频上报
* @param
* @paramq
* @return
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_AD_VIDEO_REPORT
)
fun
adVideoReport
():
Observable
<
Response
<
StatusEntity
>>
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/NetConfig.java
View file @
f8fed3fd
...
...
@@ -234,6 +234,7 @@ public class NetConfig {
public
static
class
Game
{
public
static
final
String
URL_GAME_AD_VIDEO_REPORT
=
"app/v1/game/report"
;
//看视频上报
public
static
final
String
URL_GAME_BUY_SEED
=
"app/v1/game/farm/buy_seed"
;
//金币购买种子
public
static
final
String
URL_GAME_CLOUD_SPEED
=
"app/v1/game/farm/cloud_speed"
;
//云朵加速
public
static
final
String
URL_GAME_DO_WD
=
"app/v1/game/farm/do_wd"
;
//发起提现
...
...
library/src/main/java/com/ym/library/net/PermissionsActivity.java
View file @
f8fed3fd
...
...
@@ -79,28 +79,6 @@ public class PermissionsActivity extends Activity {
isRequireCheck
=
true
;
}
private
void
createDialog
()
{
alertBuilder
=
new
AlertDialog
.
Builder
(
this
)
.
setTitle
(
R
.
string
.
permission_help
)
.
setNegativeButton
(
R
.
string
.
permission_quit
,
(
dialog
,
which
)
->
{
setResult
(
PERMISSIONS_DENIED
);
isAlertDialogShow
=
false
;
finish
();
})
.
setPositiveButton
(
R
.
string
.
permission_setting
,
(
dialog
,
which
)
->
{
isAlertDialogShow
=
false
;
dialog
.
dismiss
();
startAppSettings
();
})
.
setOnKeyListener
((
dialog
,
keyCode
,
event
)
->
{
if
(
keyCode
==
KeyEvent
.
KEYCODE_BACK
)
{
return
true
;
}
return
false
;
})
.
setCancelable
(
false
);
}
// 启动应用的设置
private
void
startAppSettings
()
{
Intent
intent
=
new
Intent
(
Settings
.
ACTION_APPLICATION_DETAILS_SETTINGS
);
...
...
toponad/src/main/java/com/ym/module/toponad/ToponManager.kt
View file @
f8fed3fd
...
...
@@ -213,7 +213,6 @@ object ToponManager {
override
fun
onRewardedVideoAdPlayEnd
(
entity
:
ATAdInfo
)
{
listener
.
onRewardedVideoAdPlayEnd
(
entity
)
//移除本次并预加载
mRewardVideoAd
?.
show
(
activity
)
AdMap
.
aTRewardVideoAdMap
.
remove
(
placementId
)
AdMap
.
aTRewardVideoAdMap
[
placementId
]
=
preloadingLoadReward
(
activity
,
placementId
)
...
...
@@ -256,6 +255,7 @@ object ToponManager {
Toast
.
makeText
(
activity
,
"看完视频即可获得奖励"
,
Toast
.
LENGTH_SHORT
).
show
()
isShowToast
=
false
}
mRewardVideoAd
?.
show
(
activity
)
Log
.
i
(
TAG
,
"isAdReady = true"
)
removeCallbacksAndMessages
(
null
)
}
else
{
...
...
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