Commit 2c6d6a1d authored by Li's avatar Li

[李俊岐] 添加打卡提现和福利中心

parent 56e65833
......@@ -161,5 +161,8 @@ dependencies {
implementation project(path: ':userinfo')
implementation project(path: ':game')
implementation project(':library')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.constraintlayout:constraintlayout:2.0.3'
}
......@@ -23,15 +23,42 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:icon, android:label,android:theme">
<activity
android:name="com.ym.game.activity.WelfareActivity"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="welfare"
android:scheme="ddcy" />
</intent-filter>
</activity>
<activity
android:name="com.ym.game.activity.ClockInWithdrawActitivy"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="clockinwithdraw"
android:scheme="ddcy" />
</intent-filter>
</activity>
<meta-data
android:name="android.max_aspect"
android:value="2.4" />
<!--适配华为(huawei)刘海屏-->
android:value="2.4" /> <!-- 适配华为(huawei)刘海屏 -->
<meta-data
android:name="android.notch_support"
android:value="true" />
<!--适配小米(xiaomi)刘海屏-->
android:value="true" /> <!-- 适配小米(xiaomi)刘海屏 -->
<meta-data
android:name="notch.config"
android:value="portrait|landscape" />
......@@ -46,7 +73,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.ym.game.notif.NotificationService"/>
<service android:name="com.ym.game.notif.NotificationService" />
<activity
android:name="com.ym.game.activity.WxLoginActivity"
......@@ -54,23 +82,18 @@
<activity
android:name="com.ym.game.GameActivity"
android:exported="true"
android:launchMode="singleTask" />
<!--友盟配置-->
android:launchMode="singleTask" /> <!-- 友盟配置 -->
<meta-data
android:name="UMENG_APPKEY"
android:value="5f9bb48945b2b751a91fb2d5" />
<meta-data
android:name="UMENG_CHANNEL"
android:value="${UMENG_CHANNEL_VALUE}" />
<!--微信配置-->
android:value="${UMENG_CHANNEL_VALUE}" /> <!-- 微信配置 -->
<activity
android:name=".wxapi.WXEntryActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:exported="true"
android:theme="@android:style/Theme.Translucent.NoTitleBar" />
</application>
</manifest>
\ No newline at end of file
{
"slotIds": {},
"h5_url": {
"cate": "http://www.baidu.com",
"aboutUs": "http://newspool.huolea.com/sspapiNovel/su/custom/guazixiaoshuoapp/aboutMe.html",
"agreement": "http://newspool.huolea.com/sspapiNovel/su/custom/guazixiaoshuoapp/privacy.html",
"big_award": "http://app-h5.zhangxinzhixun.com/NovelCheckAwards",
"change_detail": "https://app-h5.zhangxinzhixun.com/WithDrawRecords",
"welfareCenterUrl": "http://app-h5.zhangxinzhixun.com/CheckInV7Walking",
"glod_detail": "https://app-h5.zhangxinzhixun.com/GoldDetail",
"awardHelpUrl": "https://app-h5.zhangxinzhixun.com/com.ym.garden/awardHelp",
"help": "http://newspool.huolea.com/sspapiNovel/su/custom/guazixiaoshuoapp/help.html",
"coinUrl": "https://app-h5.zhangxinzhixun.com/goldV7",
"inviteUrl": "https://app-h5.zhangxinzhixun.com/InviteFriendsWalking2",
"super_team": "https://app-h5.zhangxinzhixun.com/team",
"newHelpUS": "https://app-h5.zhangxinzhixun.com/novelHelp",
"matters_need": "https://app-h5.zhangxinzhixun.com/WarningTitle"
},
"global_config": {
"home_signin": 0,
"ad_sdk_cfg": {
"gdt": {
"app_name": "",
"ad_id": 141,
"slot_cfg": {},
"app_id": ""
},
"jrtt": {
"app_name": "",
"ad_id": 118,
"slot_cfg": {
"bubble_popup_video": {
"key": "922986229"
},
"exciting_video": {
"key": "922986041"
},
"bubble_popup": {
"key": "922986229"
},
"signin_popup": {
"key": "922986229"
},
"signin_popup_video": {
"key": "922986229"
}
},
"app_id": ""
}
},
"force_login": 0
},
"lua": "",
"check": 1,
"switch": {},
"md5": "a5adff92353f772db544b8c389c5e0d2"
}
\ No newline at end of file
......@@ -16,17 +16,15 @@ import com.ym.admodule.config.AdManager
import com.ym.admodule.listener.ZXADVideoListener
import com.ym.game.activity.WxLoginActivity
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.module.*
import com.ym.game.net.GameApiClient
import com.ym.game.notif.NotificationService
import com.ym.game.view.*
import com.ym.modulecommon.AppliContext
import com.ym.library.Constant
import com.ym.library.down.UpdateVersionManager
import com.ym.library.module.NewsEntity
import com.ym.library.module.ReportEntity
import com.ym.library.module.*
import com.ym.library.net.ApiClient
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
import com.ym.library.utils.*
import com.ym.modulecommon.module.UserInfoEntity
......@@ -86,7 +84,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
}
openNotif()
AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_REWARD_VIDIO,this)
EventUtils.loadNextCacheRewardVideoAd(this)
}
override fun onDestroy() {
......@@ -190,8 +188,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
*/
fun oneveryDayWelfareClick() {
Log.d("wxw", "每日福利")
JumpUtils.h5Jump("每日福利", Constant.Param.WelfareCenter, false, act)
// JumpUtils.h5Jump("每日福利", Constant.Param.WelfareCenter, false, act)
JumpUtils.jumpWelfareActivity()
}
/**
......@@ -199,7 +197,8 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
*/
fun clockInMakeMoney() {
Log.d("wxw", "打卡提现")
JumpUtils.h5Jump("打卡提现", Constant.Param.PunchRecord, false, act)
// JumpUtils.h5Jump("打卡提现", Constant.Param.PunchRecord, false, act)
JumpUtils.jumpClockInWithdrawActivity()
}
/**
......@@ -257,8 +256,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun adFlyBox() {
if (flyBoxIsClick) {
flyBoxIsClick = false
AdManager.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"box_click",
this,
object : ZXADVideoListener {
override fun onSuccess() {
......@@ -296,8 +296,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun adRedPackPlan() {
if (flyBoxIsClick2) {
flyBoxIsClick2 = false
AdManager.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"bottom_open_red_envelope_click",
this,
object : ZXADVideoListener {
......@@ -430,9 +431,10 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
View.OnClickListener {
GameEvent("click_receive_redPack_double", "点击六倍领取")
Log.d("wxw", "签到翻倍广告点击")
AdManager.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
act,
"receive_redPack_double_click",
this@GameActivity,
object : ZXADVideoListener {
override fun onSuccess() {}
......@@ -496,8 +498,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
Log.d("wxw", "云朵加速")
if (cloudIsClick) {
cloudIsClick = false
AdManager.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"cloud_acceleration_click",
this,
object : ZXADVideoListener {
override fun onAdClose() {
......@@ -673,8 +676,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun getVideoSeedReceive(callback: IUnitySendMessageCallback?, id: Int) {
if (videoSeedClick) {
videoSeedClick = false
AdManager.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"receive_seed_click",
this,
object : ZXADVideoListener {
......@@ -742,8 +746,9 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
fun getVideoAcceleratorsReceive(callback: IUnitySendMessageCallback?, id: Int) {
if (videoJiasuClick) {
videoJiasuClick = false
AdManager.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"accelerator_receive_click",
this,
object : ZXADVideoListener {
override fun onSuccess() {
......@@ -809,6 +814,7 @@ class GameActivity : UnityPlayerActivity(), IDialogViewCloseCallback {
//看视频领上报
fun getVideoAcceleratorsReceive() {
EventUtils.loadNextCacheRewardVideoAd(this)
GameApiClient.gameApi.adVideoReport()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
......
package com.ym.game.activity
import androidx.recyclerview.widget.LinearLayoutManager
import com.ym.ddcy.R
import com.ym.game.contract.ClockInWithdrawContract
import com.ym.game.presenter.ClockInWithdrawPresenter
import com.ym.library.module.ClockInWithdrawEntity
import com.ym.library.net.BaseActivity
import kotlinx.android.synthetic.main.activity_clock_in_withdraw.*
//打卡提现 福利
class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View {
private var mPresenter: ClockInWithdrawPresenter? = null
override fun layoutID(): Int {
return R.layout.activity_clock_in_withdraw
}
override fun init() {
mPresenter = ClockInWithdrawPresenter(this)
iv_clock_in_close?.setOnClickListener {
finish()
}
initAdapter()
mPresenter?.getClockInWithdrawList()
}
private fun initAdapter() {
recycler_clock_in.layoutManager = LinearLayoutManager(this)
}
override fun clockInWithdrawListResult(result: ClockInWithdrawEntity?) {
}
override fun dowdResult(result: ClockInWithdrawEntity?) {
}
}
\ No newline at end of file
package com.ym.game.activity
import android.content.DialogInterface
import android.text.Html
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.ym.admodule.config.AdManager
import com.ym.admodule.listener.ZXADVideoListener
import com.ym.ddcy.R
import com.ym.game.adapter.WelfareDiamondAdapter
import com.ym.game.adapter.WelfareTaskAdpater
import com.ym.game.contract.WelfareContract
import com.ym.game.presenter.WelfarePresenter
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.DiamondEntity
import com.ym.library.module.NewsEntity
import com.ym.library.module.TaskCompleteEntity
import com.ym.library.module.TaskListEntity
import com.ym.library.net.BaseActivity
import com.ym.library.utils.ADConfig
import com.ym.library.utils.CenterDialog
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,
OnRecycleItemClickListener<NewsEntity> {
private var mPresenter: WelfarePresenter? = null
private var diamonAdapter: WelfareDiamondAdapter? = null
private var taskAdapter: WelfareTaskAdpater? = null
private var mDiamonList: MutableList<DiamondEntity> = ArrayList()
private var mData: NewsEntity? = null
override fun layoutID(): Int {
return R.layout.activity_welfare
}
override fun init() {
mPresenter = WelfarePresenter(this)
iv_welfare_close?.setOnClickListener {
finish()
}
initAdapter()
request()
}
private fun request() {
mPresenter?.getDiamondList()
mPresenter?.getTaskList()
}
private fun initAdapter() {
diamonAdapter = WelfareDiamondAdapter(this,object :OnRecycleItemClickListener<DiamondEntity> {
override fun onItemClick(view: View, position: Int, data: DiamondEntity) {
}
})
recycler_welfare_diamond_reward?.layoutManager = GridLayoutManager(this, 7)
recycler_welfare_diamond_reward?.adapter = diamonAdapter
taskAdapter = WelfareTaskAdpater(this, this)
recycler_welfare_task.layoutManager = LinearLayoutManager(this)
recycler_welfare_task?.adapter = taskAdapter
}
override fun onItemClick(view: View, position: Int, data: NewsEntity) {
mData = data
//0未完成 1已领取 2可领取
when (data.status) {
0 -> {
if (data.opentype == NewsEntity.AD_TYPE_SDK) {
if (data.sid != null) {
showAd(data.sid)
}
} else {
JumpUtils.adJump(data, this)
}
}
1 -> {
Utils.showToast(this, "已领取")
}
2 -> {
mPresenter?.getTaskReceiveList(data?.sid)
}
}
}
//钻石列表结果
override fun diamondListResult(result: DiamondEntity?) {
if (result != null) {
mDiamonList.clear()
tv_welfare_diamond_conut?.text = "集齐${result?.max}颗钻石可获得宝箱奖励"
tv_welfare_diamond_progress?.text =
Html.fromHtml(" : <font color=\"#FF5A44\">${result?.coins}</font>/${result?.max}")
var i = 0
while (i < 7) {
var data = DiamondEntity()
data.coins = result.coins
data.max = result.max
if (i < result?.coins!!) {
data.show = 1
} else {
data.show = 0
}
mDiamonList.add(data)
i++
}
diamonAdapter?.clear()
diamonAdapter?.appendToList(mDiamonList)
diamonAdapter?.notifyDataSetChanged()
}
}
//任务列表结果
override fun taskListResult(result: TaskListEntity?) {
if (result != null) {
taskAdapter?.clear()
taskAdapter?.appendToList(result?.userTask!!)
taskAdapter?.notifyDataSetChanged()
}
}
//任务领取结果
override fun taskReceiveListResult(result: TaskCompleteEntity?) {
request()
if (result != null) {
CenterDialog.showgetWaterDrop(
this,
3,
mData?.coins?.toInt()!!,
DialogInterface.OnCancelListener {
},
null
)
}
}
//提现结果
override fun taskCashResult(result: NewsEntity?) {
if (result != null) {
CenterDialog.showGuideGetMoney(this,"0.3",null)
}
}
fun showAd(sId:Int) {
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"welfare_task",
this, object : ZXADVideoListener {
override fun onSuccess() {}
override fun onError(s: String?) {}
override fun onAdShow() {}
override fun onAdVideoBarClick() {}
override fun onAdClose() {
mPresenter?.getWelfareVideoReport(sId)
requestReport()
loadNextCacheRewardVideoAd(this@WelfareActivity)
}
})
}
private var isPause = false
override fun onResume() {
super.onResume()
if (isPause) {
request()
isPause = false
}
}
override fun onPause() {
super.onPause()
isPause = true
}
}
\ No newline at end of file
......@@ -14,12 +14,12 @@ import android.widget.ProgressBar
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.ym.ddcy.R
import com.ym.game.module.ExchangeEntity
import com.ym.game.module.WithDrawEntity
import com.ym.game.net.GameApiClient
import com.ym.library.module.WithDrawEntity2
import com.ym.game.view.MainDialog
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.library.module.ExchangeEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.RxBusUtil
......@@ -28,7 +28,7 @@ import com.ym.library.utils.Utils
import com.ym.modulecommon.AppliContext
class CashExchangeAdapter :
BaseRecyclerAdapter<WithDrawEntity.WdList, CashExchangeAdapter.ViewHolder> {
BaseRecyclerAdapter<WithDrawEntity2.WdList, CashExchangeAdapter.ViewHolder> {
private var mContext: Context? = null
constructor(
......
package com.ym.game.adapter
import android.app.Activity
import android.view.LayoutInflater
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.library.utils.Utils
import com.ym.ddcy.R
import com.ym.library.module.ClockInWithdrawEntity
import com.ym.library.module.NewsEntity
import com.ym.library.module.TaskListEntity
/**
*Craeted by ${junqi.li}
*Craeted by 2020/9/18
*/
class ClockInWithdrawAdpater :
BaseRecyclerAdapter<ClockInWithdrawEntity, RecyclerView.ViewHolder> {
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<ClockInWithdrawEntity>
private val TYPE_ONE = 1
private val TYPE_TWO = 2
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<ClockInWithdrawEntity>
) : super() {
this.listener = listener
mContext = content
}
override fun getItemViewType(position: Int): Int {
return mList[position].type ?: 0
}
override fun getItemCount(): Int {
return mList.size
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if (mList.size > 0) {
val data = mList[position]
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == TYPE_ONE) {
return ClockInWithdrawHolder(
LayoutInflater.from(mContext).inflate(R.layout.item_clock_in_withdraw, parent, false)
)
}
return ClockInTipHolder(
LayoutInflater.from(mContext).inflate(R.layout.item_clock_in_tip, parent, false)
)
}
inner class ClockInWithdrawHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
}
inner class ClockInTipHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
}
}
\ No newline at end of file
......@@ -7,9 +7,9 @@ import android.view.ViewGroup
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.ym.ddcy.R
import com.ym.game.module.WdHistoryEntity
import com.ym.modulecommon.AppliContext
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.library.module.WdHistoryEntity
class RecordAdapter : BaseRecyclerAdapter<WdHistoryEntity, RecordAdapter.ViewHolder> {
private var mContext: Context? = null
......
......@@ -6,19 +6,11 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import btmsdkobf.el
import com.ym.game.module.SinginEntity
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.ddcy.R
import com.ym.modulecommon.AppliContext
import com.ym.library.utils.PhoneUtils
import com.ym.library.utils.Utils
import org.apache.poi.hslf.model.Line
import kotlin.math.log
import com.ym.library.module.SinginEntity
/**
*Craeted by ${junqi.li}
......
......@@ -8,8 +8,6 @@ import android.view.ViewGroup
import android.widget.*
import androidx.recyclerview.widget.RecyclerView
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.game.module.WateringTaskEntity
import com.ym.game.net.GameApiClient
import com.ym.game.view.MainDialog
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.library.net.BaseObserver
......@@ -19,6 +17,8 @@ import com.ym.library.rxbus.RxBusUtil
import com.ym.library.utils.LogUtils
import com.ym.library.utils.Utils
import com.ym.ddcy.R
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.GameApiClient
class SpeedWaterTaskAdapter :
BaseRecyclerAdapter<WateringTaskEntity, SpeedWaterTaskAdapter.WateringTaskHolder> {
......
......@@ -8,8 +8,6 @@ import android.view.ViewGroup
import android.widget.*
import androidx.recyclerview.widget.RecyclerView
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.game.module.WateringTaskEntity
import com.ym.game.net.GameApiClient
import com.ym.game.view.MainDialog
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.library.net.BaseObserver
......@@ -19,6 +17,8 @@ import com.ym.library.rxbus.RxBusUtil
import com.ym.library.utils.LogUtils
import com.ym.library.utils.Utils
import com.ym.ddcy.R
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.GameApiClient
/**
*Craeted by ${junqi.li}
......
package com.ym.game.adapter
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.content.Context
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.ym.ddcy.R
import com.ym.library.base.BaseRecyclerAdapter
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.DiamondEntity
import com.ym.library.module.NewsEntity
/**
*Craeted by ${junqi.li}
*Craeted by 2020/9/18
*/
class WelfareDiamondAdapter :
BaseRecyclerAdapter<DiamondEntity, WelfareDiamondAdapter.ViewHolder> {
private var mContext: Context? = null
private val listener: OnRecycleItemClickListener<DiamondEntity>
constructor(
content: Context?, listener: OnRecycleItemClickListener<DiamondEntity>
) : super() {
this.listener = listener
mContext = content
}
override fun getItemCount(): Int {
return mList.size
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
if (mList.size > 0) {
val data = mList[position]
if (data.show == 1) {
holder?.ivStatus.setImageResource(R.drawable.icon_item_welfare_diamond)
} else {
holder?.ivStatus.setImageResource(R.drawable.icon_item_welfare_diamond_gray)
}
if (position == mList.size - 1) {
if (data.coins!! >= data.max!!) {
holder?.ivStatus.setImageResource(R.drawable.icon_welfare_box_open)
val oa: ObjectAnimator = ObjectAnimator.ofFloat(
holder.ivStatus,
View.ROTATION,
0F, 30F, -25F, 0F, 0F, 0F, 0F, 0F, 0F
)
oa.repeatCount = ValueAnimator.INFINITE
oa.setDuration(2000).start()
} else {
holder?.ivStatus.clearAnimation()
holder?.ivStatus.setImageResource(R.drawable.icon_welfare_box_close)
}
holder?.ivDottedLine.visibility = View.GONE
} else {
holder?.ivDottedLine.visibility = View.VISIBLE
}
holder?.itemView?.setOnClickListener {
listener?.onItemClick(it,position,mList[position])
}
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
LayoutInflater.from(mContext).inflate(R.layout.item_welfare_diamond, parent, false)
)
}
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val ivStatus: ImageView = itemView.findViewById(R.id.iv_item_diamond_status)
val ivDottedLine: ImageView = itemView.findViewById(R.id.iv_item_dotted_line)
}
}
\ No newline at end of file
package com.ym.game.adapter
import android.app.Activity
import android.view.LayoutInflater
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.library.utils.Utils
import com.ym.ddcy.R
import com.ym.library.module.NewsEntity
import com.ym.library.module.TaskListEntity
/**
*Craeted by ${junqi.li}
*Craeted by 2020/9/18
*/
class WelfareTaskAdpater :
BaseRecyclerAdapter<NewsEntity, WelfareTaskAdpater.WelfareTaskHolder> {
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<NewsEntity>
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<NewsEntity>
) : super() {
this.listener = listener
mContext = content
}
override fun getItemCount(): Int {
return mList.size
}
override fun onBindViewHolder(holder: WelfareTaskHolder, position: Int) {
if (mList.size > 0) {
val data = mList[position]
holder.tvTitle.text = data.title
holder.tvCount.text = "+${data.coins}"
holder.tvSubtitle.text = data.description
holder.ivStatus.setOnClickListener {
if (Utils.isFastClick()) {
listener.onItemClick(it, position, mList[position])
}
}
holder?.itemView?.setOnClickListener {
listener.onItemClick(it, position, mList[position])
}
// 0未完成 1已领取 2可领取
when (data.status) {
0 -> {
holder.ivStatus.setImageResource(R.drawable.icon_item_welfare_task_complete)
holder?.tvStatus.text = "去完成"
}
1 -> {
holder.ivStatus.setImageResource(R.drawable.icon_item_welfare_task_receiveed)
holder?.tvStatus.text = "已领取"
}
2 -> {
holder.ivStatus.setImageResource(R.drawable.icon_item_welfare_task_receive)
holder?.tvStatus.text = "立即领取"
}
}
}
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): WelfareTaskHolder {
return WelfareTaskHolder(
LayoutInflater.from(mContext).inflate(R.layout.item_welfare_task, parent, false)
)
}
inner class WelfareTaskHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
val tvTitle: TextView = itemView.findViewById(R.id.tv_welfare_item_title)
val tvSubtitle: TextView = itemView.findViewById(R.id.tv_welfare_item_subtitle)
val tvCount: TextView = itemView.findViewById(R.id.tv_welfare_item_count)
val tvStatus: TextView = itemView.findViewById(R.id.tv_welfare_item_status)
val ivStatus: ImageView = itemView.findViewById(R.id.iv_welfare_item_status)
}
}
\ No newline at end of file
package com.ym.game.contract
import com.ym.game.module.WithDrawEntity
import com.ym.library.module.WithDrawEntity2
class CashExchangeContract {
interface View {
fun WithDrawListResult(result: WithDrawEntity)
fun WithDrawListResult(result: WithDrawEntity2)
fun dowdResult()
}
......
package com.ym.game.contract
import com.ym.library.module.ClockInWithdrawEntity
class ClockInWithdrawContract {
interface View {
fun clockInWithdrawListResult(result: ClockInWithdrawEntity?)
fun dowdResult(result: ClockInWithdrawEntity?)
}
interface Presenter {
fun getClockInWithdrawList()
fun getDoWd()
}
}
\ No newline at end of file
package com.ym.game.contract
import com.ym.game.module.WdHistoryEntity
import com.ym.library.module.WdHistoryEntity
class RecordContract {
......
package com.ym.game.contract
import com.ym.game.module.WateringTaskEntity
import com.ym.library.module.WateringTaskEntity
class SpeedWaterContract {
......
package com.ym.game.contract
import com.ym.game.module.TurntableEntity
import com.ym.library.module.TurntableEntity
/**
*Craeted by ${junqi.li}
......
package com.ym.game.contract
import com.ym.game.module.SinginEntity
import com.ym.game.module.WateringTaskEntity
import com.ym.library.module.SinginEntity
import com.ym.library.module.WateringTaskEntity
/**
*Craeted by ${junqi.li}
......
package com.ym.game.contract
import com.ym.library.module.DiamondEntity
import com.ym.library.module.NewsEntity
import com.ym.library.module.TaskCompleteEntity
import com.ym.library.module.TaskListEntity
class WelfareContract {
interface View {
fun diamondListResult(result: DiamondEntity?)
fun taskListResult(result: TaskListEntity?)
fun taskReceiveListResult(result: TaskCompleteEntity?)
fun taskCashResult(result: NewsEntity?)
}
interface Presenter {
fun getDiamondList()
fun getTaskList()
fun getTaskReceiveList(sid: Int)
fun getWelfareVideoReport(sid: Int)
fun getTaskCash()
}
}
\ No newline at end of file
package com.ym.game.presenter
import com.ym.game.contract.CashExchangeContract
import com.ym.game.module.WithDrawEntity
import com.ym.game.net.GameApiClient
import com.ym.library.module.WithDrawEntity2
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
class CashExchangePresenter : CashExchangeContract.Presenter {
......@@ -17,8 +17,8 @@ class CashExchangePresenter : CashExchangeContract.Presenter {
override fun getWithDrawList() {
GameApiClient.gameApi.getWithDrawList().compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<WithDrawEntity>() {
override fun onSuccess(result: WithDrawEntity?) {
).subscribe(object : BaseObserver<WithDrawEntity2>() {
override fun onSuccess(result: WithDrawEntity2?) {
if (result != null) {
mView?.WithDrawListResult(result)
}
......
package com.ym.game.presenter
import com.ym.game.contract.ClockInWithdrawContract
import com.ym.game.contract.RecordContract
import com.ym.library.module.ClockInWithdrawEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter {
var mView: ClockInWithdrawContract.View
constructor(mView: ClockInWithdrawContract.View) {
this.mView = mView
}
override fun getClockInWithdrawList() {
GameApiClient.gameApi.getClockList().compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<ClockInWithdrawEntity>() {
override fun onSuccess(result: ClockInWithdrawEntity?) {
mView?.clockInWithdrawListResult(result)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.dowdResult(null)
}
})
}
override fun getDoWd() {
GameApiClient.gameApi.getDoWd().compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<ClockInWithdrawEntity>() {
override fun onSuccess(result: ClockInWithdrawEntity?) {
mView?.dowdResult(result)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.dowdResult(null)
}
})
}
}
\ No newline at end of file
package com.ym.game.presenter
import com.ym.game.contract.RecordContract
import com.ym.game.module.WdHistoryEntity
import com.ym.game.net.GameApiClient
import com.ym.library.module.WdHistoryEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
class RecordPresenter : RecordContract.Presenter {
......
package com.ym.game.presenter
import com.ym.game.contract.SpeedWaterContract
import com.ym.game.module.WateringTaskEntity
import com.ym.game.net.GameApiClient
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
class SpeedWaterPresenter : SpeedWaterContract.Presenter {
......
package com.ym.game.presenter
import com.ym.game.contract.TurntableContract
import com.ym.game.module.TurntableEntity
import com.ym.game.net.GameApiClient
import com.ym.library.module.TurntableEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
......
package com.ym.game.presenter
import com.ym.game.contract.WateringRewardContract
import com.ym.game.module.SinginEntity
import com.ym.game.module.WateringTaskEntity
import com.ym.game.net.GameApiClient
import com.ym.library.module.SinginEntity
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
import com.ym.library.utils.LogUtils
......
package com.ym.game.presenter
import com.ym.game.contract.WelfareContract
import com.ym.library.module.DiamondEntity
import com.ym.library.module.NewsEntity
import com.ym.library.module.TaskCompleteEntity
import com.ym.library.module.TaskListEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers
class WelfarePresenter : WelfareContract.Presenter {
var mView: WelfareContract.View
constructor(mView: WelfareContract.View) {
this.mView = mView
}
override fun getDiamondList() {
GameApiClient.gameApi.getTaskProcess().compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<DiamondEntity>() {
override fun onSuccess(result: DiamondEntity?) {
mView?.diamondListResult(result)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.diamondListResult(null)
}
})
}
override fun getTaskList() {
GameApiClient.gameApi.getTaskListInfo("welfare_center_task_list").compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<TaskListEntity>() {
override fun onSuccess(result: TaskListEntity?) {
mView?.taskListResult(result)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.taskListResult(null)
}
})
}
override fun getTaskReceiveList(sid: Int) {
GameApiClient.gameApi.getTaskComplete(sid).compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<TaskCompleteEntity>() {
override fun onSuccess(result: TaskCompleteEntity?) {
mView?.taskReceiveListResult(result)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.taskReceiveListResult(null)
}
})
}
override fun getWelfareVideoReport(sid: Int) {
GameApiClient.gameApi.getWelfareVideoReport(sid).compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<NewsEntity>() {
override fun onSuccess(result: NewsEntity?) {
getTaskList()
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.taskListResult(null)
}
})
}
override fun getTaskCash() {
GameApiClient.gameApi.getTaskCash().compose(
RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<NewsEntity>() {
override fun onSuccess(result: NewsEntity?) {
mView?.taskCashResult(result)
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
mView?.taskCashResult(null)
}
})
}
}
\ No newline at end of file
package com.ym.game.view
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog
import android.content.Context
import android.view.Gravity
......@@ -11,7 +10,7 @@ import androidx.recyclerview.widget.RecyclerView
import com.ym.game.adapter.CashExchangeAdapter
import com.ym.game.contract.CashExchangeContract
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.module.WithDrawEntity
import com.ym.library.module.WithDrawEntity2
import com.ym.game.presenter.CashExchangePresenter
import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.RxBusUtil
......@@ -82,7 +81,7 @@ object CashExchangeDialog : CashExchangeContract.View {
}
override fun WithDrawListResult(result: WithDrawEntity) {
override fun WithDrawListResult(result: WithDrawEntity2) {
cashExchangeAdapter?.clear()
cashExchangeAdapter?.appendToList(result.wdList)
cashExchangeAdapter?.notifyDataSetChanged()
......
......@@ -7,11 +7,10 @@ import android.widget.ImageView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.ym.ddcy.R
import com.ym.game.adapter.CashExchangeAdapter
import com.ym.game.adapter.RecordAdapter
import com.ym.game.contract.RecordContract
import com.ym.game.module.WdHistoryEntity
import com.ym.game.presenter.RecordPresenter
import com.ym.library.module.WdHistoryEntity
import com.ym.library.rxbus.RxBusUtil
//兑换记录弹窗
......
......@@ -14,11 +14,11 @@ import com.qq.e.ads.nativ.NativeExpressADView
import com.ym.admodule.config.AdManager
import com.ym.admodule.config.ZXADSizeConfig
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.module.FlyBoxEntity
import com.ym.game.module.TurntableEntity
import com.ym.modulecommon.AppliContext
import com.ym.ddcy.R
import com.ym.library.Constant
import com.ym.library.module.FlyBoxEntity
import com.ym.library.module.TurntableEntity
import com.ym.library.utils.*
object MainDialog {
......
......@@ -18,10 +18,6 @@ import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.adapter.SigninDropsAdapter
import com.ym.game.adapter.WateringTaskAdpater
import com.ym.game.contract.WateringRewardContract
import com.ym.game.module.SinginEntity
import com.ym.game.module.StatusEntity
import com.ym.game.module.WateringTaskEntity
import com.ym.game.net.GameApiClient
import com.ym.game.presenter.WateringRewardPresenter
import com.ym.library.Constant
import com.ym.library.module.NewsEntity
......@@ -36,6 +32,10 @@ import com.ym.library.utils.EventUtils
import com.ym.library.utils.JumpUtils
import com.ym.library.utils.LogUtils
import com.ym.ddcy.R
import com.ym.library.module.SinginEntity
import com.ym.library.module.StatusEntity
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.GameApiClient
/**
*Craeted by ${junqi.li}
......@@ -129,56 +129,9 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
}
4 -> {
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.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"receive_coin_task",
(mContext as Activity),
object : ZXADVideoListener {
override fun onAdClose() {
......@@ -276,6 +229,7 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
//看视频领上报
fun getVideoAcceleratorsReceive2() {
EventUtils.loadNextCacheRewardVideoAd(mContext!!)
GameApiClient.gameApi.adVideoReport()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
......
......@@ -16,8 +16,6 @@ import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.game.adapter.SpeedWaterTaskAdapter
import com.ym.game.contract.SpeedWaterContract
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.module.WateringTaskEntity
import com.ym.game.net.GameApiClient
import com.ym.game.presenter.SpeedWaterPresenter
import com.ym.library.Constant
import com.ym.library.module.NewsEntity
......@@ -32,6 +30,8 @@ import com.ym.library.utils.EventUtils
import com.ym.library.utils.JumpUtils
import com.ym.library.utils.Utils
import com.ym.ddcy.R
import com.ym.library.module.WateringTaskEntity
import com.ym.library.net.GameApiClient
class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
OnRecycleItemClickListener<WateringTaskEntity> {
......@@ -101,8 +101,9 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
}
4 -> {
EventUtils.onEvent("click_jiasuji_task_video_btn", "领加速剂任务视频")
AdManager.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"accelerator_task",
(mContext as Activity),
object : ZXADVideoListener {
override fun onAdClose() {
......@@ -180,6 +181,7 @@ class SpeedWaterPopupWindow : PopupWindow(), SpeedWaterContract.View,
//看视频领上报
fun getVideoAcceleratorsReceive2(id:Int) {
EventUtils.loadNextCacheRewardVideoAd(mContext!!)
GameApiClient.gameApi.thirdParty(id)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<Any>() {
......
......@@ -15,11 +15,7 @@ import com.ym.admodule.config.AdManager
import com.ym.admodule.listener.ZXADVideoListener
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.contract.TurntableContract
import com.ym.game.module.StatusEntity
import com.ym.game.module.TurntableEntity
import com.ym.game.net.GameApiClient
import com.ym.game.presenter.TurntablePresenter
import com.ym.library.module.NewsEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.RxSchedulers
import com.ym.library.rxbus.RxBusConstant
......@@ -31,6 +27,9 @@ import com.ym.library.utils.EventUtils
import com.ym.library.utils.LogUtils
import com.ym.library.utils.Utils
import com.ym.ddcy.R
import com.ym.library.module.StatusEntity
import com.ym.library.module.TurntableEntity
import com.ym.library.net.GameApiClient
/**
......@@ -132,63 +131,9 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
}
private fun showAd() {
// ToponManager.loadReward((context 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) {
// reset()
// btnTurntableLottery?.isEnabled = false
// isStartAnim = true
// isUpdate = true
// mPresenter?.getTurntableLotteryResult()
// }
//
// override fun onRewardedVideoAdFailed(errorCode: AdError) {
// reset()
// btnTurntableLottery?.isEnabled = false
// isStartAnim = true
// isUpdate = true
// mPresenter?.getTurntableLotteryResult()
//
// }
//
// 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.loadRewardVideoAd(
AdManager.playRewardAd(
ADConfig.AD_REWARD_VIDIO,
"turntable_lottery",
(context as Activity),
object : ZXADVideoListener {
override fun onAdClose() {
......
package com.ym.game.wedget;
import android.content.Context;
import android.graphics.Typeface;
import android.util.AttributeSet;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
/**
* Craeted by ${junqi.li}
* Craeted by 2020/9/4
* 带有“方正粗圆简体”的样式
*/
public class FontTextView extends AppCompatTextView {
public FontTextView(Context context) {
this(context, null);
}
public FontTextView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public FontTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
Typeface typeface = Typeface.createFromAsset(context.getAssets(), "fonts/founder_thick_round_simplified.ttf");
setTypeface(typeface);
}
}
package com.ym.game.wedget;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.text.TextPaint;
import android.util.AttributeSet;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
/**
* 中粗体
*/
public class MediumBoldTextView extends AppCompatTextView {
public MediumBoldTextView(Context context) {
super(context);
}
public MediumBoldTextView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public MediumBoldTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@Override
protected void onDraw(Canvas canvas) {
//获取当前控件的画笔
TextPaint paint = getPaint();
//设置画笔的描边宽度值
paint.setStrokeWidth(1.0f);
paint.setStyle(Paint.Style.FILL_AND_STROKE);
super.onDraw(canvas);
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#fefce2"/>
<corners android:radius="8dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F7BD7C"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
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:paddingLeft="12dp"
android:paddingRight="12dp"
android:src="@drawable/icon_clock_in_close" />
<com.ym.game.wedget.MediumBoldTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="打卡提现"
android:textColor="#7E320A"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_clock_in_days"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:text="已连续打卡 天"
android:textColor="#ED7624"
android:textSize="26sp" />
<TextView
android:id="@+id/tv_clock_in_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="11dp"
android:includeFontPadding="false"
android:text="每日观看20个视频即可完成打卡"
android:textColor="#8F2C0F"
android:textSize="16sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_clock_in"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="22dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="30dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F7BD7C"
tools:context="com.ym.game.activity.WelfareActivity">
<RelativeLayout
android:id="@+id/layout_welfare_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="33dp">
<ImageView
android:id="@+id/iv_welfare_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:src="@drawable/arrow_left" />
<com.ym.game.wedget.MediumBoldTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="福利中心"
android:textColor="@color/color_333333"
android:textSize="20sp"
android:textStyle="bold" />
</RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
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_marginLeft="10dp"
android:layout_marginRight="10dp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="23dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_welfare_diamond_conut"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="集齐5颗钻石可获得宝箱奖励"
android:textColor="@color/color_333333"
android:textSize="17sp" />
<ImageView
android:layout_width="19dp"
android:layout_height="17dp"
android:layout_marginRight="1dp"
android:src="@drawable/icon_welfare_diamond" />
<TextView
android:id="@+id/tv_welfare_diamond_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=": 3/6" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_welfare_diamond_reward"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_welfare_task"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</RelativeLayout>
\ No newline at end of file
......@@ -67,6 +67,7 @@
android:id="@+id/id_tv_cash_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:lineSpacingExtra="@dimen/dp_10"
android:text="恭喜您成功兑换0.3元红包,您可以前往微信钱包查看到账情况"
android:textColor="#6A231A"
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</FrameLayout>
\ No newline at end of file
<?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">
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="8dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_item_diamond_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_item_welfare_diamond_gray" />
<ImageView
android:id="@+id/iv_item_dotted_line"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:scaleType="fitXY"
android:src="@drawable/icon_item_dotted_line" />
</LinearLayout>
\ No newline at end of file
<?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_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:orientation="vertical">
<TextView
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" />
<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:includeFontPadding="false"
android:text="浏览60秒领取奖励"
android:textColor="#975423"
android:textSize="14sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="14dp"
android:layout_marginBottom="5dp"
android:gravity="center_horizontal"
android:orientation="vertical">
<LinearLayout
android:id="@+id/id_ll_right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="7dp"
android:gravity="center">
<ImageView
android:id="@+id/img_icon_item"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/dp_3"
android:src="@drawable/icon_welfare_diamond" />
<TextView
android:id="@+id/tv_welfare_item_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="+0g"
android:textColor="#FF5A44"
android:textSize="15sp"
android:textStyle="bold" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp">
<ImageView
android:id="@+id/iv_welfare_item_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_item_welfare_task_receiveed" />
<TextView
android:id="@+id/tv_welfare_item_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:includeFontPadding="false"
android:text="已领取"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
package com.ym.library
import android.content.Context
import android.text.TextUtils
import android.util.Log
import com.ym.library.utils.LogUtils
import com.ym.library.utils.Utils
import com.ym.modulecommon.utils.PhoneUtils
import com.ym.modulecommon.utils.SettingPreference
import org.jetbrains.anko.doAsync
import java.lang.Exception
/**
* Created by gaoleichao on 2018/7/12.
*/
class Config {
companion object {
fun init(context: Context) {
doAsync {
try {
if (TextUtils.isEmpty(SettingPreference.getUid())) {
SettingPreference.setUid(SettingPreference.getUid())
}
SettingPreference.setModel(PhoneUtils.getModel())
SettingPreference.setAndroidId(PhoneUtils.getAndroidID(context))
SettingPreference.setCarrier(PhoneUtils.getOperator(context))
SettingPreference.setW(PhoneUtils.getScreenWidth(context).toString())
SettingPreference.setH(PhoneUtils.getScreenHeight(context).toString())
SettingPreference.setDevice(PhoneUtils.getDeviceId(context))
SettingPreference.setImei(PhoneUtils.getImei(context))
SettingPreference.setSsid(PhoneUtils.getBSSID(context))
SettingPreference.setImsi(PhoneUtils.getIMSI(context))
SettingPreference.setMac(PhoneUtils.getMac(context))
// SettingPreference.setEnv(CesCore.getInstance().Ckwork(PhoneUtils.getAndroidID(context)))
SettingPreference.setVC(PhoneUtils.getAppVersionCode(context).toString())
SettingPreference.setVN(PhoneUtils.getAppVersionName(context))
SettingPreference.setNTT(PhoneUtils.getNetworkType(context).toString())
SettingPreference.setMac(PhoneUtils.getMac(context))
SettingPreference.setIp(PhoneUtils.getIPAddress(false))
SettingPreference.setSource(Utils.getChannel(context))
SettingPreference.setSVN(""+android.os.Build.VERSION.SDK_INT)
}catch (e:Exception){}
// LogUtils.d("Param", "Param.svn: " + Constant.Param.svn)
// LogUtils.d("Param", "Param.vendor: " + Constant.Param.vendor)
// LogUtils.d("Param", "Param.uid: " + SettingPreference.getUid())
// LogUtils.d("Param", "Param.androidId: " + SettingPreference.getAndroidId())
// Log.d("Param","getAndroidId:"+SettingPreference.getAndroidId())
// LogUtils.d("Param", "Param.carrier: " + SettingPreference.getCarrier())
// LogUtils.d("Param", "Param.w: " + SettingPreference.getW())
// LogUtils.d("Param", "Param.h: " + SettingPreference.getH())
// LogUtils.d("Param", "Param.model: " + SettingPreference.getModel())
// LogUtils.d("Param", "Param.vc: " + SettingPreference.getVC())
// Log.d("Param", "Param.device: " + SettingPreference.getDevice())
// LogUtils.d("Param", "Param.imei: " + SettingPreference.getImei())
// LogUtils.d("Param", "Param.mac: " + SettingPreference.getMac())
// LogUtils.d("Param", "Param.ntt: " + SettingPreference.getNTT())
// LogUtils.d("Param", "Param.imsi: " + SettingPreference.getImsi())
// LogUtils.d("Param", "Param.env: " + SettingPreference.getEnv())
}
}
}
}
\ No newline at end of file
package com.ym.library.module
class ClockInWithdrawEntity {
var type:Int? = 0
}
\ No newline at end of file
package com.ym.library.module
class DiamondEntity {
var max: Int? = 0
var coins: Int? = 0
var show: Int? = 0
}
\ No newline at end of file
package com.ym.game.module
package com.ym.library.module
class FlyBoxEntity {
var type: Int? = 0
......
package com.ym.game.module
package com.ym.library.module
class RankReceiveEntity {
var awardCents: Int = 0
......
package com.ym.game.module;
package com.ym.library.module;
import com.google.gson.annotations.SerializedName;
......
package com.ym.library.module
class TaskCompleteEntity {
var msg: String? = ""
var ore: Int? = 0
var recode: Int? = 0
var cents: Int? = 0
var taskId: Int? = 0
}
\ No newline at end of file
......@@ -47,4 +47,6 @@ public class TaskEntity implements Serializable {
public int task_type = 2;
public int appmodel_id;
public int opentype;
}
package com.ym.game.module
package com.ym.library.module
class WithDrawEntity {
class WithDrawEntity2 {
var wdList: MutableList<WdList> = ArrayList()
class WdList {
......
package com.ym.game.net
package com.ym.library.net
import android.text.TextUtils
import com.ym.library.Constant
......
package com.ym.game.net
package com.ym.library.net
import com.ym.game.module.*
import com.ym.library.net.NetConfig
import com.ym.library.net.Response
import com.ym.library.module.*
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.POST
......@@ -231,7 +229,7 @@ interface IGameApi {
兑换列表
*/
@GET(NetConfig.Game.URL_GAME_WITHDRAW_LIST)
fun getWithDrawList(): Observable<Response<WithDrawEntity>>
fun getWithDrawList(): Observable<Response<WithDrawEntity2>>
/*
兑换
......@@ -258,4 +256,44 @@ interface IGameApi {
//新手判断
@GET(NetConfig.Game.URL_GAME_USER_GUIDE)
fun getGuide(): Observable<Response<GuideEntity>>
//打卡提现列表
@GET(NetConfig.Game.URL_GAME_CLOCK_LIST)
fun getClockList(): Observable<Response<ClockInWithdrawEntity>>
//打卡提现
@GET(NetConfig.Game.URL_GAME_DO_WD)
fun getDoWd(): Observable<Response<ClockInWithdrawEntity>>
/**
* 任务页列表
*/
@GET(NetConfig.Task.TASK_URL)
fun getTaskListInfo(@Query("slotName") slotName: String): Observable<Response<TaskListEntity>>
/**
* 任务页列表
*/
@POST(NetConfig.Task.TASK_COMPLETE_TASK)
fun getTaskComplete(@Query("id") sid: Int): Observable<Response<TaskCompleteEntity>>
/**
* 任务页列表
*/
@GET(NetConfig.Game.URL_GAME_TASK_PROCESS)
fun getTaskProcess(): Observable<Response<DiamondEntity>>
/**
* 看视频任务
*/
@POST(NetConfig.Game.URL_GAME_WELFARE_VIDEO_REPORT)
fun getWelfareVideoReport(@Query("sid") sid: Int): Observable<Response<NewsEntity>>
/**
* 福利提现
*/
@POST(NetConfig.Game.URL_GAME_TASK_CASH)
fun getTaskCash(): Observable<Response<NewsEntity>>
}
\ No newline at end of file
......@@ -96,6 +96,7 @@ public class NetConfig {
public static final String URL_TASK_SIGNIN = "app/v4/sign/signIn";//任务页签到
public static final String URL_TASK_SIGNINDOUBLING = "app/v2/common/award/doublingAward";//任务页签到翻倍
public static final String TASK_URL = "app/v2/novel/taskListWithStat";//任务列表
public static final String TASK_COMPLETE_TASK = "app/v1/game/complete-task";//任务领取
public static final String URL_TASK_COMMON = "app/v2/common/award";//任务页加金币
public static final String URL_TASK_BUBBLELIST = "app/v1/step/bubbleListV2";//任务页悬浮金币
public static final String URL_TASK_BEGINNEW = "app/v1/task/beginNewUserTask";//任务签到提醒
......@@ -253,5 +254,12 @@ public class NetConfig {
public static final String URL_GAME_OPEN_PLANT_BOX = "app/v1/game/ddcy/open_plant_box";//底部拆红包
public static final String URL_GAME_CLOCK_LIST = "app/v1/game/clock_list";//打卡提现列表
public static final String URL_GAME_DO_WD = "app/v1/game/ddcy/do_wd";//打卡提现
public static final String URL_GAME_TASK_PROCESS = "app/v1/game/task_process";//福利中心钻石进度
public static final String URL_GAME_WELFARE_VIDEO_REPORT = "app/v1/game/welfare_video_report";//福利中心看视频任务
public static final String URL_GAME_TASK_CASH = "app/v1/game/task_cash";//福利中心提现
}
}
......@@ -3,7 +3,6 @@ package com.ym.library.net
import android.app.Activity
import android.os.Build
import android.text.TextUtils
import com.ym.library.Config
import com.ym.library.Constant
import com.ym.library.utils.*
import com.ym.modulecommon.AppliContext
......@@ -117,7 +116,6 @@ class SplashPresenter : SplashContract.Presenter {
private fun initConfig(mNovelInitEntity: NovelInitEntity) {
EventUtils.onEvent("SplashPresenter_initConfig")
Config.init(mActivity)
NetConfig.Other.HELP_AND_FEEDBACK_URL = mNovelInitEntity?.help
NetConfig.Other.PRIVACY_PROTOCOL_URL = mNovelInitEntity?.agreement
NetConfig.Other.FENLEI_URL = mNovelInitEntity?.cate
......
......@@ -209,6 +209,12 @@ interface RounterApi {
@RounterUri(Constant.scheme + "://gold_details")
fun getIntentGoldDetails(): Intent
@RounterUri(Constant.scheme + "://clockinwithdraw")
fun getIntentClockInWithdraw(): Intent
@RounterUri(Constant.scheme + "://welfare")
fun getIntentWelfare(): Intent
@RounterUri(Constant.scheme + "://xiaoman")
fun getIntentXiaoMan(@RounterParam("title") title: String): Intent
......
......@@ -12,9 +12,12 @@ import android.util.Log
import android.view.Gravity
import android.view.View
import android.webkit.WebView
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.RequiresApi
import com.ym.admodule.config.AdManager
import com.ym.admodule.config.ZXADSizeConfig
import com.ym.library.Constant
import com.ym.library.R
import com.ym.library.base.BaseDialog
......@@ -72,7 +75,7 @@ object CenterDialog : BaseDialog() {
/**
* 获得微信红包
*/
fun showGuideGetMoney(activity: Activity?, cashStr: String, webView: WebView) {
fun showGuideGetMoney(activity: Activity?, cashStr: String, webView: WebView?) {
if (activity == null) {
return
}
......@@ -85,8 +88,8 @@ object CenterDialog : BaseDialog() {
0,
Gravity.CENTER
)
// val tv_money = mDialogView?.findViewById<TextView>(R.id.tv_money)
// tv_money.text = "${cashStr}元"
val tv_money = mDialogView?.findViewById<TextView>(R.id.id_tv_cash_content)
tv_money.text = "恭喜您成功兑换${cashStr}元红包,您可以前往微信钱包查看到账情况"
mDialogView.findViewById<TextView>(R.id.id_tv_go_on_make_money).setOnClickListener {
webView?.loadUrl("javascript:onResume()")
......@@ -365,7 +368,7 @@ object CenterDialog : BaseDialog() {
type: Int,
rewardCount: Int,
listener: DialogInterface.OnCancelListener,
mWebView: WebView
mWebView: WebView?
) {
if (context == null) {
return
......@@ -384,8 +387,19 @@ object CenterDialog : BaseDialog() {
imgbg.setImageResource(R.drawable.icon_diamand)
}
val tvGetDropCount = mDialogView?.findViewById<TextView>(R.id.tv_get_count)
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(
......@@ -410,11 +424,11 @@ object CenterDialog : BaseDialog() {
// },AdID.mPlacementId_Reward_video_luck_farm)
mDialogView.findViewById<TextView>(R.id.btn_get_diamand).setOnClickListener {
mWebView?.loadUrl("javascript:onResume()")
// mWebView?.loadUrl("javascript:onResume()")
mDialog?.dismiss()
}
mDialogView.findViewById<ImageView>(R.id.lv_get_drop_close).setOnClickListener {
mWebView?.loadUrl("javascript:onResume()")
// mWebView?.loadUrl("javascript:onResume()")
mDialog?.dismiss()
}
......
package com.ym.library.utils
import android.app.Activity
import android.util.Log
import com.umeng.analytics.MobclickAgent
import com.ym.admodule.config.AdManager
import com.ym.library.module.NewsEntity
import com.ym.library.net.EventApiClient
import com.ym.library.module.StatusEntity
import com.ym.library.net.*
import com.ym.modulecommon.AppliContext
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
......@@ -316,4 +319,18 @@ object EventUtils {
})
}
public fun loadNextCacheRewardVideoAd(activity: Activity) {
AdManager.loadNextCacheRewardVideoAd(ADConfig.AD_REWARD_VIDIO,activity)
}
//看视频上报
public fun requestReport() {
GameApiClient.gameApi.adVideoReport()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<StatusEntity>() {
override fun onSuccess(result: StatusEntity) {}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {}
})
}
}
\ No newline at end of file
......@@ -5,8 +5,12 @@ import android.content.Intent;
import android.text.TextUtils;
import android.util.Log;
import com.bird.angel.AdConfig;
import com.ym.admodule.config.AdManager;
import com.ym.admodule.listener.ZXADVideoListener;
import com.ym.library.module.NewsEntity;
import com.ym.library.module.ShaveListEntity;
import com.ym.library.net.GameApiClient;
import com.ym.library.router.RounterApi;
import com.ym.library.router.RounterBus;
import com.ym.library.rxbus.BusData;
......@@ -15,6 +19,8 @@ import com.ym.library.rxbus.RxBusUtil;
import com.ym.modulecommon.AppliContext;
import com.ym.modulecommon.module.UserInfoEntity;
import org.jetbrains.annotations.Nullable;
/**
* Created by gaoleichao on 2019/3/12
......@@ -308,8 +314,33 @@ public class JumpUtils {
}
}
//福利中心
public static void jumpWelfareActivity() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentWelfare();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppliContext.get().startActivity(intent);
} catch (Exception e) {
}
}
//打卡提现
public static void jumpClockInWithdrawActivity() {
try {
Intent intent = RounterBus.getRounter(RounterApi.class).getIntentClockInWithdraw();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AppliContext.get().startActivity(intent);
} catch (Exception e) {
}
}
//广告跳转
public static void adJump(NewsEntity data,Activity activity) {
Log.d("JumpUtils", "data.title =" + data.getTitle());
Log.d("JumpUtils", "data.openType =" + data.getOpentype());
Log.d("JumpUtils", "data.sid =" + data.getSid());
Log.d("JumpUtils", "data.appmodel_id =" + data.getAppmodel_id());
String sid = String.valueOf(data.getSid());
int incentiveLevel = data.getIncentive_level();
int appmodelId = data.getAppmodel_id();
......@@ -390,9 +421,36 @@ public class JumpUtils {
if (TextUtils.equals(sid, "2077")) {
//看视频加金币
}
showAd(activity,data);
}
}
public static void showAd(Activity activity,NewsEntity data) {
AdManager.INSTANCE.playRewardAd(
"common_video",
"box_click",
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() {
EventUtils.INSTANCE.requestReport();
EventUtils.INSTANCE.loadNextCacheRewardVideoAd(activity);
}
});
}
public static void jumpPage(String pageName) {
switch (pageName) {
case "GuessFragment"://猜歌
......
......@@ -14,17 +14,12 @@
android:layout_width="match_parent"
android:layout_height="370dp">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:background="@drawable/icon_bg11">
</RelativeLayout>
android:background="@drawable/icon_bg11" />
<ImageView
android:id="@+id/lv_get_drop_close"
......@@ -111,6 +106,13 @@
</RelativeLayout>
</RelativeLayout>
<FrameLayout
android:id="@+id/layout_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:padding="10dp" />
</LinearLayout>
......
......@@ -75,6 +75,7 @@
android:id="@+id/id_tv_cash_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:lineSpacingExtra="10dp"
android:text="恭喜您成功兑换0.3元红包,您可以前往微信钱包查看到账情况"
android:textColor="#6A231A"
......
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