Commit cafe7e84 authored by 王雪伟's avatar 王雪伟

[提交人]:王雪伟

[提交简述] :1.1.3
[实现方案] :隐藏现金签到
parent 2bdc3af0
......@@ -7,6 +7,7 @@ import android.text.TextUtils
import android.util.Log
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.zxbw.modulemain.R
import com.zxbw.modulemain.adapter.OperatorAdapter
import com.zxbw.modulemain.adapter.RechargeAdapter
......@@ -103,7 +104,8 @@ class RechargeActivity : BaseActivity(), OnRecycleItemClickListener<MemberEntity
mPresenter = RechargePresenter(this)
mAdapter = RechargeAdapter(this, this)
id_rl_recharge?.layoutManager = GridLayoutManager(this, 3)
// id_rl_recharge?.layoutManager = GridLayoutManager(this, 3)
id_rl_recharge?.layoutManager = LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL,false)
id_rl_recharge?.adapter = mAdapter
mPresenter?.getFetchCard()
// mPresenter?.getPayList("mobileFee")
......
......@@ -18,13 +18,16 @@ import com.zxhl.cms.net.model.video.MemberEntity
import com.zxhl.cms.utils.OnRecycleItemClickListener
class RechargeAdapter :
BaseRecyclerAdapter<MemberEntity.ProductDetail, RechargeAdapter.ViewHolder> {
BaseRecyclerAdapter<MemberEntity.ProductDetail, RecyclerView.ViewHolder> {
private val VIEW_TYPE_HIDE_VIEW = -1
private var mContext: Activity? = null
private val listener: OnRecycleItemClickListener<MemberEntity.ProductDetail>
private val mSelectColor: Int
private val mUnSelectColor: Int
private var position = -1
private var price:String?=""
private var price: String? = ""
constructor(
content: Activity?,
listener: OnRecycleItemClickListener<MemberEntity.ProductDetail>
......@@ -40,20 +43,30 @@ class RechargeAdapter :
notifyDataSetChanged()
}
fun updateData( discountprice: String) {
price=discountprice
fun updateData(discountprice: String) {
price = discountprice
notifyDataSetChanged()
}
override fun onBindViewHolder(holder: ViewHolder, pos: Int) {
override fun getItemViewType(position: Int): Int {
if (position == 0) {
return VIEW_TYPE_HIDE_VIEW;
} else {
return super.getItemViewType(position)
}
}
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, pos: Int) {
var bean = mList[pos]
if (holder is ItemViewHolder) {
holder.id_tv_activity_price_text?.text = "活动价"
holder.id_tv_price?.text = "${bean.cash}"
if (pos == position) {
if(!TextUtils.isEmpty(price)){
Log.e("MXL","更新ui")
holder.id_tv_activity_price_text?.text="已减${price}元"
holder.id_tv_price?.text = "${bean.cash?.toDoubleOrNull()?.minus(price?.toDoubleOrNull()!!)}"
if (!TextUtils.isEmpty(price)) {
Log.e("MXL", "更新ui")
holder.id_tv_activity_price_text?.text = "已减${price}元"
holder.id_tv_price?.text =
"${bean.cash?.toDoubleOrNull()?.minus(price?.toDoubleOrNull()!!)}"
}
holder.id_ll_item?.setBackgroundResource(R.drawable.shape_edd49d_r6)
......@@ -72,9 +85,12 @@ class RechargeAdapter :
holder.id_tv_rmb?.setTextColor(mUnSelectColor)
}
holder.id_tv_orgin_price?.text = "原价 ¥${bean.originalPrice}"
holder.id_tv_orgin_price?.getPaint()?.setFlags(Paint.STRIKE_THRU_TEXT_FLAG)
} else {
}
}
......@@ -82,14 +98,22 @@ class RechargeAdapter :
// return 3
// }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
if (viewType == VIEW_TYPE_HIDE_VIEW) {
return HideViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_recharge_hide, parent, false)
)
} else {
return ItemViewHolder(
LayoutInflater.from(AppContext.get())
.inflate(R.layout.item_layout_recharge, parent, false)
)
}
inner class ViewHolder : RecyclerView.ViewHolder {
}
inner class ItemViewHolder : RecyclerView.ViewHolder {
var id_ll_item: LinearLayout?
// var id_goods_icon: RecycleImageView?
......@@ -98,7 +122,6 @@ class RechargeAdapter :
var id_tv_price: TextView?
var id_tv_orgin_price: TextView?
constructor(
itemView: View
) : super(itemView) {
......@@ -120,4 +143,14 @@ class RechargeAdapter :
}
}
}
//空白
class HideViewHolder : RecyclerView.ViewHolder {
constructor(
itemView: View
) : super(itemView) {
}
}
}
\ No newline at end of file
......@@ -164,6 +164,7 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/id_rl_recharge"
android:layout_width="match_parent"
android:layout_marginLeft="5dp"
android:layout_height="wrap_content" />
<LinearLayout
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_ll_item"
android:layout_width="match_parent"
android:layout_width="100dp"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="0dp"
android:layout_height="wrap_content">
</RelativeLayout>
......@@ -33,6 +33,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:visibility="gone"
android:drawableTop="@drawable/icon_bottom_cash_default"
android:drawablePadding="2dp"
android:textStyle="bold"
......
......@@ -62,11 +62,10 @@ object AdManager {
}
fun init(application: Context, appLs: String) {
LogUtils.isShowLog(true)
LogUtils.isShowLog(false)
AdNetConfig.setBase_Url(AdNetConfig.Environment.PRODUCT)
AdConstant.param.mPacketName = application.packageName
AdConstant.param.appLs = appLs
AdConstant.param.appLs = appLs
ZXADClient.adApi.getADConfig(AdConstant.param.mPacketName)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<AdIdConfig>?>() {
......
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