道路运输证展示大图以及跟换图片优化
This commit is contained in:
parent
c9ccb02a84
commit
c749e14c00
@ -9,6 +9,7 @@ import com.arpa.hndahesudintocctmsdriver.databinding.ActivityAuthRoadBinding
|
||||
import com.arpa.hndahesudintocctmsdriver.net.BaseObserver
|
||||
import com.arpa.hndahesudintocctmsdriver.net.DataManager
|
||||
import com.arpa.hndahesudintocctmsdriver.net.RxHttpCallBack
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.CommonPopUtils
|
||||
import com.arpa.hndahesudintocctmsdriver.utils.OcrUtils
|
||||
import com.arpa.mylibrary.base.BaseActivity
|
||||
import com.arpa.mylibrary.net.CommonResponseBean
|
||||
@ -43,6 +44,24 @@ class EditRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
|
||||
}
|
||||
}
|
||||
ivFront.setOnClickListener {
|
||||
if (upRoad.roadLicensePhotoUrl.isNullOrEmpty()) {
|
||||
OcrUtils.getInstance()
|
||||
.noOcrUpPic(mContext, this@EditRoadActivity) { picPath, ocrResult ->
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, ivFront)
|
||||
upRoad.roadLicensePhotoUrl = picPath.picPath
|
||||
tvChangeRoad.visibility = View.VISIBLE
|
||||
}
|
||||
} else {
|
||||
CommonPopUtils.getInstance().showOnePic(
|
||||
mContext,
|
||||
ivFront, upRoad.roadLicensePhotoUrl
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
tvChangeRoad.setOnClickListener {
|
||||
OcrUtils.getInstance()
|
||||
.noOcrUpPic(mContext, this@EditRoadActivity) { picPath, ocrResult ->
|
||||
ImageLoader.getInstance()
|
||||
@ -74,12 +93,14 @@ class EditRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
|
||||
llBtn.visibility = View.GONE
|
||||
etID.isEnabled = false
|
||||
tvDate.isEnabled = false
|
||||
ivFront.isEnabled = false
|
||||
// ivFront.isEnabled = false
|
||||
}
|
||||
}
|
||||
binding.run {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.roadLicensePhotoUrl, 12, ivFront)
|
||||
tvChangeRoad.visibility =
|
||||
if (data.roadLicense.isNullOrEmpty() || isOnlyShow) View.GONE else View.VISIBLE
|
||||
|
||||
etID.setText(data.roadLicense)
|
||||
tvDate.text = data.roadLicenseValidity
|
||||
|
@ -57,18 +57,34 @@
|
||||
android:layout_marginBottom="@dimen/dp_22"
|
||||
android:background="@drawable/road" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvChangeRoad"
|
||||
android:layout_width="@dimen/dp_155"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginBottom="@dimen/dp_26"
|
||||
android:gravity="right"
|
||||
android:paddingRight="@dimen/dp_4"
|
||||
android:text="@string/change_pic"
|
||||
android:textColor="@color/main_red"
|
||||
android:textSize="@dimen/dp_16"
|
||||
android:textStyle="bold"
|
||||
android:visibility="gone"
|
||||
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginLeft="@dimen/dp_15"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginRight="@dimen/dp_15"
|
||||
android:visibility="gone"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
app:cardCornerRadius="@dimen/dp_8">
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user