Commit 509d282d authored by shiyl's avatar shiyl

优化确认订单UI

parent 3bb6e62d
package com.yidian.shenghuoquan.buserorder.adapter
import android.annotation.SuppressLint
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.bumptech.glide.Glide
import com.bumptech.glide.load.resource.bitmap.CenterCrop
import com.bumptech.glide.load.resource.bitmap.CenterInside
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.bumptech.glide.request.RequestOptions
import com.chad.library.adapter.base.BaseQuickAdapter
......@@ -26,14 +28,17 @@ class OrderConfirmCommodityListAdapter : BaseQuickAdapter<GoodsDto, BaseViewHold
holder.getView<TextView>(R.id.tv_commodity_count).text = "共" + item.goodsNum + "件"
holder.getView<TextView>(R.id.tv_commodity_amount).text = "¥" + String.format("%.2f", item.price)
val ivCommodityPic = holder.getView<ImageView>(R.id.iv_commodity_pic)
val space = holder.getView<View>(R.id.view_space)
if (item.picUrl.isBlank()) {
ivCommodityPic.hide()
space.hide()
} else {
ivCommodityPic.show()
space.show()
Glide.with(context).load(item.picUrl)
.apply(
RequestOptions()
.transform(CenterCrop(), RoundedCorners(DensityUtil.dp2px(10F)))
.transform(CenterInside(), RoundedCorners(DensityUtil.dp2px(10F)))
.error(R.drawable.img_order_commodity_placeholder)
.placeholder(R.drawable.img_order_commodity_placeholder)
)
......
......@@ -232,7 +232,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toTopOf="parent"
tools:text="活动名称" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_goods_list"
......@@ -337,47 +338,55 @@
android:id="@+id/tv_discount_amount_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="@string/already_discount"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp14"
app:isShow="@{vm.couponAmountValue > 0}"
app:layout_constraintBaseline_toBaselineOf="@id/tv_goods_total_amount"
app:layout_constraintEnd_toStartOf="@id/tv_discount_amount" />
app:layout_constraintBottom_toBottomOf="@id/tv_goods_total_amount"
app:layout_constraintEnd_toStartOf="@id/tv_discount_amount"
app:layout_constraintTop_toTopOf="@id/tv_goods_total_amount" />
<TextView
android:id="@+id/tv_discount_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:layout_marginEnd="@dimen/dp10"
android:text="@{@string/amount(vm.couponAmountValue)}"
android:textColor="@color/color_FD7823"
android:textSize="@dimen/sp14"
app:isShow="@{vm.couponAmountValue > 0}"
app:layout_constraintBaseline_toBaselineOf="@id/tv_goods_total_amount"
app:layout_constraintBottom_toBottomOf="@id/tv_goods_total_amount"
app:layout_constraintEnd_toStartOf="@id/tv_goods_total_title"
app:layout_constraintTop_toTopOf="@id/tv_goods_total_amount"
tools:text="¥ 10.00" />
<TextView
android:id="@+id/tv_goods_total_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="@string/total_amount"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp14"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="@id/tv_goods_total_amount"
app:layout_constraintEnd_toStartOf="@id/tv_goods_total_before" />
app:layout_constraintBottom_toBottomOf="@id/tv_goods_total_amount"
app:layout_constraintEnd_toStartOf="@id/tv_goods_total_before"
app:layout_constraintTop_toTopOf="@id/tv_goods_total_amount" />
<TextView
android:id="@+id/tv_goods_total_before"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="@string/renminbi"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp14"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="@id/tv_goods_total_amount"
app:layout_constraintEnd_toStartOf="@id/tv_goods_total_amount" />
app:layout_constraintBottom_toBottomOf="@id/tv_goods_total_amount"
app:layout_constraintEnd_toStartOf="@id/tv_goods_total_amount"
app:layout_constraintTop_toTopOf="@id/tv_goods_total_amount" />
<TextView
android:id="@+id/tv_goods_total_amount"
......@@ -488,6 +497,7 @@
android:id="@+id/tv_total_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp5"
android:text="合计:"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp14"
......@@ -499,6 +509,7 @@
android:id="@+id/tv_price_symbol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp5"
android:text="@string/renminbi"
android:textColor="@color/color_FB4653"
android:textSize="@dimen/sp14"
......@@ -515,7 +526,6 @@
android:textColor="@color/color_FB4653"
android:textSize="@dimen/sp24"
android:textStyle="bold"
app:layout_constraintBaseline_toBaselineOf="@id/tv_total_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_pay_now"
app:layout_constraintTop_toTopOf="parent"
......
......@@ -10,6 +10,7 @@
android:id="@+id/iv_commodity_pic"
android:layout_width="@dimen/dp82"
android:layout_height="@dimen/dp60"
android:scaleType="centerInside"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0"
......@@ -17,11 +18,18 @@
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/img_order_commodity_placeholder" />
<View
android:id="@+id/view_space"
android:layout_width="@dimen/dp8"
android:layout_height="1dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_commodity_pic"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_commodity_name"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp8"
android:ellipsize="end"
android:includeFontPadding="false"
android:maxLines="1"
......@@ -29,7 +37,7 @@
android:textSize="@dimen/sp15"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_commodity_pic"
app:layout_constraintStart_toEndOf="@id/view_space"
app:layout_constraintTop_toTopOf="parent"
tools:text="肉末茄子+蔬蒸蛋套餐+肉沫豆角+清蒸鲈鱼收到分身乏术" />
......
......@@ -14,7 +14,7 @@
<string name="coupons_available_num">张优惠券可用</string>
<string name="already_discount">已优惠</string>
<string name="renminbi">¥</string>
<string name="total_amount">合计:</string>
<string name="total_amount">合计</string>
<string name="order_info">订单信息</string>
<string name="order_no">订单编号</string>
<string name="copy">复制</string>
......
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