车辆挂车行驶证新增编辑添加查看大图,以及优化更换图片功能
This commit is contained in:
parent
69e803d48b
commit
392fcf61a8
@ -2,6 +2,7 @@ package com.arpa.hndahesudintocctmsdriver.ui.account.authperson
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.base.AppConfig
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.DiCarColor
|
||||
@ -44,12 +45,20 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
plateColor = "黄色"
|
||||
}
|
||||
ivFront.setOnClickListener {
|
||||
if (showPic(upDrivingInfoBean.licenseFaceUrl, ivFront))
|
||||
return@setOnClickListener
|
||||
selFrontPic()
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
if (showPic(upDrivingInfoBean.licenseBackUrl, ivBack))
|
||||
return@setOnClickListener
|
||||
selBackPic()
|
||||
}
|
||||
|
||||
tvChangeFront.setOnClickListener { selFrontPic() }
|
||||
tvChangeBack.setOnClickListener { selBackPic() }
|
||||
|
||||
tvCarType.setOnClickListener {
|
||||
//车辆类型
|
||||
DicUtils.getInstance()
|
||||
@ -121,8 +130,8 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
etUseNature.isEnabled = false
|
||||
tvEnd.isEnabled = false
|
||||
tvCarColor.isEnabled = false
|
||||
ivFront.isEnabled = false
|
||||
ivBack.isEnabled = false
|
||||
// ivFront.isEnabled = false
|
||||
// ivBack.isEnabled = false
|
||||
}
|
||||
}
|
||||
binding.run {
|
||||
@ -131,6 +140,11 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.licenseBackUrl, 12, ivBack)
|
||||
ImageLoader.getInstance()
|
||||
tvChangeFront.visibility =
|
||||
if (data.licenseFaceUrl.isNullOrEmpty() || isOnlyShow) View.GONE else View.VISIBLE
|
||||
tvChangeBack.visibility =
|
||||
if (data.licenseBackUrl.isNullOrEmpty() || isOnlyShow) View.GONE else View.VISIBLE
|
||||
|
||||
|
||||
etHdzzz.setText(data.approvedLoad)
|
||||
etCarNum.setText(data.vehicleNum)
|
||||
@ -188,6 +202,7 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
binding.run {
|
||||
etCarNum.setText(it.licensePlateNumber)
|
||||
etUseNature.setText(it.useNature)
|
||||
tvChangeFront.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -220,6 +235,7 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
if (it.permittedWeight.contains("kg")) it.permittedWeight.split("kg")[0] else ""
|
||||
}
|
||||
binding.run {
|
||||
tvChangeBack.visibility = View.VISIBLE
|
||||
etHdzzz.setText(upDrivingInfoBean.approvedLoad)
|
||||
tvInfo.text = it.overallDimension
|
||||
}
|
||||
@ -252,7 +268,17 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
}
|
||||
}
|
||||
}
|
||||
private fun showPic(url: String, image: ImageView): Boolean {
|
||||
if (!url.isNullOrEmpty()) {
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
image, url
|
||||
)
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
private fun subMint() {
|
||||
|
||||
|
@ -38,8 +38,7 @@
|
||||
android:id="@+id/tvInfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/dp_20"
|
||||
/>
|
||||
android:textSize="@dimen/dp_20" />
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
@ -59,6 +58,7 @@
|
||||
android:layout_gravity="center_horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvDriverTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_14"
|
||||
@ -77,6 +77,21 @@
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/driving_front"></ImageView>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvChangeFront"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:gravity="right"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="@string/change_pic"
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
@ -87,11 +102,26 @@
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/driving_back"></ImageView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvChangeBack"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginRight="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:gravity="right"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:text="@string/change_pic"
|
||||
android:textColor="@color/main_red"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone" />
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@ -188,9 +218,9 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:drawableLeft="@drawable/start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/start"
|
||||
android:maxWidth="@dimen/dp_100"
|
||||
android:text="使用性质"
|
||||
android:textColor="@color/black"
|
||||
@ -218,9 +248,9 @@
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:drawableLeft="@drawable/start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/start"
|
||||
android:maxWidth="@dimen/dp_100"
|
||||
android:text="核定载质量"
|
||||
android:textColor="@color/black"
|
||||
@ -233,13 +263,12 @@
|
||||
android:layout_marginLeft="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:inputType="number"
|
||||
android:gravity="right|center_vertical"
|
||||
android:hint="请输入车辆核定载质量"
|
||||
android:inputType="number"
|
||||
android:paddingRight="@dimen/dp_10"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15"
|
||||
></EditText>
|
||||
android:textSize="@dimen/sp_15"></EditText>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@ -273,11 +302,11 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@ -298,8 +327,7 @@
|
||||
android:hint="请选择有效期至"
|
||||
android:paddingLeft="@dimen/dp_10"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15"
|
||||
></TextView>
|
||||
android:textSize="@dimen/sp_15"></TextView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@ -307,8 +335,6 @@
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
Loading…
Reference in New Issue
Block a user