Commit 2a88c3e0 authored by Li's avatar Li

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

parent dd8f4df0
package com.ym.game.activity package com.ym.game.activity
import android.content.DialogInterface
import android.text.Html
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.ym.ddcy.R import com.ym.ddcy.R
import com.ym.game.adapter.ClockInWithdrawAdpater
import com.ym.game.contract.ClockInWithdrawContract import com.ym.game.contract.ClockInWithdrawContract
import com.ym.game.presenter.ClockInWithdrawPresenter import com.ym.game.presenter.ClockInWithdrawPresenter
import com.ym.library.Constant
import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.ClockInWithdrawEntity import com.ym.library.module.ClockInWithdrawEntity
import com.ym.library.net.BaseActivity import com.ym.library.net.BaseActivity
import com.ym.library.utils.CenterDialog
import kotlinx.android.synthetic.main.activity_clock_in_withdraw.* import kotlinx.android.synthetic.main.activity_clock_in_withdraw.*
//打卡提现 福利 //打卡提现 福利
class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View { class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View,
OnRecycleItemClickListener<ClockInWithdrawEntity.ClockInItemEntity> {
private var mPresenter: ClockInWithdrawPresenter? = null private var mPresenter: ClockInWithdrawPresenter? = null
private var mAdapter: ClockInWithdrawAdpater? = null
private var mData: ClockInWithdrawEntity.ClockInItemEntity? = null
override fun layoutID(): Int { override fun layoutID(): Int {
return R.layout.activity_clock_in_withdraw return R.layout.activity_clock_in_withdraw
...@@ -24,21 +34,53 @@ class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View { ...@@ -24,21 +34,53 @@ class ClockInWithdrawActitivy : BaseActivity(), ClockInWithdrawContract.View {
} }
initAdapter() initAdapter()
mPresenter?.getClockInWithdrawList() mPresenter?.getClockInWithdrawList()
} }
private fun initAdapter() { private fun initAdapter() {
recycler_clock_in.layoutManager = LinearLayoutManager(this) recycler_clock_in?.layoutManager = LinearLayoutManager(this)
mAdapter = ClockInWithdrawAdpater(this, this)
recycler_clock_in?.adapter = mAdapter
} }
override fun onItemClick(view: View, position: Int, data: ClockInWithdrawEntity.ClockInItemEntity) {
mData = data
if (data.special == 1) {
mPresenter?.getFlyBoxReceive(this)
} else if (data.special == 2) {
mPresenter?.getDoWd(data.id!!)
}
}
//任务列表结果
override fun clockInWithdrawListResult(result: ClockInWithdrawEntity?) { override fun clockInWithdrawListResult(result: ClockInWithdrawEntity?) {
if (result != null) {
Constant.videoNum = result?.videoNum?:20
tv_clock_in_days?.text =
Html.fromHtml("已连续打卡<font color=\"#8F2C0F\"><big>${result?.clockNum}</big></font>天")
tv_clock_in_info?.text = "每日观看${result?.videoNum}个视频即可完成打卡"
mAdapter?.clear()
mAdapter?.appendToList(result?.list)
mAdapter?.notifyDataSetChanged()
}
} }
//提现结果
override fun dowdResult(result: ClockInWithdrawEntity?) { override fun dowdResult(result: ClockInWithdrawEntity?) {
mPresenter?.getClockInWithdrawList()
if (result != null) {
CenterDialog.showgetWaterDrop(
this,
3,
mData?.cashStr?.toInt()!!,
DialogInterface.OnCancelListener {
},
null
)
}
} }
} }
\ No newline at end of file
...@@ -7,20 +7,20 @@ import android.view.View ...@@ -7,20 +7,20 @@ import android.view.View
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.TextView import android.widget.TextView
import androidx.core.app.ActivityCompat import androidx.core.app.ActivityCompat
import com.bytedance.sdk.openadsdk.TTSplashAd
import com.gyf.immersionbar.BarHide import com.gyf.immersionbar.BarHide
import com.gyf.immersionbar.ImmersionBar import com.gyf.immersionbar.ImmersionBar
import com.umeng.analytics.MobclickAgent import com.umeng.analytics.MobclickAgent
import com.ym.admodule.config.AdManager import com.ym.admodule.config.AdManager
import com.ym.admodule.listener.ZXADSplashListener import com.ym.admodule.listener.ZXADSplashListener
import com.ym.game.GameActivity
import com.ym.ddcy.R import com.ym.ddcy.R
import com.ym.game.GameActivity
import com.ym.game.utils.CenterDialog
import com.ym.library.Constant import com.ym.library.Constant
import com.ym.library.module.ReportEntity import com.ym.library.module.ReportEntity
import com.ym.library.net.PermissionsActivity
import com.ym.library.net.SplashContract
import com.ym.library.net.SplashPresenter
import com.ym.library.net.SplashPresenter.Companion.PERMISSIONS import com.ym.library.net.SplashPresenter.Companion.PERMISSIONS
import com.ym.game.utils.CenterDialog
import com.ym.library.module.NewsEntity
import com.ym.library.net.*
import com.ym.library.utils.* import com.ym.library.utils.*
import com.ym.modulecommon.base.BaseActivity import com.ym.modulecommon.base.BaseActivity
......
...@@ -11,12 +11,11 @@ import com.ym.ddcy.R ...@@ -11,12 +11,11 @@ import com.ym.ddcy.R
import com.ym.game.adapter.WelfareDiamondAdapter import com.ym.game.adapter.WelfareDiamondAdapter
import com.ym.game.adapter.WelfareTaskAdpater import com.ym.game.adapter.WelfareTaskAdpater
import com.ym.game.contract.WelfareContract import com.ym.game.contract.WelfareContract
import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.presenter.WelfarePresenter import com.ym.game.presenter.WelfarePresenter
import com.ym.game.view.MainDialog
import com.ym.library.listener.OnRecycleItemClickListener import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.DiamondEntity import com.ym.library.module.*
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.net.BaseActivity
import com.ym.library.utils.ADConfig import com.ym.library.utils.ADConfig
import com.ym.library.utils.CenterDialog import com.ym.library.utils.CenterDialog
...@@ -58,7 +57,7 @@ class WelfareActivity : BaseActivity(), WelfareContract.View, ...@@ -58,7 +57,7 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
private fun initAdapter() { private fun initAdapter() {
diamonAdapter = WelfareDiamondAdapter(this,object :OnRecycleItemClickListener<DiamondEntity> { diamonAdapter = WelfareDiamondAdapter(this,object :OnRecycleItemClickListener<DiamondEntity> {
override fun onItemClick(view: View, position: Int, data: DiamondEntity) { override fun onItemClick(view: View, position: Int, data: DiamondEntity) {
mPresenter?.getWelfareTaskBox()
} }
}) })
recycler_welfare_diamond_reward?.layoutManager = GridLayoutManager(this, 7) recycler_welfare_diamond_reward?.layoutManager = GridLayoutManager(this, 7)
...@@ -145,10 +144,16 @@ class WelfareActivity : BaseActivity(), WelfareContract.View, ...@@ -145,10 +144,16 @@ class WelfareActivity : BaseActivity(), WelfareContract.View,
} }
} }
//提现结果 //领取宝箱结果
override fun taskCashResult(result: NewsEntity?) { override fun taskCashResult(result: List<FlyBoxEntity>?) {
if (result != null) { mPresenter?.getDiamondList()
if (result != null && result.isNotEmpty()) {
CenterDialog.showGuideGetMoney(this,"0.3",null) CenterDialog.showGuideGetMoney(this,"0.3",null)
MainDialog.showWelfareOpenBox(this,result,object :IDialogViewCloseCallback {
override fun onCloseViewSuccess(isSuccess: Boolean) {
}
})
} }
} }
......
...@@ -13,6 +13,8 @@ import com.ym.library.base.BaseRecyclerAdapter ...@@ -13,6 +13,8 @@ import com.ym.library.base.BaseRecyclerAdapter
import com.ym.library.listener.OnRecycleItemClickListener import com.ym.library.listener.OnRecycleItemClickListener
import com.ym.library.module.DiamondEntity import com.ym.library.module.DiamondEntity
import com.ym.library.module.NewsEntity import com.ym.library.module.NewsEntity
import com.ym.library.utils.Utils
/** /**
*Craeted by ${junqi.li} *Craeted by ${junqi.li}
*Craeted by 2020/9/18 *Craeted by 2020/9/18
...@@ -58,13 +60,16 @@ class WelfareDiamondAdapter : ...@@ -58,13 +60,16 @@ class WelfareDiamondAdapter :
holder?.ivStatus.setImageResource(R.drawable.icon_welfare_box_close) holder?.ivStatus.setImageResource(R.drawable.icon_welfare_box_close)
} }
holder?.ivDottedLine.visibility = View.GONE holder?.ivDottedLine.visibility = View.GONE
holder?.itemView?.setOnClickListener {
if (data.coins!! >= data.max!!){
listener?.onItemClick(it,position,mList[position])
} else {
Utils.showToast(mContext,"钻石不足")
}
}
} else { } else {
holder?.ivDottedLine.visibility = View.VISIBLE holder?.ivDottedLine.visibility = View.VISIBLE
} }
holder?.itemView?.setOnClickListener {
listener?.onItemClick(it,position,mList[position])
}
} }
} }
......
...@@ -11,6 +11,6 @@ class ClockInWithdrawContract { ...@@ -11,6 +11,6 @@ class ClockInWithdrawContract {
interface Presenter { interface Presenter {
fun getClockInWithdrawList() fun getClockInWithdrawList()
fun getDoWd() fun getDoWd(id: Int)
} }
} }
\ No newline at end of file
package com.ym.game.contract package com.ym.game.contract
import com.ym.library.module.DiamondEntity import com.ym.library.module.*
import com.ym.library.module.NewsEntity
import com.ym.library.module.TaskCompleteEntity
import com.ym.library.module.TaskListEntity
class WelfareContract { class WelfareContract {
interface View { interface View {
fun diamondListResult(result: DiamondEntity?) fun diamondListResult(result: DiamondEntity?)
fun taskListResult(result: TaskListEntity?) fun taskListResult(result: TaskListEntity?)
fun taskReceiveListResult(result: TaskCompleteEntity?) fun taskReceiveListResult(result: TaskCompleteEntity?)
fun taskCashResult(result: NewsEntity?) fun taskCashResult(result: List<FlyBoxEntity>?)
} }
interface Presenter { interface Presenter {
...@@ -22,6 +19,6 @@ class WelfareContract { ...@@ -22,6 +19,6 @@ class WelfareContract {
fun getWelfareVideoReport(sid: Int) fun getWelfareVideoReport(sid: Int)
fun getTaskCash() fun getWelfareTaskBox()
} }
} }
\ No newline at end of file
package com.ym.game.presenter package com.ym.game.presenter
import android.app.Activity
import com.ym.game.contract.ClockInWithdrawContract import com.ym.game.contract.ClockInWithdrawContract
import com.ym.game.contract.RecordContract import com.ym.game.listener.IDialogViewCloseCallback
import com.ym.game.view.MainDialog
import com.ym.library.module.ClockInWithdrawEntity import com.ym.library.module.ClockInWithdrawEntity
import com.ym.library.module.FlyBoxEntity
import com.ym.library.net.BaseObserver import com.ym.library.net.BaseObserver
import com.ym.library.net.GameApiClient import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers import com.ym.library.net.RxSchedulers
...@@ -30,8 +33,8 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter { ...@@ -30,8 +33,8 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter {
}) })
} }
override fun getDoWd() { override fun getDoWd(id:Int) {
GameApiClient.gameApi.getDoWd().compose( GameApiClient.gameApi.getDoWd(id).compose(
RxSchedulers.observableIO2Main() RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<ClockInWithdrawEntity>() { ).subscribe(object : BaseObserver<ClockInWithdrawEntity>() {
override fun onSuccess(result: ClockInWithdrawEntity?) { override fun onSuccess(result: ClockInWithdrawEntity?) {
...@@ -43,4 +46,35 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter { ...@@ -43,4 +46,35 @@ class ClockInWithdrawPresenter : ClockInWithdrawContract.Presenter {
} }
}) })
} }
fun getFlyBoxReceive(activity: Activity) {
GameApiClient.gameApi.getopenBox()
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<FlyBoxEntity>() {
override fun onSuccess(result: FlyBoxEntity?) {
getClockInWithdrawList()
if (result != null) {
var type = result.type
if (type != null) {
MainDialog.showopenBox(
activity, type,
"宝箱奖励",
result.awardNum ?: 0,
result,
object : IDialogViewCloseCallback {
override fun onCloseViewSuccess(isSuccess: Boolean) {
}
}
)
}
}
}
override fun onFailure(e: Throwable?, code: String?, errorMsg: String?) {
}
})
}
} }
\ No newline at end of file
package com.ym.game.presenter package com.ym.game.presenter
import com.ym.game.contract.WelfareContract import com.ym.game.contract.WelfareContract
import com.ym.library.module.DiamondEntity import com.ym.library.module.*
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.BaseObserver
import com.ym.library.net.GameApiClient import com.ym.library.net.GameApiClient
import com.ym.library.net.RxSchedulers import com.ym.library.net.RxSchedulers
import com.ym.library.utils.Utils
class WelfarePresenter : WelfareContract.Presenter { class WelfarePresenter : WelfareContract.Presenter {
...@@ -73,11 +71,11 @@ class WelfarePresenter : WelfareContract.Presenter { ...@@ -73,11 +71,11 @@ class WelfarePresenter : WelfareContract.Presenter {
}) })
} }
override fun getTaskCash() { override fun getWelfareTaskBox() {
GameApiClient.gameApi.getTaskCash().compose( GameApiClient.gameApi.getWelfareTaskBox().compose(
RxSchedulers.observableIO2Main() RxSchedulers.observableIO2Main()
).subscribe(object : BaseObserver<NewsEntity>() { ).subscribe(object : BaseObserver<List<FlyBoxEntity>>() {
override fun onSuccess(result: NewsEntity?) { override fun onSuccess(result: List<FlyBoxEntity>?) {
mView?.taskCashResult(result) mView?.taskCashResult(result)
} }
......
...@@ -71,7 +71,7 @@ object MainDialog { ...@@ -71,7 +71,7 @@ object MainDialog {
0, 0,
Gravity.CENTER Gravity.CENTER
) )
val layouAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad2) val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad2)
AdManager.loadFeedAd( AdManager.loadFeedAd(
ADConfig.AD_IMG_FADE, ADConfig.AD_IMG_FADE,
...@@ -80,7 +80,7 @@ object MainDialog { ...@@ -80,7 +80,7 @@ object MainDialog {
Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 56, Utils.px2dip(PhoneUtils.getScreenWidth(activity).toFloat()) - 56,
((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt() ((Utils.px2dip(activity.windowManager?.defaultDisplay?.width!!.toFloat()) - 56) * 0.66).toInt()
), ),
layouAd layoutAd
) )
mDialog.setOnDismissListener(object :DialogInterface.OnDismissListener{ mDialog.setOnDismissListener(object :DialogInterface.OnDismissListener{
...@@ -354,6 +354,84 @@ object MainDialog { ...@@ -354,6 +354,84 @@ object MainDialog {
mDialog.show() mDialog.show()
} }
//福利中心开宝箱
fun showWelfareOpenBox(
context: Context?,
results: List<FlyBoxEntity>,
mListener: IDialogViewCloseCallback
) {
if (context == null) {
return
}
val mDialog = Dialog(context, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
showBottomDialog(
R.layout.dialog_get_welfare_drop,
context,
mDialog,
0,
Gravity.CENTER
)
val layout_seed = mDialogView?.findViewById<LinearLayout>(R.id.layout_seed)
val layout_coins = mDialogView?.findViewById<LinearLayout>(R.id.layout_coins)
val layout_accelerator = mDialogView?.findViewById<LinearLayout>(R.id.layout_accelerator)
val tv_seed = mDialogView?.findViewById<TextView>(R.id.tv_seed)
val iv_seed_bg = mDialogView?.findViewById<ImageView>(R.id.iv_seed_bg)
val tv_coin = mDialogView?.findViewById<TextView>(R.id.tv_coin)
val tv_accelerator = mDialogView?.findViewById<TextView>(R.id.tv_accelerator)
val layoutAd = mDialogView?.findViewById<FrameLayout>(R.id.layout_get_drop_ad)
for (entity in results) {
//1种子 2金币 3加速剂
when (entity.awardType) {
1 -> {
layout_seed.visibility = View.VISIBLE
setImage(iv_seed_bg, entity.id)
tv_seed.text = "+${entity.awardNum}"
}
2 -> {
layout_coins.visibility = View.VISIBLE
tv_coin.text = "+${entity.awardNum}"
}
3 -> {
layout_accelerator.visibility = View.VISIBLE
tv_accelerator.text = "+${entity.awardNum}"
}
}
}
mDialogView.findViewById<TextView>(R.id.btn_get_drop_happy_accept).setOnClickListener {
mDialog.dismiss()
mListener.onCloseViewSuccess(true)
}
mDialogView.findViewById<ImageView>(R.id.lv_get_drop_close).setOnClickListener {
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{
override fun onDismiss(p0: DialogInterface?) {
onDestroy()
}
})
mDialog.setCanceledOnTouchOutside(false)
mDialog.setCancelable(false)
mDialog.show()
}
//提现弹窗 //提现弹窗
fun showWithDraw( fun showWithDraw(
......
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<corners android:radius="7.5dp" />
<!-- <stroke-->
<!-- android:width="1dp"-->
<!-- android:color="#EEEEEE" />-->
<solid android:color="#D9D9D9" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<corners android:radius="7.5dp" />
<gradient
android:angle="0"
android:endColor="#ED7624"
android:startColor="#ED7624" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#69ffffff"/>
<corners android:radius="10.5dp"/>
</shape>
\ No newline at end of file
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="#F7BD7C" android:background="#F7BD7C"
android:orientation="vertical"> android:orientation="vertical">
...@@ -46,7 +47,7 @@ ...@@ -46,7 +47,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="已连续打卡 天" tools:text="已连续打卡 天"
android:textColor="#ED7624" android:textColor="#ED7624"
android:textSize="26sp" /> android:textSize="26sp" />
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="11dp" android:layout_marginTop="11dp"
android:includeFontPadding="false" android:includeFontPadding="false"
android:text="每日观看20个视频即可完成打卡" tools:text="每日观看20个视频即可完成打卡"
android:textColor="#8F2C0F" android:textColor="#8F2C0F"
android:textSize="16sp" /> android:textSize="16sp" />
...@@ -65,9 +66,7 @@ ...@@ -65,9 +66,7 @@
android:id="@+id/recycler_clock_in" android:id="@+id/recycler_clock_in"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="22dp" android:layout_marginTop="22dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="30dp" /> android:layout_marginBottom="30dp" />
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<RelativeLayout
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="@mipmap/icon_main_dialog_get_drops_bg">
</RelativeLayout>
<ImageView
android:id="@+id/lv_get_drop_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="70dp"
android:layout_marginRight="@dimen/dp_30"
android:src="@mipmap/icon_new_close" />
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="350dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="20dp"
android:background="@mipmap/icon_content_bg">
<ImageView
android:id="@+id/id_img_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="35dp"
android:src="@mipmap/icon_top_bg" />
<TextView
android:id="@+id/id_tv_gongxi_get"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_44"
android:text="恭喜获得"
android:textColor="@color/white"
android:textSize="20sp" />
<LinearLayout
android:id="@+id/id_ll_content"
android:layout_width="310dp"
android:layout_height="150dp"
android:layout_below="@+id/id_tv_gongxi_get"
android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_60"
android:orientation="horizontal"
android:visibility="visible">
<LinearLayout
android:id="@+id/layout_seed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:id="@+id/iv_seed_bg"
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_60"
android:src="@mipmap/img_cabbage" />
<TextView
android:id="@+id/tv_seed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/color_7C1714"
android:textSize="30sp"
android:textStyle="bold"
tools:text="+40" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_coins"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_40"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_60"
android:src="@mipmap/icon_coin" />
<TextView
android:id="@+id/tv_coin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/color_7C1714"
android:textSize="30sp"
android:textStyle="bold"
tools:text="+40g" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_accelerator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_40"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:visibility="gone">
<ImageView
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_60"
android:src="@mipmap/icon_speed_water" />
<TextView
android:id="@+id/tv_accelerator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:textColor="@color/color_7C1714"
android:textSize="30sp"
android:textStyle="bold"
tools:text="+40" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/btn_get_drop_happy_accept"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/id_ll_content"
android:layout_centerHorizontal="true"
android:background="@drawable/btn_selector" />
</RelativeLayout>
</RelativeLayout>
<FrameLayout
android:id="@+id/layout_get_drop_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="18dp"
android:layout_marginTop="5dp"
android:layout_marginRight="18dp"
android:background="@color/white"
android:padding="@dimen/dp_10"
android:visibility="gone" />
</LinearLayout>
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="21dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<TextView <com.ym.game.wedget.MediumBoldTextView
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content"/> android:layout_height="wrap_content"
android:background="@drawable/shape_ffffff_r10"
android:gravity="center"
android:text="完成当前打卡,可解锁下一天打卡任务"
android:textColor="#8F2C0F"
android:textSize="15sp" />
</FrameLayout> </FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginBottom="5dp">
<RelativeLayout
android:id="@+id/layout_clock_in_item_root"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginRight="@dimen/dp_20">
<ImageView
android:id="@+id/iv_clock_in_item_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@drawable/icon_clock_in_item_bg" />
<TextView
android:id="@+id/tv_clock_in_item_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_14"
android:text="第一天"
android:textColor="#ED7624"
android:textSize="16sp" />
<TextView
android:id="@+id/tv_clock_in_complete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="今日已完成打卡"
android:textColor="#8C856F"
android:textSize="14sp"
android:visibility="gone" />
<LinearLayout
android:id="@+id/layout_clock_in_center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:gravity="center_vertical"
android:orientation="vertical">
<com.ym.game.wedget.MediumBoldTextView
android:id="@+id/tv_clock_in_item_ad_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_2"
android:includeFontPadding="false"
android:text="17"
android:textColor="#E91119"
android:textSize="20sp" />
<com.ym.game.wedget.MediumBoldTextView
android:id="@+id/tv_clock_in_item_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_2"
android:layout_marginRight="@dimen/dp_2"
android:includeFontPadding="false"
android:text="0.3元"
android:textColor="#E91119"
android:textSize="22sp"
android:visibility="visible" />
<RelativeLayout
android:id="@+id/layout_progress"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_12"
android:layout_marginTop="8dp"
android:visibility="gone">
<ProgressBar
android:id="@+id/progress_clock_in_bar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="151dp"
android:layout_height="@dimen/dp_12"
android:max="100"
android:progress="30"
android:progressDrawable="@drawable/game_clock_in_item_progress_bg" />
<com.ym.game.wedget.MediumBoldTextView
android:id="@+id/tv_clock_in_item_progress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:includeFontPadding="false"
android:text="3/20"
android:textStyle="bold"
android:textColor="#A43D14"
android:textSize="10sp" />
</RelativeLayout>
</LinearLayout>
<ImageView
android:id="@+id/iv_clock_in_item_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:src="@drawable/icon_clock_in_item_red_pg"
android:visibility="visible" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/layout_clock_in_red_pg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"
android:visibility="visible">
<ImageView
android:id="@+id/iv_clock_in_item_red_pg_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="-8dp"
android:src="@drawable/icon_clock_in_item_red_pg_coin_complete" />
<com.ym.game.wedget.MediumBoldTextView
android:id="@+id/tv_clock_in_item_money_red"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:includeFontPadding="false"
android:text="0.3"
android:textColor="#E91119"
android:textSize="20sp" />
</RelativeLayout>
<FrameLayout
android:id="@+id/layout_tip"
android:layout_width="match_parent"
android:layout_height="21dp"
android:layout_below="@+id/layout_clock_in_item_root"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:visibility="gone">
<com.ym.game.wedget.MediumBoldTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_ffffff_r10"
android:gravity="center"
android:text="完成当前打卡,可解锁下一天打卡任务"
android:textColor="#8F2C0F"
android:textSize="15sp" />
</FrameLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -90,6 +90,7 @@ public class Constant { ...@@ -90,6 +90,7 @@ public class Constant {
public static int ali_status = 0; public static int ali_status = 0;
public static int to_kandian_withdraw = 0; public static int to_kandian_withdraw = 0;
public static int superMasterTab = 0; public static int superMasterTab = 0;
public static int videoNum = 20;
public static LatestLoginInfo latestLoginInfo; public static LatestLoginInfo latestLoginInfo;
public static final int PAGE_MAIN = 1; //主页 public static final int PAGE_MAIN = 1; //主页
......
package com.ym.library.module package com.ym.library.module
class ClockInWithdrawEntity { class ClockInWithdrawEntity {
var type:Int? = 0
var clockNum: Int? = 0
var videoNum: Int? = 0
var list: List<ClockInItemEntity>? = null
class ClockInItemEntity {
var id: Int? = 0//提现id
var title: String? = ""//打卡标题
var targetNum: Int? = 0//打卡目标数
var currentNum: Int? = null//当前打卡数
var cash: Int? = null//可提现金额 单位:分
var cashStr: String? = null//可提现金额 字符串
var status: Int? = null//红包状态 1 已提现 2 可提现 0 未完成
var desc: String? = null//文案
var isToday: Int? = 0 //是否是今天 1是 0不是
var special: Int? = 1//1 普通打卡 2 提现打卡 3 手机
var needClockNum = 0 //打卡天数
var type: Int? = 0 //是否隔断展示文案 0不展示 1展示
}
/**
* 普通任务 special=1
加亮无角标:当天任务,未完成打卡 status=4
变暗带角标:当天任务,已完成 status=2
变暗带角标:未来任务(未解锁) status=5
提现任务 special=2
晃动加亮无角标:已完成打卡未提现,点击调提现接口 status=1
加亮无角标:当天任务,未完成打卡 status=3
加亮带角标:未来任务,未解锁 status=7
变暗带角标:已完成打卡并已提现 status=6
*/
} }
\ No newline at end of file
package com.ym.library.module package com.ym.library.module
class FlyBoxEntity { class FlyBoxEntity {
var id: Int = 0
var type: Int? = 0 var type: Int? = 0
var awardNum: Int? = 0 var awardNum: Int? = 0
var awardType: Int? = 0//1种子 2金币 3加速剂
var subType: Int? = 0
var seedList: MutableList<SeedList> = ArrayList() var seedList: MutableList<SeedList> = ArrayList()
class SeedList { class SeedList {
......
...@@ -262,8 +262,8 @@ interface IGameApi { ...@@ -262,8 +262,8 @@ interface IGameApi {
fun getClockList(): Observable<Response<ClockInWithdrawEntity>> fun getClockList(): Observable<Response<ClockInWithdrawEntity>>
//打卡提现 //打卡提现
@GET(NetConfig.Game.URL_GAME_DO_WD) @POST(NetConfig.Game.URL_GAME_DO_WD)
fun getDoWd(): Observable<Response<ClockInWithdrawEntity>> fun getDoWd(@Query("clockId") clockId:Int): Observable<Response<ClockInWithdrawEntity>>
/** /**
* 任务页列表 * 任务页列表
...@@ -292,8 +292,8 @@ interface IGameApi { ...@@ -292,8 +292,8 @@ interface IGameApi {
/** /**
* 福利提现 * 福利提现
*/ */
@POST(NetConfig.Game.URL_GAME_TASK_CASH) @POST(NetConfig.Game.URL_GAME_WELFARE_TASK_BOX)
fun getTaskCash(): Observable<Response<NewsEntity>> fun getWelfareTaskBox(): Observable<Response<List<FlyBoxEntity>>>
@GET(NetConfig.Game.URL_COLLECT_CARD) @GET(NetConfig.Game.URL_COLLECT_CARD)
fun getCollectCard(): Observable<Response<PuzzleEntity?>> fun getCollectCard(): Observable<Response<PuzzleEntity?>>
......
...@@ -254,12 +254,12 @@ public class NetConfig { ...@@ -254,12 +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_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_CLOCK_LIST = "app/v1/game/ddcy/clock_list";//打卡提现列表
public static final String URL_GAME_DO_WD = "app/v1/game/ddcy/do_wd";//打卡提现 public static final String URL_GAME_DO_WD = "app/v1/game/ddcy/clock_wd";//打卡提现
public static final String URL_GAME_TASK_PROCESS = "app/v1/game/task_process";//福利中心钻石进度 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_WELFARE_VIDEO_REPORT = "app/v1/game/welfare_video_report";//福利中心看视频任务
public static final String URL_GAME_TASK_CASH = "app/v1/game/task_cash";//福利中心提现 public static final String URL_GAME_WELFARE_TASK_BOX = "app/v1/game/farm/welfare_task_box";//福利中心宝箱领取
public static final String URL_COLLECT_CARD = "app/v1/collect-card/list";//宝箱卡片列表 public static final String URL_COLLECT_CARD = "app/v1/collect-card/list";//宝箱卡片列表
public static final String URL_COLLECT_CARD_PUT = "app/v1/collect-card/put";//宝箱卡片拼图 public static final String URL_COLLECT_CARD_PUT = "app/v1/collect-card/put";//宝箱卡片拼图
public static final String URL_COLLECT_CARD_ADV = "app/v1/collect-card/adv";//看广告一键拼图 public static final String URL_COLLECT_CARD_ADV = "app/v1/collect-card/adv";//看广告一键拼图
......
...@@ -110,8 +110,12 @@ ...@@ -110,8 +110,12 @@
android:id="@+id/layout_ad" android:id="@+id/layout_ad"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="15dp" android:layout_marginLeft="15dp"
android:padding="10dp" /> android:layout_marginTop="10dp"
android:layout_marginRight="15dp"
android:background="@color/white"
android:padding="10dp"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
......
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