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

[提交人]:王雪伟

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