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
1bc7e205
Commit
1bc7e205
authored
Nov 18, 2020
by
wangxuewei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[提交人]:王雪伟
[提交简述] :幸运农场 [实现方案] :1.0.7发布 替换广告预加载 新闻页面退出弹窗样式修改
parent
a732f2f9
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
216 additions
and
115 deletions
+216
-115
GameActivity.kt
app/src/main/java/com/ym/game/GameActivity.kt
+6
-6
BaseApplication.kt
app/src/main/java/com/ym/game/application/BaseApplication.kt
+3
-2
SiginDropsPopupwindow.kt
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
+4
-52
TurntableDialog.kt
app/src/main/java/com/ym/game/view/TurntableDialog.kt
+1
-1
build.gradle
library/build.gradle
+1
-1
JavaInterface.kt
...ry/src/main/java/com/ym/library/activity/JavaInterface.kt
+7
-0
NewWebActivity.kt
...y/src/main/java/com/ym/library/activity/NewWebActivity.kt
+15
-4
NewWebContract.kt
...n/java/com/ym/library/activity/contract/NewWebContract.kt
+1
-1
NewWebPresenter.kt
...java/com/ym/library/activity/presenter/NewWebPresenter.kt
+15
-4
AdStatusEntity.kt
...ary/src/main/java/com/ym/library/module/AdStatusEntity.kt
+1
-0
IHomeDataApi.kt
library/src/main/java/com/ym/library/net/IHomeDataApi.kt
+18
-0
NetConfig.java
library/src/main/java/com/ym/library/net/NetConfig.java
+1
-0
JumpUtils.java
library/src/main/java/com/ym/library/utils/JumpUtils.java
+91
-6
activity_new_web.xml
library/src/main/res/layout/activity_new_web.xml
+1
-1
dialog_sign_out_layout.xml
library/src/main/res/layout/dialog_sign_out_layout.xml
+51
-37
No files found.
app/src/main/java/com/ym/game/GameActivity.kt
View file @
1bc7e205
...
@@ -255,7 +255,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -255,7 +255,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
loadAdCache
()
//
loadAdCache()
flyBoxIsClick
=
true
flyBoxIsClick
=
true
}
}
...
@@ -296,7 +296,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -296,7 +296,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
loadAdCache
()
//
loadAdCache()
flyBoxIsClick2
=
true
flyBoxIsClick2
=
true
}
}
...
@@ -410,7 +410,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -410,7 +410,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
loadAdCache
()
//
loadAdCache()
}
}
override
fun
onSuccess
()
{
override
fun
onSuccess
()
{
...
@@ -586,7 +586,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -586,7 +586,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
loadAdCache
()
//
loadAdCache()
videoSeedClick
=
true
videoSeedClick
=
true
}
}
...
@@ -659,7 +659,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -659,7 +659,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
loadAdCache
()
//
loadAdCache()
videoJiasuClick
=
true
videoJiasuClick
=
true
}
}
...
@@ -811,7 +811,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
...
@@ -811,7 +811,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
loadAdCache
()
//
loadAdCache()
}
}
override
fun
onSuccess
()
{
override
fun
onSuccess
()
{
...
...
app/src/main/java/com/ym/game/application/BaseApplication.kt
View file @
1bc7e205
...
@@ -13,6 +13,7 @@ import com.tencent.bugly.crashreport.CrashReport
...
@@ -13,6 +13,7 @@ import com.tencent.bugly.crashreport.CrashReport
import
com.umeng.commonsdk.UMConfigure
import
com.umeng.commonsdk.UMConfigure
import
com.umeng.socialize.PlatformConfig
import
com.umeng.socialize.PlatformConfig
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.config.ZXADConfig
import
com.ym.library.AppliContext
import
com.ym.library.AppliContext
import
com.ym.library.Constant
import
com.ym.library.Constant
import
com.ym.modulecommon.net.NetConfig
import
com.ym.modulecommon.net.NetConfig
...
@@ -27,8 +28,8 @@ class BaseApplication : MultiDexApplication() {
...
@@ -27,8 +28,8 @@ class BaseApplication : MultiDexApplication() {
//第一步初始化 application
//第一步初始化 application
AppliContext
.
init
(
this
)
AppliContext
.
init
(
this
)
// Config.init(this)
// Config.init(this)
NetConfig
.
setBase_Url
(
NetConfig
.
Environment
.
DEV
)
// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
NetConfig
.
setBase_Url
(
NetConfig
.
Environment
.
PRODUCT
)
// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
AdManager
.
init
(
this
,
"a03d5320d905cf3b"
)
AdManager
.
init
(
this
,
"a03d5320d905cf3b"
)
// Constant.appLs = "a03d5320d905cf3b"//applsq
// Constant.appLs = "a03d5320d905cf3b"//applsq
// AdManager.init(this)
// AdManager.init(this)
// AdManager.init(//替换id
// AdManager.init(//替换id
...
...
app/src/main/java/com/ym/game/view/SiginDropsPopupwindow.kt
View file @
1bc7e205
...
@@ -130,54 +130,6 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
...
@@ -130,54 +130,6 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
}
}
4
->
{
4
->
{
EventUtils
.
onEvent
(
"click_receive_coin_task_video_btn"
,
"领金币任务视频"
)
EventUtils
.
onEvent
(
"click_receive_coin_task_video_btn"
,
"领金币任务视频"
)
// mPresenter?.getRrchardDailyTask()
//看广告
// ToponManager.loadReward(
// (mContext as Activity), object : ToponRewardListener {
// override fun onRewardedVideoAdPlayClicked(entity: ATAdInfo) {
// EventUtils.onEvent(
// "ad_click",
// Utils.obj2Str(
// AdEntity(
// entity.networkFirmId,
// AdID.mPlacementId_Reward_video_luck_farm,
// "每日水滴激励视频"
// )
// )
// )
// }
//
// override fun onRewardedVideoAdClosed(entity: ATAdInfo) {
// mPresenter?.getRrchardDailyTask()
// }
//
// override fun onRewardedVideoAdFailed(errorCode: AdError) {
//
// }
//
// override fun onRewardedVideoAdPlayEnd(entity: ATAdInfo) {
// EventUtils.onEvent(
// "ad_ended",
// Utils.obj2Str(AdEntity("ad_ended", "ad_ended", "每日水滴激励视频"))
// )
// }
//
// override fun onRewardedVideoAdPlayStart(entity: ATAdInfo) {
// EventUtils.onEvent(
// "ad_show",
// Utils.obj2Str(
// AdEntity(
// entity.networkFirmId,
// AdID.mPlacementId_Reward_video_luck_farm,
// "每日水滴激励视频"
// )
// )
// )
// }
//
// },
// AdID.mPlacementId_Reward_video_luck_farm
// )
AdManager
.
playRewardAd
(
AdManager
.
playRewardAd
(
ADConfig
.
AD_REWARD_VIDIO
,
ADConfig
.
AD_REWARD_VIDIO
,
"receive_coin_task_video"
,
"receive_coin_task_video"
,
...
@@ -198,10 +150,10 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
...
@@ -198,10 +150,10 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
AdManager
.
loadNextCacheRewardVideoAd
(
//
AdManager.loadNextCacheRewardVideoAd(
ADConfig
.
AD_REWARD_VIDIO
,
//
ADConfig.AD_REWARD_VIDIO,
mContext
as
Activity
//
mContext as Activity
)
//
)
}
}
override
fun
onSuccess
()
{
override
fun
onSuccess
()
{
...
...
app/src/main/java/com/ym/game/view/TurntableDialog.kt
View file @
1bc7e205
...
@@ -210,7 +210,7 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
...
@@ -210,7 +210,7 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
}
}
override
fun
onError
(
errorMsg
:
String
?)
{
override
fun
onError
(
errorMsg
:
String
?)
{
AdManager
.
loadNextCacheRewardVideoAd
(
ADConfig
.
AD_REWARD_VIDIO
,
context
as
Activity
)
//
AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_REWARD_VIDIO, context as Activity)
reset
()
reset
()
btnTurntableLottery
?.
isEnabled
=
false
btnTurntableLottery
?.
isEnabled
=
false
isStartAnim
=
true
isStartAnim
=
true
...
...
library/build.gradle
View file @
1bc7e205
...
@@ -112,7 +112,7 @@ dependencies {
...
@@ -112,7 +112,7 @@ dependencies {
// exclude group: 'com.mintegral.msdk'
// exclude group: 'com.mintegral.msdk'
// exclude group: 'cn.vlion.inlandsh'
// exclude group: 'cn.vlion.inlandsh'
// }
// }
api
'com.ym.admodule:admodule:1.0.1.
10
'
api
'com.ym.admodule:admodule:1.0.1.
21
'
api
(
"com.bx:adsdk:1.3.3"
){
api
(
"com.bx:adsdk:1.3.3"
){
exclude
group:
'com.google.code.gson'
exclude
group:
'com.google.code.gson'
}
}
...
...
library/src/main/java/com/ym/library/activity/JavaInterface.kt
View file @
1bc7e205
package
com.ym.library.activity
package
com.ym.library.activity
import
a.b.a.a.j.d.b.A
import
android.app.Activity
import
android.app.Activity
import
android.app.AlertDialog
import
android.app.AlertDialog
import
android.app.DownloadManager
import
android.app.DownloadManager
...
@@ -24,10 +25,13 @@ import android.widget.Toast
...
@@ -24,10 +25,13 @@ import android.widget.Toast
import
androidx.core.app.ActivityCompat
import
androidx.core.app.ActivityCompat
import
androidx.core.app.NotificationManagerCompat
import
androidx.core.app.NotificationManagerCompat
import
androidx.core.content.FileProvider
import
androidx.core.content.FileProvider
import
com.ym.admodule.config.AdManager
import
com.ym.admodule.listener.ZXADVideoListener
import
com.ym.library.AppliContext
import
com.ym.library.AppliContext
import
com.ym.library.Constant
import
com.ym.library.Constant
import
com.ym.library.module.NewsEntity
import
com.ym.library.module.NewsEntity
import
com.ym.library.net.ApiClient
import
com.ym.library.net.ApiClient
import
com.ym.library.net.BaseObserver
import
com.ym.library.net.RxSchedulers
import
com.ym.library.net.RxSchedulers
import
com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusConstant
import
com.ym.library.rxbus.RxBusUtil
import
com.ym.library.rxbus.RxBusUtil
...
@@ -35,6 +39,7 @@ import com.ym.library.utils.*
...
@@ -35,6 +39,7 @@ import com.ym.library.utils.*
import
io.reactivex.Observer
import
io.reactivex.Observer
import
io.reactivex.disposables.Disposable
import
io.reactivex.disposables.Disposable
import
okhttp3.ResponseBody
import
okhttp3.ResponseBody
import
org.jetbrains.anko.act
import
org.jetbrains.anko.runOnUiThread
import
org.jetbrains.anko.runOnUiThread
import
org.json.JSONArray
import
org.json.JSONArray
import
org.json.JSONObject
import
org.json.JSONObject
...
@@ -879,7 +884,9 @@ abstract class JavaInterface {
...
@@ -879,7 +884,9 @@ abstract class JavaInterface {
@JavascriptInterface
@JavascriptInterface
fun
jumpWebActivity
(
json
:
String
)
{
fun
jumpWebActivity
(
json
:
String
)
{
act
?.
runOnUiThread
(
Runnable
{
act
?.
runOnUiThread
(
Runnable
{
Log
.
d
(
"JavaInfterface"
,
"json = "
+
json
)
val
newsEntity
:
NewsEntity
=
Utils
.
str2Obj
(
json
,
NewsEntity
::
class
.
java
)
as
NewsEntity
val
newsEntity
:
NewsEntity
=
Utils
.
str2Obj
(
json
,
NewsEntity
::
class
.
java
)
as
NewsEntity
JumpUtils
.
setWebView
(
mWebView
)
JumpUtils
.
adJump
(
newsEntity
,
act
)
JumpUtils
.
adJump
(
newsEntity
,
act
)
/*JumpUtils.webH5Jump(
/*JumpUtils.webH5Jump(
newsEntity.title,
newsEntity.title,
...
...
library/src/main/java/com/ym/library/activity/NewWebActivity.kt
View file @
1bc7e205
...
@@ -8,6 +8,7 @@ import android.graphics.Color
...
@@ -8,6 +8,7 @@ import android.graphics.Color
import
android.net.http.SslError
import
android.net.http.SslError
import
android.os.Build
import
android.os.Build
import
android.text.TextUtils
import
android.text.TextUtils
import
android.util.Log
import
android.view.KeyEvent
import
android.view.KeyEvent
import
android.view.MotionEvent
import
android.view.MotionEvent
import
android.view.View
import
android.view.View
...
@@ -140,6 +141,7 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
...
@@ -140,6 +141,7 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
private
var
isOpen
=
true
private
var
isOpen
=
true
private
var
showNewCoinsDialog
:
Dialog
?
=
null
private
var
showNewCoinsDialog
:
Dialog
?
=
null
@RequiresApi
(
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
@RequiresApi
(
Build
.
VERSION_CODES
.
JELLY_BEAN_MR1
)
override
fun
showCoinsDialog
(
coins
:
Int
,
value
:
String
)
{
override
fun
showCoinsDialog
(
coins
:
Int
,
value
:
String
)
{
// showCoins(coins)
// showCoins(coins)
...
@@ -185,11 +187,14 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
...
@@ -185,11 +187,14 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
id_activity_web_bottom_progress
?.
visibility
=
View
.
VISIBLE
id_activity_web_bottom_progress
?.
visibility
=
View
.
VISIBLE
}
}
override
fun
setCurrentNum
(
num
:
Int
,
title
:
String
)
{
override
fun
setCurrentNum
(
award
:
Int
,
num
:
Int
,
title
:
String
)
{
if
(
award
>
0
&&
num
>=
award
)
{
//奖励目标数大于0 且 已看数量大于目标数量,不展示退出挽留弹窗
isAdds
=
true
}
if
(!
title
.
equals
(
""
))
{
if
(!
title
.
equals
(
""
))
{
tv_newweb_title
.
text
=
"${title.split("
")[0]}"
tv_newweb_title
.
text
=
"${title.split("
")[0]}"
}
else
{
}
else
{
tv_newweb_title
.
text
=
"看4篇可得2
000金币
"
tv_newweb_title
.
text
=
"看4篇可得2
钻石
"
}
}
if
(
num
==
0
)
{
if
(
num
==
0
)
{
id_read_round_1
.
setBackgroundResource
(
R
.
drawable
.
shape_c9c9c9_r
)
id_read_round_1
.
setBackgroundResource
(
R
.
drawable
.
shape_c9c9c9_r
)
...
@@ -362,7 +367,10 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
...
@@ -362,7 +367,10 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
if
(
webview
!=
null
)
{
if
(
webview
!=
null
)
{
webview
?.
loadUrl
(
"javascript:onResume()"
)
webview
?.
loadUrl
(
"javascript:onResume()"
)
}
}
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"NewWebActivity"
,
"onResume"
)))
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"NewWebActivity"
,
"onResume"
))
)
MobclickAgent
.
onResume
(
this
)
MobclickAgent
.
onResume
(
this
)
}
}
...
@@ -371,7 +379,10 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
...
@@ -371,7 +379,10 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
RxBusUtil
.
getDefault
()
RxBusUtil
.
getDefault
()
.
send
(
RxBusConstant
.
RX_MAIN_HIGH_WATER_DROP_UPDATE
)
.
send
(
RxBusConstant
.
RX_MAIN_HIGH_WATER_DROP_UPDATE
)
MobclickAgent
.
onPause
(
this
)
MobclickAgent
.
onPause
(
this
)
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"NewWebActivity"
,
"onPause"
)))
EventUtils
.
onEvent
(
"page_status"
,
Utils
.
obj2Str
(
ReportEntity
(
Constant
.
ReportSessionId
,
"NewWebActivity"
,
"onPause"
))
)
if
(
webview
!=
null
)
{
if
(
webview
!=
null
)
{
// webview?.loadUrl("javascript:onPause()")
// webview?.loadUrl("javascript:onPause()")
}
}
...
...
library/src/main/java/com/ym/library/activity/contract/NewWebContract.kt
View file @
1bc7e205
...
@@ -38,7 +38,7 @@ class NewWebContract {
...
@@ -38,7 +38,7 @@ class NewWebContract {
fun
setBottomDesc
(
desc
:
String
)
fun
setBottomDesc
(
desc
:
String
)
fun
setCurrentNum
(
num
:
Int
,
title
:
String
)
fun
setCurrentNum
(
award
:
Int
,
num
:
Int
,
title
:
String
)
fun
setBottomVisibity
(
visibility
:
Int
)
fun
setBottomVisibity
(
visibility
:
Int
)
...
...
library/src/main/java/com/ym/library/activity/presenter/NewWebPresenter.kt
View file @
1bc7e205
...
@@ -43,7 +43,12 @@ class NewWebPresenter : NewWebContract.Presenter {
...
@@ -43,7 +43,12 @@ class NewWebPresenter : NewWebContract.Presenter {
private
var
STATUS
:
Int
=
INIT
private
var
STATUS
:
Int
=
INIT
private
var
mPageUrl
:
String
=
""
private
var
mPageUrl
:
String
=
""
constructor
(
mView
:
NewWebContract
.
View
,
mActivity
:
Activity
,
intent
:
Intent
,
webview
:
ScrollWebView
)
{
constructor
(
mView
:
NewWebContract
.
View
,
mActivity
:
Activity
,
intent
:
Intent
,
webview
:
ScrollWebView
)
{
this
.
mView
=
mView
this
.
mView
=
mView
this
.
mActivity
=
mActivity
this
.
mActivity
=
mActivity
this
.
intent
=
intent
this
.
intent
=
intent
...
@@ -168,7 +173,8 @@ class NewWebPresenter : NewWebContract.Presenter {
...
@@ -168,7 +173,8 @@ class NewWebPresenter : NewWebContract.Presenter {
private
fun
getAdStatus
(
sUrl
:
String
/*, url: String*/
)
{
private
fun
getAdStatus
(
sUrl
:
String
/*, url: String*/
)
{
Log
.
d
(
"glc"
,
"sUrl"
+
sUrl
)
Log
.
d
(
"glc"
,
"sUrl"
+
sUrl
)
ApiClient
.
adApi
.
getAdStatus
(
slot_id
,
sid
,
sUrl
,
Utils
.
md5
(
sUrl
)).
compose
(
RxSchedulers
.
observableIO2Main
())
ApiClient
.
adApi
.
getAdStatus
(
slot_id
,
sid
,
sUrl
,
Utils
.
md5
(
sUrl
))
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
object
:
BaseObserver
<
AdStatusEntity
>()
{
.
subscribe
(
object
:
BaseObserver
<
AdStatusEntity
>()
{
override
fun
onSuccess
(
result
:
AdStatusEntity
?)
{
override
fun
onSuccess
(
result
:
AdStatusEntity
?)
{
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
...
@@ -187,7 +193,11 @@ class NewWebPresenter : NewWebContract.Presenter {
...
@@ -187,7 +193,11 @@ class NewWebPresenter : NewWebContract.Presenter {
// mView.setBottomProgressVisibity(View.VISIBLE)
// mView.setBottomProgressVisibity(View.VISIBLE)
STATUS
=
INIT
STATUS
=
INIT
}
}
mView
.
setCurrentNum
(
result
.
current_nums
?:
0
,
result
?.
alert
?:
""
)
mView
.
setCurrentNum
(
result
.
award_limit
?:
0
,
result
.
current_nums
?:
0
,
result
?.
alert
?:
""
)
}
}
if
(
result
.
delay
==
0
)
{
if
(
result
.
delay
==
0
)
{
//加金币
//加金币
...
@@ -318,7 +328,8 @@ class NewWebPresenter : NewWebContract.Presenter {
...
@@ -318,7 +328,8 @@ class NewWebPresenter : NewWebContract.Presenter {
private
var
videoSrc
:
String
=
""
private
var
videoSrc
:
String
=
""
inner
class
NewWebJavaScriptInterface
(
context
:
Activity
,
mWebView
:
WebView
)
:
JavaInterface
(
context
,
mWebView
)
{
inner
class
NewWebJavaScriptInterface
(
context
:
Activity
,
mWebView
:
WebView
)
:
JavaInterface
(
context
,
mWebView
)
{
@android
.
webkit
.
JavascriptInterface
@android
.
webkit
.
JavascriptInterface
fun
getVideoSrc
():
String
{
fun
getVideoSrc
():
String
{
...
...
library/src/main/java/com/ym/library/module/AdStatusEntity.kt
View file @
1bc7e205
...
@@ -14,4 +14,5 @@ class AdStatusEntity {
...
@@ -14,4 +14,5 @@ class AdStatusEntity {
var
time_trigger
:
Int
?
=
0
var
time_trigger
:
Int
?
=
0
var
progressStatus
:
Int
?
=
0
var
progressStatus
:
Int
?
=
0
var
current_nums
:
Int
?
=
0
var
current_nums
:
Int
?
=
0
var
award_limit
:
Int
?
=
0
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/IHomeDataApi.kt
View file @
1bc7e205
...
@@ -2,6 +2,7 @@ package com.ym.library.net
...
@@ -2,6 +2,7 @@ package com.ym.library.net
import
io.reactivex.Observable
import
io.reactivex.Observable
import
retrofit2.http.GET
import
retrofit2.http.GET
import
retrofit2.http.POST
import
retrofit2.http.Query
import
retrofit2.http.Query
import
retrofit2.http.Url
import
retrofit2.http.Url
...
@@ -15,4 +16,21 @@ interface IHomeDataApi {
...
@@ -15,4 +16,21 @@ interface IHomeDataApi {
Observable
<
Response
<
NovelInitEntity
>>
Observable
<
Response
<
NovelInitEntity
>>
/**
* 看视频上报
* @param
* @paramq
* @return
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_AD_VIDEO_REPORT
)
fun
adVideoReport
():
Observable
<
Response
<
Any
>>
/**
* 看视频上报
* @param
* @paramq
* @return
*/
@POST
(
NetConfig
.
Game
.
URL_GAME_AD_WELFARE_VIDEO_REPORT
)
fun
adWelfareVideoReport
(
@Query
(
"sid"
)
sid
:
Int
):
Observable
<
Response
<
Any
>>
}
}
\ No newline at end of file
library/src/main/java/com/ym/library/net/NetConfig.java
View file @
1bc7e205
...
@@ -216,6 +216,7 @@ public class NetConfig {
...
@@ -216,6 +216,7 @@ public class NetConfig {
public
static
class
Game
{
public
static
class
Game
{
public
static
final
String
URL_GAME_AD_VIDEO_REPORT
=
"app/v1/game/report"
;
//看视频上报
public
static
final
String
URL_GAME_AD_VIDEO_REPORT
=
"app/v1/game/report"
;
//看视频上报
public
static
final
String
URL_GAME_AD_WELFARE_VIDEO_REPORT
=
"app/v1/game/welfare_video_report"
;
//福利任务视频上报
public
static
final
String
URL_GAME_BUY_SEED
=
"app/v1/game/farm/buy_seed"
;
//金币购买种子
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_CLOUD_SPEED
=
"app/v1/game/farm/cloud_speed"
;
//云朵加速
...
...
library/src/main/java/com/ym/library/utils/JumpUtils.java
View file @
1bc7e205
...
@@ -4,10 +4,17 @@ import android.app.Activity;
...
@@ -4,10 +4,17 @@ import android.app.Activity;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.util.Log
;
import
android.webkit.WebView
;
import
com.ym.admodule.config.AdManager
;
import
com.ym.admodule.listener.ZXADVideoListener
;
import
com.ym.library.AppliContext
;
import
com.ym.library.AppliContext
;
import
com.ym.library.module.NewsEntity
;
import
com.ym.library.module.NewsEntity
;
import
com.ym.library.module.ShaveListEntity
;
import
com.ym.library.module.ShaveListEntity
;
import
com.ym.library.net.ApiClient
;
import
com.ym.library.net.BaseAdOberver
;
import
com.ym.library.net.Response
;
import
com.ym.library.net.RxSchedulers
;
import
com.ym.library.router.RounterApi
;
import
com.ym.library.router.RounterApi
;
import
com.ym.library.router.RounterBus
;
import
com.ym.library.router.RounterBus
;
import
com.ym.library.rxbus.BusData
;
import
com.ym.library.rxbus.BusData
;
...
@@ -15,6 +22,8 @@ import com.ym.library.rxbus.RxBusConstant;
...
@@ -15,6 +22,8 @@ import com.ym.library.rxbus.RxBusConstant;
import
com.ym.library.rxbus.RxBusUtil
;
import
com.ym.library.rxbus.RxBusUtil
;
import
com.ym.modulecommon.module.UserInfoEntity
;
import
com.ym.modulecommon.module.UserInfoEntity
;
import
org.jetbrains.annotations.Nullable
;
/**
/**
* Created by gaoleichao on 2019/3/12
* Created by gaoleichao on 2019/3/12
...
@@ -30,12 +39,12 @@ public class JumpUtils {
...
@@ -30,12 +39,12 @@ public class JumpUtils {
}
}
}
}
public
static
void
h5Jump
(
String
title
,
String
url
,
boolean
showToolbar
,
Activity
activity
)
{
public
static
void
h5Jump
(
String
title
,
String
url
,
boolean
showToolbar
,
Activity
activity
)
{
try
{
try
{
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentActivityWeb
(
title
,
url
,
showToolbar
);
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentActivityWeb
(
title
,
url
,
showToolbar
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
// intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
// intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
if
(
activity
!=
null
)
{
if
(
activity
!=
null
)
{
activity
.
startActivity
(
intent
);
activity
.
startActivity
(
intent
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -250,7 +259,7 @@ public class JumpUtils {
...
@@ -250,7 +259,7 @@ public class JumpUtils {
try
{
try
{
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentScratchCard
();
Intent
intent
=
RounterBus
.
getRounter
(
RounterApi
.
class
).
getIntentScratchCard
();
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
putExtra
(
"json"
,
entity
);
intent
.
putExtra
(
"json"
,
entity
);
AppliContext
.
get
().
startActivity
(
intent
);
AppliContext
.
get
().
startActivity
(
intent
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
...
@@ -309,7 +318,7 @@ public class JumpUtils {
...
@@ -309,7 +318,7 @@ public class JumpUtils {
}
}
//广告跳转
//广告跳转
public
static
void
adJump
(
NewsEntity
data
,
Activity
activity
)
{
public
static
void
adJump
(
NewsEntity
data
,
Activity
activity
)
{
String
sid
=
String
.
valueOf
(
data
.
getSid
());
String
sid
=
String
.
valueOf
(
data
.
getSid
());
int
incentiveLevel
=
data
.
getIncentive_level
();
int
incentiveLevel
=
data
.
getIncentive_level
();
int
appmodelId
=
data
.
getAppmodel_id
();
int
appmodelId
=
data
.
getAppmodel_id
();
...
@@ -351,7 +360,7 @@ public class JumpUtils {
...
@@ -351,7 +360,7 @@ public class JumpUtils {
data
.
getDeep_url_re
()
data
.
getDeep_url_re
()
);
);
}
else
{
}
else
{
h5Jump
(
data
.
getTitle
(),
data
.
getUrl
(),
false
,
activity
);
h5Jump
(
data
.
getTitle
(),
data
.
getUrl
(),
false
,
activity
);
}
}
}
else
if
(
data
.
getOpentype
()
==
NewsEntity
.
AD_TYPE_APPMODEL
&&
data
.
getStatus
()
!=
2
)
{
}
else
if
(
data
.
getOpentype
()
==
NewsEntity
.
AD_TYPE_APPMODEL
&&
data
.
getStatus
()
!=
2
)
{
if
(
appmodelId
==
59
)
{
if
(
appmodelId
==
59
)
{
...
@@ -390,9 +399,85 @@ public class JumpUtils {
...
@@ -390,9 +399,85 @@ public class JumpUtils {
if
(
TextUtils
.
equals
(
sid
,
"2077"
))
{
if
(
TextUtils
.
equals
(
sid
,
"2077"
))
{
//看视频加金币
//看视频加金币
}
}
showAd
(
activity
,
data
.
getSid
());
}
}
}
}
private
static
WebView
mWebView
;
public
static
void
setWebView
(
WebView
webView
)
{
mWebView
=
webView
;
}
private
static
void
showAd
(
Activity
activity
,
int
sid
)
{
activity
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
AdManager
.
INSTANCE
.
playRewardAd
(
"common_video"
,
"task_ad"
,
activity
,
new
ZXADVideoListener
()
{
@Override
public
void
onSuccess
()
{
}
@Override
public
void
onError
(
@Nullable
String
s
)
{
}
@Override
public
void
onAdShow
()
{
}
@Override
public
void
onAdVideoBarClick
()
{
}
@Override
public
void
onAdClose
()
{
getVideoAcceleratorsReceive
(
sid
);
AdManager
.
INSTANCE
.
loadNextCacheRewardVideoAd
(
"common_video"
,
activity
);
if
(
mWebView
!=
null
)
{
mWebView
.
loadUrl
(
"javascript:onResume()"
);
}
}
}
);
}
});
}
//看视频领上报
private
static
void
getVideoAcceleratorsReceive
(
int
sid
)
{
ApiClient
.
INSTANCE
.
getHomeDataApi
().
adVideoReport
()
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
new
BaseAdOberver
<
Response
<
Object
>>()
{
@Override
public
void
onSuccess
(
Response
<
Object
>
result
)
{
}
@Override
public
void
onFailure
(
Throwable
e
,
String
code
,
String
errorMsg
)
{
}
});
ApiClient
.
INSTANCE
.
getHomeDataApi
().
adWelfareVideoReport
(
sid
)
.
compose
(
RxSchedulers
.
observableIO2Main
())
.
subscribe
(
new
BaseAdOberver
<
Response
<
Object
>>()
{
@Override
public
void
onSuccess
(
Response
<
Object
>
result
)
{
}
@Override
public
void
onFailure
(
Throwable
e
,
String
code
,
String
errorMsg
)
{
}
});
}
public
static
void
jumpPage
(
String
pageName
)
{
public
static
void
jumpPage
(
String
pageName
)
{
switch
(
pageName
)
{
switch
(
pageName
)
{
case
"GuessFragment"
:
//猜歌
case
"GuessFragment"
:
//猜歌
...
...
library/src/main/res/layout/activity_new_web.xml
View file @
1bc7e205
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
android:id=
"@+id/tv_newweb_title"
android:id=
"@+id/tv_newweb_title"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"看4篇可得2
000金币
"
android:text=
"看4篇可得2
钻石
"
android:textColor=
"#ff222222"
android:textColor=
"#ff222222"
android:textSize=
"12sp"
android:textSize=
"12sp"
android:layout_marginBottom=
"8dp"
/>
android:layout_marginBottom=
"8dp"
/>
...
...
library/src/main/res/layout/dialog_sign_out_layout.xml
View file @
1bc7e205
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<RelativeLayout
<RelativeLayout
android:id=
"@+id/id_dialog_water_fail_layout"
android:id=
"@+id/id_dialog_water_fail_layout"
android:layout_width=
"310dp"
android:layout_width=
"310dp"
android:layout_height=
"230dp"
android:layout_height=
"230dp"
android:layout_marginTop=
"70dp"
android:layout_centerInParent=
"true"
android:layout_centerInParent=
"true"
android:layout_marginTop=
"70dp"
android:background=
"@drawable/shape_white_r10"
>
android:background=
"@drawable/shape_white_r10"
>
<ImageView
<ImageView
android:id=
"@+id/dialog_scratch_dialog_close_img"
android:id=
"@+id/dialog_scratch_dialog_close_img"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
android:layout_margin=
"16dp"
android:layout_margin=
"16dp"
android:src=
"@drawable/scratch_dialog_close_img"
/>
android:src=
"@drawable/receive_close"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"39dp"
android:text=
"温馨提示"
android:textColor=
"#333333"
android:textSize=
"22sp"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true
"
android:layout_marginTop=
"39dp
"
android:text=
"任务还未完成,现在退出将无法\n获得奖励,确认要退出么
"
android:text=
"温馨提示
"
android:gravity=
"center
"
android:textColor=
"#333333
"
android:textColor=
"#333333"
android:textSize=
"22sp"
/>
android:textSize=
"18sp"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
android:gravity=
"center"
android:text=
"任务还未完成,现在退出将无法\n获得奖励,确认要退出么"
android:textColor=
"#333333"
android:textSize=
"18sp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
android:layout_alignParentBottom=
"true"
android:layout_marginBottom=
"30dp"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/dialog_scratch_dialog_cancel"
android:id=
"@+id/dialog_scratch_dialog_cancel"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginLeft=
"15dp"
android:layout_marginBottom=
"30dp"
android:layout_marginRight=
"10dp"
android:layout_weight=
"1"
android:background=
"@drawable/dialog_sign_out_cancel_bg"
android:background=
"@drawable/dialog_sign_out_cancel_bg"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"仍要退出"
android:text=
"仍要退出"
android:layout_marginLeft=
"15dp"
android:textColor=
"#0090FF"
android:textColor=
"#0090FF"
android:textSize=
"19sp"
/>
android:textSize=
"19sp"
/>
<TextView
<TextView
android:id=
"@+id/dialog_scratch_dialog_bg"
android:id=
"@+id/dialog_scratch_dialog_bg"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginLeft=
"10dp"
android:layout_alignParentRight=
"true"
android:layout_marginBottom=
"30dp"
android:layout_marginRight=
"15dp"
android:layout_marginRight=
"15dp"
android:layout_weight=
"1"
android:background=
"@drawable/dialog_sign_out_conform_bg"
android:background=
"@drawable/dialog_sign_out_conform_bg"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"继续任务"
android:text=
"继续任务"
android:textColor=
"#FFFFFF"
android:textColor=
"#FFFFFF"
android:textSize=
"19sp"
/>
android:textSize=
"19sp"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
...
...
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