Commit e4db3f85 authored by Li's avatar Li

[李俊岐] 完善打卡提现和福利中心

parent 6cfd79f2
package com.ym.game.activity
import android.content.DialogInterface
import android.text.Html
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import com.bird.cc.id
import com.ym.ddcy.R
import com.ym.game.adapter.ClockInWithdrawAdpater
import com.ym.game.contract.ClockInWithdrawContract
import com.ym.game.presenter.ClockInWithdrawPresenter
import com.ym.game.view.MainDialog
import com.ym.library.Constant
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.ClockInWithdrawEntity
import com.ym.library.module.ExchangeEntity
import com.ym.library.net.BaseActivity
import com.ym.library.utils.CenterDialog
import kotlinx.android.synthetic.main.activity_clock_in_withdraw.*
......@@ -43,7 +45,11 @@ class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View,
recycler_clock_in?.adapter = mAdapter
}
override fun onItemClick(view: View, position: Int, data: ClockInWithdrawEntity.ClockInItemEntity) {
override fun onItemClick(
view: View,
position: Int,
data: ClockInWithdrawEntity.ClockInItemEntity
) {
mData = data
if (data.special == 1) {
mPresenter?.getFlyBoxReceive(this)
......@@ -55,10 +61,10 @@ class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View,
//任务列表结果
override fun clockInWithdrawListResult(result: ClockInWithdrawEntity?) {
if (result != null) {
Constant.videoNum = result?.videoNum?:20
Constant.videoNum = result?.videoNum ?: 20
tv_clock_in_days?.text =
Html.fromHtml("已连续打卡<font color=\"#8F2C0F\"><big>${result?.clockNum}</big></font>天")
Html.fromHtml("已连续打卡 <font color=\"#8F2C0F\"><big>${result?.clockNum}</big></font> 天")
tv_clock_in_info?.text = "每日观看${result?.videoNum}个视频即可完成打卡"
mAdapter?.clear()
......@@ -68,16 +74,18 @@ class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View,
}
//提现结果
override fun dowdResult(result: ClockInWithdrawEntity?) {
override fun dowdResult(result: ExchangeEntity?) {
mPresenter?.getClockInWithdrawList()
if (result != null) {
CenterDialog.showgetWaterDrop(
MainDialog?.showWithDraw(
this,
3,
mData?.cashStr?.toInt()!!,
DialogInterface.OnCancelListener {
},
result.status,
result.title,
result.reason,
result.buttonText,
result.buttonStatus,
null,
4,
null
)
}
......
......@@ -14,15 +14,13 @@ import com.ym.game.contract.WelfareContract
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.presenter.WelfarePresenter
import com.ym.game.view.MainDialog
import com.ym.library.listener.IAdVideoListener
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.*
import com.ym.library.net.BaseActivity
import com.ym.library.utils.ADConfig
import com.ym.library.utils.CenterDialog
import com.ym.library.utils.*
import com.ym.library.utils.EventUtils.loadNextCacheRewardVideoAd
import com.ym.library.utils.EventUtils.requestReport
import com.ym.library.utils.JumpUtils
import com.ym.library.utils.Utils
import kotlinx.android.synthetic.main.activity_welfare.*
class WelfareActivity : BaseActivity(), WelfareContract.View,
......@@ -97,7 +95,7 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
mDiamonList.clear()
tv_welfare_diamond_conut?.text = "集齐${result?.max}颗钻石可获得宝箱奖励"
tv_welfare_diamond_progress?.text =
Html.fromHtml(" : <font color=\"#FF5A44\">${result?.coins}</font>/${result?.max}")
Html.fromHtml("<font color=\"#FF5A44\">${result?.coins}</font>/${result?.max}")
var i = 0
while (i < 7) {
......@@ -136,6 +134,7 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
this,
3,
mData?.coins?.toInt()!!,
"welfare_task_receive",
DialogInterface.OnCancelListener {
},
......@@ -148,7 +147,6 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
override fun taskCashResult(result: List<FlyBoxEntity>?) {
mPresenter?.getDiamondList()
if (result != null && result.isNotEmpty()) {
CenterDialog.showGuideGetMoney(this,"0.3",null)
MainDialog.showWelfareOpenBox(this,result,object :IDialogViewCloseCallback {
override fun onCloseViewSuccess(isSuccess: Boolean) {
......@@ -158,6 +156,16 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
}
fun showAd(sId:Int) {
AdUtils.playRewardAd(this,"welfare_task",object : IAdVideoListener {
override fun onAdClose() {
mPresenter?.getWelfareVideoReport(sId)
}
override fun onError(errorMsg: String?) {
}
})
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"welfare_task",
......@@ -167,7 +175,7 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
override fun onAdShow() {}
override fun onAdVideoBarClick() {}
override fun onAdClose() {
mPresenter?.getWelfareVideoReport(sId)
requestReport()
loadNextCacheRewardVideoAd(this@WelfareActivity)
}
......
......@@ -10,6 +10,7 @@ import android.view.View
import android.view.ViewGroup
import android.widget.*
import androidx.recyclerview.widget.RecyclerView
import com.bird.cc.it
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.ddcy.R
......@@ -52,7 +53,7 @@ class ClockInWithdrawAdpater :
if (holder is ClockInWithdrawHolder) {
holder?.tvDayNum.text = "第${data?.needClockNum}天"
holder?.tvMoney.text =
Html.fromHtml("${data?.cashStr}<small><small>元</small></small>")
Html.fromHtml("可提现${data?.cashStr}元")
holder?.tvMoneyRedPg.text =
Html.fromHtml("${data?.cashStr}<small><small>元</small></small>")
......@@ -68,15 +69,15 @@ class ClockInWithdrawAdpater :
//普通任务
holder?.tvDayNum?.setTextColor(Color.parseColor("#ED7624"))
holder?.tvAdNum.text =
Html.fromHtml("<font color=\"#8C856F\"><small>还差 </small></font>${Constant.videoNum}<font color=\"#8C856F\"><small> 个视频完成打卡</small></font>")
Html.fromHtml("<font color=\"#8C856F\"><small>差 </small><</font>${Constant.videoNum}<font color=\"#8C856F\"><small> 个视频完成打卡</small></font>")
holder?.tvMoney?.visibility = View.GONE
if (data?.currentNum != null && data?.targetNum != null) {
if (data?.currentNum!! >= data?.targetNum!!) {
startAnimator(holder?.ivRightStatus)
}
}
// if (data?.currentNum != null && data?.targetNum != null) {
// if (data?.currentNum!! >= data?.targetNum!!) {
// startAnimator(holder?.ivRightStatus)
// }
// }
if (data.status == 2) {
//当天任务,已完成
......@@ -127,13 +128,32 @@ class ClockInWithdrawAdpater :
holder?.ivRedPgStatus?.setImageResource(R.drawable.icon_clock_in_item_red_pg_gray)
holder.ivRedPgStatus.clearAnimation()
holder?.ivRightStatus.clearAnimation()
} else if(data?.status == 8) {
holder?.layoutCenter.visibility = View.VISIBLE
holder?.ivRightStatus.visibility = View.VISIBLE
holder?.layoutProgress.visibility = View.VISIBLE
holder?.ivRedPgStatus.visibility = View.GONE
holder?.tvComplete.visibility = View.GONE
holder?.layoutRedPg.visibility = View.GONE
holder?.tvMoneyRedPg.visibility = View.GONE
holder?.ivBg?.setImageResource(R.drawable.icon_clock_in_item_bg)
holder?.ivRightStatus?.setImageResource(R.drawable.icon_clock_in_item_red_pg)
holder?.tvProgress.text = "${data?.currentNum}/${data?.targetNum}"
holder?.progressBar.max = data?.targetNum ?: 10
holder?.progressBar.progress = data?.currentNum ?: 0
holder.ivRedPgStatus.clearAnimation()
startAnimator(holder?.ivRightStatus)
}
}
2 -> {
//提现任务
holder?.ivBg?.setImageResource(R.drawable.icon_clock_in_item_yellow_bg)
holder?.tvAdNum.text =
Html.fromHtml("<font color=\"#8F2C0F\"><small>差 </small></font>${Constant.videoNum}<font color=\"#8F2C0F\"><small> 个视频完成打卡</small></font>")
Html.fromHtml("<font color=\"#8F2C0F\"><small>差 </small></font>${Constant.videoNum}<font color=\"#8F2C0F\"><small> 个视频完成打卡</small></font>")
if (data.status == 3 || data.status == 1) {
// 当天任务,未完成打卡
......@@ -181,7 +201,7 @@ class ClockInWithdrawAdpater :
}
3 -> {
holder?.tvAdNum.text =
Html.fromHtml("<font color=\"#8F2C0F\"><small>差 </small></font>${Constant.videoNum}<font color=\"#8F2C0F\"><small> 个视频完成打卡</small></font>")
Html.fromHtml("<font color=\"#8F2C0F\"><small>差 </small></font>${Constant.videoNum}<font color=\"#8F2C0F\"><small> 个视频完成打卡</small></font>")
holder?.tvDayNum?.setTextColor(Color.parseColor("#ffffff"))
holder?.ivRedPgStatus?.setImageResource(R.drawable.icon_clock_in_item_phone)
holder?.ivBg?.setImageResource(R.drawable.icon_clock_in_item_yellow_bg)
......@@ -202,11 +222,19 @@ class ClockInWithdrawAdpater :
}
holder?.itemView.setOnClickListener {
if (data.status == 7 || data?.status == 5 || data?.status == 3 || data?.status == 4) {
Utils.showToast(mContext, "快去完成打卡吧")
if (data?.status == 3 || data?.status == 4) {
if (data?.special == 1) {
Utils.showToast(mContext, "完成打卡可领取奖励")
} else if (data?.special == 2) {
Utils.showToast(mContext, "完成打卡可提现")
}
} else if (data.status == 6 || data.status == 2) {
Utils.showToast(mContext, "已提现")
} else if (data.status == 1 || data?.currentNum!! >= data?.targetNum!!) {
Utils.showToast(mContext, "已领取")
}
}
holder?.layoutRedPg.setOnClickListener {
if (data.status == 1 || data?.status == 8 || (data?.currentNum != null && data?.targetNum != null && data?.currentNum!! >= data?.targetNum!!)) {
listener?.onItemClick(it, position, mList[position])
}
}
......
package com.ym.piggybank.adapter
package com.ym.game.adapter
import android.view.LayoutInflater
import android.view.View
......@@ -6,10 +6,10 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.ym.ddcy.R
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.PuzzleEntity
import com.ym.modulecommon.AppliContext
import com.ym.modulecommon.base.BaseRecyclerAdapter
import com.ym.task.module.listener.OnRecycleItemClickListener
class PuzzleBottomAdapter : BaseRecyclerAdapter<PuzzleEntity.PuzzleData, RecyclerView.ViewHolder> {
......
......@@ -115,7 +115,7 @@ class SpeedWaterTaskAdapter :
adType = "高额"
}
MainDialog.showgetWaterDrop(mContext, 5, adType, data.awardNum, null)
MainDialog.showgetWaterDrop(mContext, 5, "task_accelerator", data.awardNum, null)
}
}
......
......@@ -130,7 +130,7 @@ class WateringTaskAdpater :
adType = "高额"
}
MainDialog.showgetWaterDrop(mContext, 4, adType, data.awardNum, null)
MainDialog.showgetWaterDrop(mContext, 4, "task_coins", data.awardNum, null)
}
}
......
......@@ -22,6 +22,7 @@ import com.ym.library.Constant
import com.ym.modulecommon.AppliContext
import com.ym.modulecommon.base.SplashResumeActivity
import com.ym.modulecommon.net.NetConfig
import com.ym.modulecommon.utils.LogUtils
import java.io.BufferedReader
import java.io.FileReader
import java.io.IOException
......@@ -55,8 +56,7 @@ class BaseApplication : MultiDexApplication() {
NetConfig.BASE_FEED_URL = "http://feedapitest2.zhangxinhulian.com/"
// Constant.appLs = "afcbef40e31631d3"//appls
AdManager.init(this,"afcbef40e31631d3")
LogUtils.getConfig().logSwitch = true
UMConfigure.setLogEnabled(true)
UMConfigure.init(this, "5f9bb48945b2b751a91fb2d5", "", UMConfigure.DEVICE_TYPE_PHONE, "")
PlatformConfig.setWeixin(Constant.WX_APPID, Constant.WX_APPKEY)
......
package com.ym.game.contract
import com.ym.library.module.ClockInWithdrawEntity
import com.ym.library.module.ExchangeEntity
class ClockInWithdrawContract {
interface View {
fun clockInWithdrawListResult(result: ClockInWithdrawEntity?)
fun dowdResult(result: ClockInWithdrawEntity?)
fun dowdResult(result: ExchangeEntity?)
}
interface Presenter {
......
package com.ym.game.listener;
/**
* Created by gaoleichao on 2018/12/3.
*/
public interface AdCallback<T> {
void onResult(int code, T result);
}
package com.ym.task.module.listener
//import com.qq.e.ads.nativ.NativeExpressADView
/**
* Created by gaoleichao on 2019/1/9
*/
interface OnGdtAdListener {
// fun onSuc(data: MutableList<NativeExpressADView>?)
fun onError()
fun onAdClick()
fun onAdExposure()
}
\ No newline at end of file
package com.ym.task.module.listener
/**
* Created by Antonio on 2019/5/8.
*/
import android.view.View
interface OnRecycleItemClickListener<T> {
fun onItemClick(view: View, position: Int, data: T)
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ import com.ym.game.contract.ClockInWithdrawContract
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.view.MainDialog
import com.ym.library.module.ClockInWithdrawEntity
import com.ym.library.module.ExchangeEntity
import com.ym.library.module.FlyBoxEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
......@@ -28,7 +29,7 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter {
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.dowdResult(null)
mView?.clockInWithdrawListResult(null)
}
})
}
......@@ -36,8 +37,8 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter {
override fun getDoWd(id:Int) {
GameApiClient.gameApi.getDoWd(id).compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<ClockInWithdrawEntity>() {
override fun onSuccess(result: ClockInWithdrawEntity?) {
).subscribe(object : BaseObserver<ExchangeEntity>() {
override fun onSuccess(result: ExchangeEntity?) {
mView?.dowdResult(result)
}
......@@ -49,7 +50,7 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter {
fun getFlyBoxReceive(activity: Activity) {
GameApiClient.gameApi.getopenBox()
GameApiClient.gameApi.geClockBoxReceive()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<FlyBoxEntity>() {
override fun onSuccess(result: FlyBoxEntity?) {
......
......@@ -9,6 +9,7 @@ import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.*
import com.bird.cc.it
import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.qq.e.ads.nativ.NativeExpressADView
import com.ym.admodule.config.AdManager
......@@ -24,7 +25,7 @@ import com.ym.library.utils.*
object MainDialog {
var adView:Any? = null
var adView: Any? = null
fun showBottomDialog(
layout: Int,
......@@ -34,7 +35,7 @@ object MainDialog {
gravity: Int
): View {
adView =null
adView = null
val mDialogView = View.inflate(activity, layout, null)
setHeadDialog.setContentView(mDialogView)
......@@ -73,19 +74,12 @@ object MainDialog {
)
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad2)
AdManager.loadFeedAd(
ADConfig.AD_IMG_FADE,
activity,
ZXADSizeConfig(
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 56,
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt()
),
layoutAd
)
AdUtils.showFeedAd(activity, "receive_redPack_double_click", layoutAd)
mDialog.setOnDismissListener(object :DialogInterface.OnDismissListener{
mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener {
override fun onDismiss(p0: DialogInterface?) {
onDestroy()
EventUtils.loadFeedCacheAdToCache(activity)
}
})
......@@ -185,15 +179,7 @@ object MainDialog {
}
}
// shwoAd(adType, context, layoutAd)
AdManager.loadFeedAd(
ADConfig.AD_IMG_FADE,
context,
ZXADSizeConfig(Utils.px2dip(PhoneUtils.getScreenWidth(context).toFloat()) - 56, 245),
layoutAd
)
AdUtils.showFeedAd(context, adType, layoutAd)
mDialogView.findViewById<TextView>(R.id.btn_get_drop_happy_accept).setOnClickListener {
mDialog.dismiss()
......@@ -202,9 +188,10 @@ object MainDialog {
mDialog.dismiss()
}
mDialog.setOnDismissListener(object :DialogInterface.OnDismissListener{
mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener {
override fun onDismiss(p0: DialogInterface?) {
onDestroy()
EventUtils.loadFeedCacheAdToCache(context)
}
})
......@@ -333,19 +320,13 @@ object MainDialog {
mDialog.dismiss()
mListener.onCloseViewSuccess(true)
}
AdManager.loadFeedAd(
ADConfig.AD_IMG_FADE,
(context as Activity),
ZXADSizeConfig(
Utils.px2dip(PhoneUtils.getScreenWidth(context).toFloat()) - 56,
((Utils.px2dip(context.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt()
),
layoutAd
)
mDialog.setOnDismissListener(object :DialogInterface.OnDismissListener{
AdUtils.showFeedAd((context as Activity), adType, layoutAd)
mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener {
override fun onDismiss(p0: DialogInterface?) {
onDestroy()
EventUtils.loadFeedCacheAdToCache(context)
}
})
......@@ -412,19 +393,13 @@ object MainDialog {
mDialog.dismiss()
mListener.onCloseViewSuccess(true)
}
AdManager.loadFeedAd(
ADConfig.AD_IMG_FADE,
(context as Activity),
ZXADSizeConfig(
Utils.px2dip(PhoneUtils.getScreenWidth(context).toFloat()) - 56,
((Utils.px2dip(context.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt()
),
layoutAd
)
mDialog.setOnDismissListener(object :DialogInterface.OnDismissListener{
AdUtils.showFeedAd((context as Activity), "welfare_openbox", layoutAd)
mDialog.setOnDismissListener(object : DialogInterface.OnDismissListener {
override fun onDismiss(p0: DialogInterface?) {
onDestroy()
EventUtils.loadFeedCacheAdToCache((context as Activity))
}
})
......@@ -441,9 +416,9 @@ object MainDialog {
reason: String,
buttonText: String,
buttonStatus: Int,
id: Int,
type: Int,
jine: Int
id: Int?,
type: Int?,
jine: Int?
) {
if (context == null) {
......@@ -471,6 +446,7 @@ object MainDialog {
} else if (type == 4) {
EventUtils.onEvent("show_fuli0.3", "福利0.3")
} else {
if (id != null) {
when (id) {
1 -> {
EventUtils.onEvent("show_baicai", "白菜" + jine)
......@@ -487,6 +463,7 @@ object MainDialog {
}
}
}
}
2 -> {
imgtitle.setImageResource(R.mipmap.img_duihuan_success)
imggoon.setImageResource(R.mipmap.img_go_on_make_money)
......@@ -505,6 +482,10 @@ object MainDialog {
imgtitle.setImageResource(R.mipmap.img_wenxin_trip)
imggoon.setImageResource(R.mipmap.img_go_zhongcai)
}
6 -> {
imgtitle.setImageResource(R.mipmap.img_wenxin_trip)
imggoon.setImageResource(R.mipmap.img_go_zhongcai)
}
}
......@@ -530,7 +511,7 @@ object MainDialog {
fun showActivityDesc(activity: Activity) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =showBottomDialog(
val mDialogView = showBottomDialog(
R.layout.dialog_activity_desc,
activity,
mDialog,
......@@ -544,11 +525,16 @@ object MainDialog {
mDialog?.setCancelable(false)
mDialog?.show()
}
// 获取碎片红包时的弹窗
fun showDialoggetPuzzle(activity: Activity?,diffCardsNum:Int ,onClickListener: View.OnClickListener){
fun showDialoggetPuzzle(
activity: Activity?,
diffCardsNum: Int,
onClickListener: View.OnClickListener
) {
if (activity == null) return
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =showBottomDialog(
val mDialogView = showBottomDialog(
R.layout.dialog_get_puzzle,
activity,
mDialog,
......@@ -591,10 +577,10 @@ object MainDialog {
fun onDestroy() {
if(adView!=null){
if(adView is NativeExpressADView){
if (adView != null) {
if (adView is NativeExpressADView) {
(adView as NativeExpressADView)?.destroy()
}else if(adView is TTNativeExpressAd ){
} else if (adView is TTNativeExpressAd) {
(adView as TTNativeExpressAd)?.destroy()
}
}
......
......@@ -26,13 +26,13 @@ import com.ym.game.contract.PuzzleContract
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.presenter.PuzzlePresenter
import com.ym.game.utils.CenterDialog
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.PuzzleEntity
import com.ym.library.rxbus.RxBusUtil
import com.ym.library.utils.Utils
import com.ym.modulecommon.AppliContext
import com.ym.piggybank.adapter.PuzzleBottomAdapter
import com.ym.game.adapter.PuzzleBottomAdapter
import com.ym.piggybank.adapter.PuzzleTopAdapter
import com.ym.task.module.listener.OnRecycleItemClickListener
object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEntity.PuzzleData> {
private var context: Context? = null
......@@ -140,7 +140,7 @@ object PuzzleDialog : PuzzleContract.View, OnRecycleItemClickListener<PuzzleEnti
rlredbg?.setBackgroundResource(R.color.transparent)
lottieView?.removeAllUpdateListeners()
MainDialog.showgetWaterDrop(context as Activity
, 4, "", mdata.winCoin, null)
, 4, "puzzle", mdata.winCoin, null)
}
......
......@@ -170,7 +170,7 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
tv_tomAwardNum?.text="${data.tomAwardNum}"
if (data.isPop == 1) {
//首次签到弹窗
MainDialog.showgetWaterDrop(mContext, 4, "签到", data.awardNum, null)
MainDialog.showgetWaterDrop(mContext, 4, "singin", data.awardNum, null)
RxBusUtil.getDefault().send(RxBusConstant.RX_MAIN_TURNTABLE_LOTTERYED)
}
}
......
......@@ -252,7 +252,7 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
if (type != 6) {
MainDialog.showgetWaterDrop(
context, type,
"转盘",
"lottery",
mLotteryResult?.awardNum ?: 0,
mLotteryResult?.extJson
)
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="#F7BD7C"
android:orientation="vertical">
<RelativeLayout
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="44dp"
android:layout_marginTop="33dp">
<ImageView
android:id="@+id/iv_clock_in_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_height="match_parent"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:src="@drawable/icon_clock_in_close" />
......@@ -23,7 +23,7 @@
<com.ym.game.wedget.MediumBoldTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerInParent="true"
android:text="打卡提现"
android:textColor="#7E320A"
android:textSize="20sp"
......@@ -38,7 +38,6 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center"
android:orientation="vertical">
......@@ -47,26 +46,27 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
tools:text="已连续打卡 天"
android:textColor="#ED7624"
android:textSize="26sp" />
android:textSize="26sp"
android:textStyle="bold"
tools:text="已连续打卡 天" />
<TextView
android:id="@+id/tv_clock_in_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="11dp"
android:layout_marginTop="4dp"
android:includeFontPadding="false"
tools:text="每日观看20个视频即可完成打卡"
android:textColor="#8F2C0F"
android:textSize="16sp" />
android:textSize="16sp"
tools:text="每日观看20个视频即可完成打卡" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_clock_in"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="22dp"
android:layout_marginTop="9dp"
android:layout_marginBottom="30dp" />
</LinearLayout>
......
......@@ -10,22 +10,25 @@
<RelativeLayout
android:id="@+id/layout_welfare_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="33dp">
android:layout_height="64dp"
android:background="#FF9E35">
<ImageView
android:id="@+id/iv_welfare_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentBottom="true"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingBottom="12dp"
android:src="@drawable/arrow_left" />
<com.ym.game.wedget.MediumBoldTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:paddingBottom="11dp"
android:text="福利中心"
android:textColor="@color/color_333333"
android:textSize="20sp"
......@@ -33,6 +36,15 @@
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/layout_welfare_title">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
......@@ -40,16 +52,12 @@
android:scaleType="fitXY"
android:src="@drawable/icon_welfare_bg" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/layout_welfare_title">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="80dp"
android:orientation="vertical">
<LinearLayout
......@@ -68,23 +76,26 @@
android:textSize="17sp" />
<ImageView
android:layout_width="19dp"
android:layout_height="17dp"
android:layout_marginRight="1dp"
android:src="@drawable/icon_welfare_diamond" />
android:layout_width="23dp"
android:layout_height="20dp"
android:layout_marginRight="4dp"
android:src="@drawable/icon_welfare_diamond2" />
<TextView
android:id="@+id/tv_welfare_diamond_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=": 3/6" />
android:includeFontPadding="false"
android:text="3/6"
android:textColor="@color/color_333333"
android:textSize="17sp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_welfare_diamond_reward"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_welfare_task"
......@@ -94,7 +105,8 @@
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
\ No newline at end of file
......@@ -27,7 +27,7 @@
android:layout_marginLeft="@dimen/dp_14"
android:text="第一天"
android:textColor="#ED7624"
android:textSize="16sp" />
android:textSize="14sp" />
<TextView
android:id="@+id/tv_clock_in_complete"
......@@ -56,7 +56,7 @@
android:includeFontPadding="false"
android:text="17"
android:textColor="#E91119"
android:textSize="20sp" />
android:textSize="18sp" />
<com.ym.game.wedget.MediumBoldTextView
android:id="@+id/tv_clock_in_item_money"
......@@ -67,7 +67,7 @@
android:includeFontPadding="false"
android:text="0.3元"
android:textColor="#E91119"
android:textSize="22sp"
android:textSize="18sp"
android:visibility="visible" />
<RelativeLayout
......@@ -93,9 +93,9 @@
android:layout_centerHorizontal="true"
android:includeFontPadding="false"
android:text="3/20"
android:textStyle="bold"
android:textColor="#A43D14"
android:textSize="10sp" />
android:textSize="10sp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
......@@ -140,22 +140,24 @@
<FrameLayout
android:id="@+id/layout_tip"
android:layout_width="match_parent"
android:layout_height="21dp"
android:layout_height="wrap_content"
android:layout_below="@+id/layout_clock_in_item_root"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:visibility="gone">
android:visibility="visible">
<com.ym.game.wedget.MediumBoldTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:background="@drawable/shape_ffffff_r10"
android:gravity="center"
android:includeFontPadding="false"
android:text="完成当前打卡,可解锁下一天打卡任务"
android:textColor="#8F2C0F"
android:textSize="15sp" />
android:textSize="12sp" />
</FrameLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -16,6 +16,8 @@
android:id="@+id/iv_item_dotted_line"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginLeft="0.5dp"
android:layout_marginRight="0.5dp"
android:layout_weight="1"
android:scaleType="fitXY"
android:src="@drawable/icon_item_dotted_line" />
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="66dp"
android:layout_marginBottom="12dp"
android:background="@drawable/shape_fefce2_r8"
android:paddingLeft="@dimen/dp_14">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
<com.ym.game.wedget.MediumBoldTextView
android:id="@+id/tv_welfare_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:includeFontPadding="false"
android:text="浇水10次"
android:textColor="@color/color_333333"
android:textSize="18sp"
android:textStyle="bold" />
android:textSize="17sp" />
<TextView
android:id="@+id/tv_welfare_item_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_welfare_item_title"
android:layout_marginTop="2dp"
android:layout_marginTop="6dp"
android:includeFontPadding="false"
android:text="浏览60秒领取奖励"
android:textColor="#975423"
android:textSize="14sp" />
android:textSize="13sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_marginRight="14dp"
android:layout_marginBottom="5dp"
android:gravity="center_horizontal"
android:gravity="center_vertical|center_horizontal"
android:orientation="vertical">
<LinearLayout
......@@ -48,7 +47,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="7dp"
android:gravity="center">
<ImageView
......@@ -69,8 +67,8 @@
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="86dp"
android:layout_height="34dp"
android:layout_marginTop="3dp">
<ImageView
......@@ -81,9 +79,9 @@
<TextView
android:id="@+id/tv_welfare_item_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:layout_width="match_parent"
android:layout_height="30dp"
android:gravity="center"
android:includeFontPadding="false"
android:text="已领取"
android:textColor="@color/white"
......
......@@ -67,7 +67,7 @@ dependencies {
api ("com.bx:adsdk:1.3.3"){
exclude group: 'com.google.code.gson'
}
api 'com.ym.admodule:admodule:1.0.2.2'
api 'com.ym.admodule:admodule:1.0.2.7'
api 'com.airbnb.android:lottie:3.1.0'
/* api 'androidx.appcompat:appcompat:1.2.0-alpha02'
api 'com.android.support:design:28.0.0'
......
......@@ -926,6 +926,7 @@ abstract class JavaInterface {
act,
type,
waterDropCount,
"web_task",
DialogInterface.OnCancelListener {
mWebView.context.runOnUiThread {
mWebView?.loadUrl("javascript:onResume()")
......@@ -943,7 +944,7 @@ abstract class JavaInterface {
fun showWithdrawSucces(cashStr: String) {
mWebView.context.runOnUiThread {
if(act!=null){
CenterDialog.showGuideGetMoney(act,cashStr,mWebView)
CenterDialog.showGuideGetMoney(act,"提现成功",cashStr,mWebView)
}
}
}
......
......@@ -185,11 +185,14 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
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("")) {
tv_newweb_title.text = "${title.split(" ")[0]}"
} else {
tv_newweb_title.text = "看4篇可得2000金币"
tv_newweb_title.text = "看4篇可得2钻石"
}
if (num == 0) {
id_read_round_1.setBackgroundResource(R.drawable.shape_c9c9c9_r)
......@@ -362,7 +365,7 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
if (webview != null) {
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)
}
......@@ -371,7 +374,7 @@ class NewWebActivity : BaseActivity(), NewWebContract.View, ScrollWebView.OnScro
RxBusUtil.getDefault()
.send(RxBusConstant.RX_SPEED_WATER_TASK_LIST)
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) {
// webview?.loadUrl("javascript:onPause()")
}
......
......@@ -420,13 +420,13 @@ class WebActivity : BaseActivity(), View.OnClickListener {
if (webview != null) {
webview?.loadUrl("javascript:onResume()")
}
EventUtils.onEvent("page_status", Utils.obj2Str(
ReportEntity(
Constant.ReportSessionId,
"WebActivity",
"onResume"
)
))
// EventUtils.onEvent("page_status", Utils.obj2Str(
// ReportEntity(
// Constant.ReportSessionId,
// "WebActivity",
// "onResume"
// )
// ))
MobclickAgent.onResume(this)
}
......@@ -437,13 +437,13 @@ class WebActivity : BaseActivity(), View.OnClickListener {
}
RxTimerUtil.cancel()
status = INIT
EventUtils.onEvent("page_status", Utils.obj2Str(
ReportEntity(
Constant.ReportSessionId,
"WebActivity",
"onPause"
)
))
// EventUtils.onEvent("page_status", Utils.obj2Str(
// ReportEntity(
// Constant.ReportSessionId,
// "WebActivity",
// "onPause"
// )
// ))
MobclickAgent.onPause(this)
RxBusUtil.getDefault()
.send(RxBusConstant.RX_SPEED_WATER_TASK_LIST)
......
......@@ -266,13 +266,13 @@ class XiaoManActivity : BaseActivity() {
override fun onResume() {
super.onResume()
EventUtils.onEvent("page_status", Utils.obj2Str(ReportEntity(Constant.ReportSessionId, "XiaoManActivity", "onResume")))
// EventUtils.onEvent("page_status", Utils.obj2Str(ReportEntity(Constant.ReportSessionId, "XiaoManActivity", "onResume")))
MobclickAgent.onResume(this)
}
override fun onPause() {
super.onPause()
EventUtils.onEvent("page_status", Utils.obj2Str(ReportEntity(Constant.ReportSessionId, "XiaoManActivity", "onPause")))
// EventUtils.onEvent("page_status", Utils.obj2Str(ReportEntity(Constant.ReportSessionId, "XiaoManActivity", "onPause")))
MobclickAgent.onPause(this)
}
......
......@@ -38,7 +38,7 @@ class NewWebContract {
fun setBottomDesc(desc: String)
fun setCurrentNum(num: Int,title: String)
fun setCurrentNum(award: Int,num: Int,title: String)
fun setBottomVisibity(visibility: Int)
......
......@@ -187,7 +187,7 @@ class NewWebPresenter : NewWebContract.Presenter {
// mView.setBottomProgressVisibity(View.VISIBLE)
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) {
//加金币
......
package com.ym.library.listener
interface IAdVideoListener {
fun onAdClose()
fun onError(errorMsg: String?)
}
\ No newline at end of file
......@@ -14,4 +14,5 @@ class AdStatusEntity {
var time_trigger: Int? = 0
var progressStatus: Int? = 0
var current_nums: Int? = 0
var award_limit: Int? = 0
}
\ No newline at end of file
......@@ -6,6 +6,9 @@ class ClockInWithdrawEntity {
var videoNum: Int? = 0
var list: List<ClockInItemEntity>? = null
var status:Int? = 0
var reason:String = ""
class ClockInItemEntity {
var id: Int? = 0//提现id
var title: String? = ""//打卡标题
......
......@@ -20,7 +20,12 @@ import androidx.annotation.Nullable;
import com.gyf.immersionbar.ImmersionBar;
import com.gyf.immersionbar.OnNavigationBarListener;
import com.trello.rxlifecycle2.components.support.RxAppCompatActivity;
import com.umeng.analytics.MobclickAgent;
import com.ym.library.Constant;
import com.ym.library.module.ReportEntity;
import com.ym.library.rxbus.RxBusUtil;
import com.ym.library.utils.EventUtils;
import com.ym.library.utils.Utils;
/**
* Created by gaoleichao on 2019/4/17
......@@ -30,6 +35,13 @@ public abstract class BaseActivity extends RxAppCompatActivity {
public abstract int layoutID();
// public abstract Context context();
public Activity activity(){
return this;
}
public String className() {
return activity().getClass().getSimpleName();
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
......@@ -73,6 +85,30 @@ public abstract class BaseActivity extends RxAppCompatActivity {
// protected WeakHandler baseHandler;
protected boolean mIsNeedGoneNavigationBar = false;
@Override
protected void onResume() {
super.onResume();
if (activity() != null) {
MobclickAgent.onResume(activity());
}
if (className() != null) {
Log.d("BaseActivity","onResume =" + className());
EventUtils.INSTANCE.onEvent("page_status", Utils.obj2Str(new ReportEntity(Constant.ReportSessionId, className(), "onResume")));
}
}
@Override
protected void onPause() {
super.onPause();
if (className() != null) {
Log.d("BaseActivity","onPause =" + className());
EventUtils.INSTANCE.onEvent("page_status", Utils.obj2Str(new ReportEntity(Constant.ReportSessionId, className(), "onPause")));
}
if (activity() != null) {
MobclickAgent.onPause(activity());
}
}
/**
* 设置是否隐藏导航栏
......
......@@ -151,6 +151,12 @@ interface IGameApi {
@POST(NetConfig.Game.URL_GAME_OPEN_BOX)
fun getopenBox(): Observable<Response<FlyBoxEntity>>
/**
* 打卡普通打卡任务领取
*/
@POST(NetConfig.Game.URL_CLOCK_BOX_RECEIVE)
fun geClockBoxReceive(): Observable<Response<FlyBoxEntity>>
/**
* 底部拆红包奖励
* @param
......@@ -263,7 +269,7 @@ interface IGameApi {
//打卡提现
@POST(NetConfig.Game.URL_GAME_DO_WD)
fun getDoWd(@Query("clockId") clockId:Int): Observable<Response<ClockInWithdrawEntity>>
fun getDoWd(@Query("clockId") clockId:Int): Observable<Response<ExchangeEntity>>
/**
* 任务页列表
......
......@@ -268,5 +268,6 @@ public class NetConfig {
public static final String URL_COLLECT_CARD_ADV_PUT_OR_ADD = "app/v1/collect-card/advPutOrAdd";//看广告单个图片获取或者拼图
public static final String URL_COLLECT_CARD_ADD_CARD = "app/v1/collect-card/addCard";//收金币获得卡片
public static final String URL_GAME_HOME_WD_LIST = "app/v1/game/ddcy/home_wd_list";//首页展示果实列表
public static final String URL_CLOCK_BOX_RECEIVE = "app/v1/game/ddcy/clock_box_receive";//打卡普通打卡任务领取
}
}
package com.ym.library.utils
import android.app.Activity
import android.util.Log
import android.widget.FrameLayout
import com.ym.admodule.config.AdManager
import com.ym.admodule.config.ZXADSizeConfig
import com.ym.admodule.listener.ZXADVideoListener
import com.ym.library.listener.IAdVideoListener
import com.ym.library.module.StatusEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
import java.lang.Exception
object AdUtils {
fun playRewardAd(activity: Activity,actionName:String,listener:IAdVideoListener) {
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
actionName,
activity,
object : ZXADVideoListener {
override fun onSuccess() {}
override fun onAdClose() {
listener?.onAdClose()
//预加载
EventUtils.loadNextCacheRewardVideoAd(activity)
//看视频上报
getVideoAcceleratorsReceive();
}
override fun onAdShow() {}
override fun onAdVideoBarClick() {}
override fun onError(errorMsg: String?) {
listener?.onError(errorMsg)
}
})
}
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),
activity,
view)
} catch (e:Exception) {}
}
//看视频领上报
fun getVideoAcceleratorsReceive() {
GameApiClient.gameApi.adVideoReport()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity?) {
Log.d("wxw", "看视频上报 Success")
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
Log.d("wxw", "看视频上报 error")
}
})
}
}
\ No newline at end of file
......@@ -75,7 +75,7 @@ object CenterDialog : BaseDialog() {
/**
* 获得微信红包
*/
fun showGuideGetMoney(activity: Activity?, cashStr: String, webView: WebView?) {
fun showGuideGetMoney(activity: Activity?,title:String, cashStr: String, webView: WebView?) {
if (activity == null) {
return
}
......@@ -89,7 +89,9 @@ object CenterDialog : BaseDialog() {
Gravity.CENTER
)
val tv_money = mDialogView?.findViewById<TextView>(R.id.id_tv_cash_content)
val tvTitle = mDialogView?.findViewById<TextView>(R.id.id_tv_title)
tv_money.text = "恭喜您成功兑换${cashStr}元红包,您可以前往微信钱包查看到账情况"
tvTitle.text = title
mDialogView.findViewById<TextView>(R.id.id_tv_go_on_make_money).setOnClickListener {
webView?.loadUrl("javascript:onResume()")
......@@ -367,6 +369,7 @@ object CenterDialog : BaseDialog() {
context: Activity?,
type: Int,
rewardCount: Int,
actionName:String,
listener: DialogInterface.OnCancelListener,
mWebView: WebView?
) {
......@@ -390,38 +393,7 @@ object CenterDialog : BaseDialog() {
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_ad)
tvGetDropCount.text = "+${rewardCount}"
AdManager.loadFeedAd(
ADConfig.AD_IMG_FADE,
(context as Activity),
ZXADSizeConfig(
Utils.px2dip(PhoneUtils.getScreenWidth(context).toFloat()) - 56,
((Utils.px2dip(context.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt()
),
layoutAd
)
// ToponManager.loadNative((context as Activity),layoutAd,object : ToponNativeListener {
// override fun onAdImpressed(atAdInf: ATAdInfo) {
// EventUtils.onEvent(
// "ad_show",
// Utils.obj2Str(AdEntity(atAdInf.adNetworkType, AdID.mPlacementId_daily_task_finish_bigimage, "福利中心大图广告"))
// )
// }
//
// override fun onAdClicked(atAdInf: ATAdInfo, view: ATNativeAdView) {
// EventUtils.onEvent(
// "ad_click",
// Utils.obj2Str(AdEntity(atAdInf.adNetworkType, AdID.mPlacementId_daily_task_finish_bigimage, "福利中心大图广告"))
// )
// }
//
// override fun onAdVideoStart() {
// }
//
// override fun onAdVideoEnd() {
// }
//
// },AdID.mPlacementId_Reward_video_luck_farm)
AdUtils.showFeedAd(context,actionName,layoutAd)
mDialogView.findViewById<TextView>(R.id.btn_get_diamand).setOnClickListener {
// mWebView?.loadUrl("javascript:onResume()")
......@@ -434,6 +406,7 @@ object CenterDialog : BaseDialog() {
mDialog?.setOnCancelListener {
listener.onCancel(it)
EventUtils.loadFeedCacheAdToCache(context)
}
mDialog?.setCanceledOnTouchOutside(false)
......
......@@ -5,6 +5,7 @@ import android.app.Activity
import android.util.Log
import com.umeng.analytics.MobclickAgent
import com.ym.admodule.config.AdManager
import com.ym.admodule.config.ZXADSizeConfig
import com.ym.library.module.NewsEntity
import com.ym.library.module.StatusEntity
import com.ym.library.net.*
......@@ -319,10 +320,18 @@ 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()
......
......@@ -74,7 +74,7 @@
android:id="@+id/tv_newweb_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="看4篇可得2000金币"
android:text="看4篇可得2钻石"
android:textColor="#ff222222"
android:textSize="12sp"
android:layout_marginBottom="8dp"/>
......
......@@ -27,7 +27,7 @@ class SettingActivity : BaseActivity() {
StatusBarUtil.transportStatus(this, resources.getColor(R.color.transparent))
}
private var adView:Any? = null
private var adView: Any? = null
override fun init() {
......@@ -77,16 +77,7 @@ class SettingActivity : BaseActivity() {
updateVersionManager?.checkUpdate(true)
}
AdManager.loadFeedAd(
ADConfig.AD_IMG_FADE,
this,
ZXADSizeConfig(
Utils.px2dip(PhoneUtils.getScreenWidth(this).toFloat()) - 58,
((Utils.px2dip(windowManager?.defaultDisplay?.width!!.toFloat()) - 58) * 0.66).toInt()
),
id_ad_frame_view
)
AdUtils.showFeedAd(this,"setting",id_ad_frame_view)
}
private fun copy() {
......@@ -113,14 +104,17 @@ class SettingActivity : BaseActivity() {
override fun onPause() {
super.onPause()
MobclickAgent.onPause(this)
EventUtils.loadFeedCacheAdToCache(this)
}
override fun onDestroy() {
super.onDestroy()
if(adView!=null){
if(adView is NativeExpressADView){
if (adView != null) {
if (adView is NativeExpressADView) {
(adView as NativeExpressADView)?.destroy()
}else if(adView is TTNativeExpressAd ){
} else if (adView is TTNativeExpressAd) {
(adView as TTNativeExpressAd)?.destroy()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment