Commit 8d2fd5ba authored by maxiaoliang's avatar maxiaoliang

修改

parent cca9009b
...@@ -67,12 +67,32 @@ class BoxAdapter : BaseRecyclerAdapter<HomeBoxListEntity, RecyclerView.ViewHolde ...@@ -67,12 +67,32 @@ class BoxAdapter : BaseRecyclerAdapter<HomeBoxListEntity, RecyclerView.ViewHolde
override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) { override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
if (holder is ViewHolder) { if (holder is ViewHolder) {
var bean = mList[position] var bean = mList[position]
holder.item_tv_boxname?.text = bean.boxName holder.item_tv_boxname?.text = bean.boxName
holder.item_tv_description?.text = bean.description holder.item_tv_description?.text = bean.description
if (TextUtils.isEmpty(bean.newUserPrice)) { if (TextUtils.isEmpty(bean.newUserPrice)) {
holder.id_rl_new_people?.visibility = View.GONE holder.id_rl_new_people?.visibility = View.GONE
holder.id_tv_new_people_price?.visibility = View.GONE holder.id_tv_new_people_price?.visibility = View.GONE
if (bean.activitiesType == 1) {
holder.id_img_new_people?.visibility = View.VISIBLE
holder.id_img_new_people?.setImageResource(R.drawable.biaoqian_xianshi)
holder.item_tv_price?.text = bean.onePriceStr
holder.id_tv_one_lottery?.text = "Open"
} else if (bean.activitiesType == 2) {
holder.id_img_new_people?.visibility = View.VISIBLE
holder.id_img_new_people?.setImageResource(R.drawable.biaoqian_baozhang)
holder.item_tv_price?.text = bean.activitiesPrice
// holder.id_tv_one_lottery?.text = "买一送一"
} else {
holder.id_img_new_people?.visibility = View.INVISIBLE
holder.item_tv_price?.text = bean.onePriceStr
holder.id_tv_one_lottery?.text = "Open"
}
} else { } else {
holder.id_tv_one_lottery?.text = "Open"
holder.item_tv_price?.text = bean.onePriceStr
holder.id_img_new_people?.visibility = View.VISIBLE
holder.id_img_new_people?.setImageResource(R.drawable.biaoqianxinren)
holder.id_rl_new_people?.visibility = View.VISIBLE holder.id_rl_new_people?.visibility = View.VISIBLE
holder.id_tv_new_people_price?.visibility = View.VISIBLE holder.id_tv_new_people_price?.visibility = View.VISIBLE
holder.id_tv_new_people_price?.text = "${bean.newUserPrice}" holder.id_tv_new_people_price?.text = "${bean.newUserPrice}"
...@@ -147,12 +167,13 @@ class BoxAdapter : BaseRecyclerAdapter<HomeBoxListEntity, RecyclerView.ViewHolde ...@@ -147,12 +167,13 @@ class BoxAdapter : BaseRecyclerAdapter<HomeBoxListEntity, RecyclerView.ViewHolde
var item_tv_sales_volume: TextView? var item_tv_sales_volume: TextView?
var item_tv_min_max_price: TextView? var item_tv_min_max_price: TextView?
var item_img_goos: RecycleImageView? var item_img_goos: RecycleImageView?
var item_ll: LinearLayout? var item_ll: RelativeLayout?
var item_rl_goods: RecyclerView? var item_rl_goods: RecyclerView?
var id_tv_one_lottery: TextView? var id_tv_one_lottery: TextView?
var id_tv_new_people_price: TextView? var id_tv_new_people_price: TextView?
var id_new_user_box_tips: TextView? var id_new_user_box_tips: TextView?
var id_rl_new_people: RelativeLayout? var id_rl_new_people: RelativeLayout?
var id_img_new_people: ImageView?
constructor( constructor(
itemView: View itemView: View
...@@ -168,7 +189,8 @@ class BoxAdapter : BaseRecyclerAdapter<HomeBoxListEntity, RecyclerView.ViewHolde ...@@ -168,7 +189,8 @@ class BoxAdapter : BaseRecyclerAdapter<HomeBoxListEntity, RecyclerView.ViewHolde
id_rl_new_people = itemView.findViewById<RelativeLayout>(R.id.id_rl_new_people) id_rl_new_people = itemView.findViewById<RelativeLayout>(R.id.id_rl_new_people)
item_img_goos = itemView.findViewById<RecycleImageView>(R.id.id_img_goods) item_img_goos = itemView.findViewById<RecycleImageView>(R.id.id_img_goods)
item_rl_goods = itemView.findViewById<RecyclerView>(R.id.id_rl_goods) item_rl_goods = itemView.findViewById<RecyclerView>(R.id.id_rl_goods)
item_ll = itemView.findViewById<LinearLayout>(R.id.id_ll_item) item_ll = itemView.findViewById<RelativeLayout>(R.id.id_ll_item)
id_img_new_people = itemView.findViewById<ImageView>(R.id.id_img_new_people)
} }
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout 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="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_ffffff_r5"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_ffffff_r5"
android:orientation="vertical">
<com.zxhl.cms.widget.RecycleImageView <com.zxhl.cms.widget.RecycleImageView
android:id="@+id/id_img_goods" android:id="@+id/id_img_goods"
...@@ -206,4 +209,12 @@ ...@@ -206,4 +209,12 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" /> android:layout_marginRight="10dp" />
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/id_img_new_people"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:src="@drawable/biaoqianxinren"
android:visibility="visible" />
</RelativeLayout>
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