feat: fix int exp arrive sub list
This commit is contained in:
11
module_base/src/main/res/drawable/ic_new_expand.xml
Normal file
11
module_base/src/main/res/drawable/ic_new_expand.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="1408dp"
|
||||
android:height="1024dp"
|
||||
android:viewportWidth="1408"
|
||||
android:viewportHeight="1024">
|
||||
|
||||
<path
|
||||
android:fillColor="#599dff"
|
||||
android:pathData="M1327.05296 200.971963H427.464174c-38.280374 0-76.560748-38.280374-76.560747-76.560748s31.900312-76.560748 76.560747-76.560748h899.588786c38.280374 0 76.560748 38.280374 76.560747 76.560748s-31.900312 76.560748-76.560747 76.560748zM669.906542 519.975078v-12.760125c-6.380062-19.140187-12.760125-31.900312-25.520249-44.660436l-25.520249-25.520249h708.186916c44.660436 0 76.560748 31.900312 76.560747 76.560748s-31.900312 76.560748-76.560747 76.560747H618.866044l25.520249-25.520249c12.760125-12.760125 19.140187-25.520249 25.520249-44.660436zM350.903427 513.595016L25.520249 169.071651C12.760125 149.931464 0 130.791277 0 98.890966s12.760125-51.040498 25.520249-70.180686c38.280374-38.280374 95.700935-38.280374 133.981309 0l382.803738 401.943926 25.520249 25.520249c12.760125 12.760125 19.140187 25.520249 25.520249 44.660436V513.595016c-6.380062 25.520249-12.760125 38.280374-25.520249 51.040498L542.305296 590.155763 159.501558 992.099688c-19.140187 19.140187-44.660436 31.900312-63.800623 31.900312-25.520249 0-51.040498-12.760125-63.800623-31.900312-19.140187-12.760125-31.900312-38.280374-31.900312-63.800623s12.760125-51.040498 25.520249-70.180685L350.903427 513.595016z m76.560747 312.623053h899.588786c38.280374 0 76.560748 38.280374 76.560747 76.560747s-31.900312 76.560748-76.560747 76.560748H427.464174c-38.280374 0-76.560748-38.280374-76.560747-76.560748s38.280374-76.560748 76.560747-76.560747z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.lukouguoji.gjc.holder
|
||||
|
||||
import android.view.View
|
||||
import com.lukouguoji.gjc.databinding.ItemIntExpArriveSubBinding
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GjcHaWb
|
||||
|
||||
/**
|
||||
* 国际出港-出港理货 子订单(分单) ViewHolder
|
||||
*/
|
||||
class IntExpArriveSubViewHolder(view: View) :
|
||||
BaseViewHolder<GjcHaWb, ItemIntExpArriveSubBinding>(view) {
|
||||
|
||||
override fun onBind(item: Any?, position: Int) {
|
||||
val bean = getItemBean(item) ?: return
|
||||
binding.bean = bean
|
||||
binding.position = position + 1 // 序号从 1 开始
|
||||
binding.executePendingBindings()
|
||||
|
||||
// checkbox点击切换选择状态
|
||||
binding.ivCheckbox.setOnClickListener {
|
||||
bean.checked.set(!bean.checked.get())
|
||||
binding.executePendingBindings()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,8 +37,8 @@ class IntExpArriveViewHolder(view: View) :
|
||||
// ========== 初始化子列表 RecyclerView ==========
|
||||
setCommonAdapter(
|
||||
binding.rvSub,
|
||||
IntExpTallySubViewHolder::class.java,
|
||||
R.layout.item_int_exp_tally_sub
|
||||
IntExpArriveSubViewHolder::class.java,
|
||||
R.layout.item_int_exp_arrive_sub
|
||||
)
|
||||
|
||||
// 刷新子列表数据
|
||||
|
||||
@@ -101,9 +101,9 @@
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:onClick="@{()-> viewModel.toggleAllExpand()}"
|
||||
android:padding="2dp"
|
||||
android:padding="4dp"
|
||||
android:scaleType="fitCenter"
|
||||
loadImage="@{viewModel.isAllExpanded ? R.mipmap.img_up : R.mipmap.img_down}"
|
||||
loadImage="@{viewModel.isAllExpanded ? R.drawable.ic_new_expand : R.drawable.ic_new_expand}"
|
||||
android:contentDescription="展开/收起全部子列表" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -108,13 +108,13 @@
|
||||
|
||||
<!-- 全局展开/收起按钮 -->
|
||||
<ImageView
|
||||
loadImage="@{viewModel.isAllExpanded ? R.mipmap.img_up : R.mipmap.img_down}"
|
||||
loadImage="@{viewModel.isAllExpanded ? R.drawable.ic_new_expand : R.drawable.ic_new_expand}"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:contentDescription="展开/收起全部子列表"
|
||||
android:onClick="@{()-> viewModel.toggleAllExpand()}"
|
||||
android:padding="2dp"
|
||||
android:padding="4dp"
|
||||
android:scaleType="fitCenter" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -102,9 +102,9 @@
|
||||
android:layout_height="36dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:onClick="@{()-> viewModel.toggleAllExpand()}"
|
||||
android:padding="2dp"
|
||||
android:padding="4dp"
|
||||
android:scaleType="fitCenter"
|
||||
loadImage="@{viewModel.isAllExpanded ? R.mipmap.img_up : R.mipmap.img_down}"
|
||||
loadImage="@{viewModel.isAllExpanded ? R.drawable.ic_new_expand : R.drawable.ic_new_expand}"
|
||||
android:contentDescription="展开/收起全部子列表" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
140
module_gjc/src/main/res/layout/item_int_exp_arrive_sub.xml
Normal file
140
module_gjc/src/main/res/layout/item_int_exp_arrive_sub.xml
Normal file
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:loadImage="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<variable
|
||||
name="bean"
|
||||
type="com.lukouguoji.module_base.bean.GjcHaWb" />
|
||||
|
||||
<variable
|
||||
name="position"
|
||||
type="Integer" />
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginVertical="8dp"
|
||||
android:paddingHorizontal="10dp">
|
||||
|
||||
<!-- 选项 - 圆形checkbox -->
|
||||
<ImageView
|
||||
android:id="@+id/iv_checkbox"
|
||||
loadImage="@{bean.checked.get() ? @drawable/radiobtn_checked_gray : @drawable/radiobtn_unchecked_gray}"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="0.5"
|
||||
app:tint="@color/color_66"
|
||||
android:src="@drawable/radiobtn_unchecked_style" />
|
||||
|
||||
<!-- 分单号 (前缀-编号-H编号) -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1.2"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.hno ?? ``}"
|
||||
android:textColor="@color/colorPrimary"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 件数 -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:gravity="center"
|
||||
android:text="@{String.valueOf(bean.hpc ?? bean.pc)}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 重量 -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.8"
|
||||
android:gravity="center"
|
||||
android:text="@{String.valueOf((int)(bean.hweight ?? bean.weight))}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 申报状态 -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.arrivalStatus ?? ``}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 品名(中) -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.goodsCn ?? bean.goods}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 申报次数 -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.9"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.arrivalSCount != null ? String.valueOf((int)bean.arrivalSCount.doubleValue()) : `0`}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 申报费率 -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.9"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.arrivalSRate != null ? String.valueOf(bean.arrivalSRate) : `0`}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 删除次数 -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.9"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.arrivalDCount != null ? String.valueOf((int)bean.arrivalDCount.doubleValue()) : `0`}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<!-- 删除费率 -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.9"
|
||||
android:gravity="center"
|
||||
android:text="@{bean.arrivalDRate != null ? String.valueOf(bean.arrivalDRate) : `0`}"
|
||||
android:textColor="@color/text_normal"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.divider.MaterialDivider
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="@color/c999999" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</layout>
|
||||
Reference in New Issue
Block a user