app/src/main/java/com/xw/yunwei/model/CarOperationRecordModel.kt
@@ -1,6 +1,7 @@ package com.xw.yunwei.model import com.google.gson.annotations.SerializedName import com.xw.yunwei.extension.dateChangePattern import java.util.Date /** @@ -81,4 +82,10 @@ */ @SerializedName("vehiclePictures") val vehiclePictures: String? = null ) ){ //获取显示操作时间 fun getShowOperationTime(): String?{ return operationTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") } } app/src/main/java/com/xw/yunwei/model/CarRecordChargeModel.kt
@@ -1,6 +1,7 @@ package com.xw.yunwei.model import com.google.gson.annotations.SerializedName import com.xw.yunwei.extension.dateChangePattern /** * 车辆充电记录实体类 @@ -160,4 +161,15 @@ */ @SerializedName("vehiclePictures") val vehiclePictures: String? = null ) ){ //获取显示开始充电时间 fun getShowStartTime(): String?{ return startTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") } //获取显示结束充电时间 fun getShowEndTime(): String?{ return endTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") } } app/src/main/java/com/xw/yunwei/model/CarRecordCheckModel.kt
@@ -1,6 +1,7 @@ package com.xw.yunwei.model import com.google.gson.annotations.SerializedName import com.xw.yunwei.extension.dateChangePattern /** * 车辆检测记录实体类 @@ -217,4 +218,10 @@ */ @SerializedName("versionVerification") val versionVerification: Int? = null ) ){ //获取显示操作时间 fun getShowOperationTime(): String?{ return operationTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") } } app/src/main/java/com/xw/yunwei/model/CarRecordCleanModel.kt
@@ -1,6 +1,7 @@ package com.xw.yunwei.model import com.google.gson.annotations.SerializedName import com.xw.yunwei.extension.dateChangePattern /** * 车辆任务完成记录实体类 @@ -117,4 +118,9 @@ /** 测试模式 */ const val MODE_TEST = 2 } //获取显示操作时间 fun getShowOperationTime(): String?{ return operationTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") } } app/src/main/java/com/xw/yunwei/model/CarRecordMaintainModel.kt
@@ -1,6 +1,7 @@ package com.xw.yunwei.model import com.google.gson.annotations.SerializedName import com.xw.yunwei.extension.dateChangePattern /** * 车辆整备记录VO @@ -184,4 +185,9 @@ /** 测试模式 */ const val MODE_TEST = 2 } //获取显示操作时间 fun getShowOperationTime(): String?{ return operationTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") } } app/src/main/java/com/xw/yunwei/model/CarRecordRepairModel.kt
@@ -1,5 +1,6 @@ package com.xw.yunwei.model import com.google.gson.annotations.SerializedName import com.xw.yunwei.extension.dateChangePattern /** * 车辆维修记录实体类 @@ -164,4 +165,24 @@ /** 测试模式 */ const val MODE_TEST = 2 } //获取显示开始时间 fun getShowStartTime(): String?{ return startTime?.dateChangePattern("yyyy年MM月dd日","yyyy/MM/dd") } //获取显示结束时间 fun getShowEndTime(): String?{ return endTime?.dateChangePattern("yyyy年MM月dd日","yyyy/MM/dd") } //获取显示送修时间 fun getShowSendTime(): String?{ return sendTime?.dateChangePattern("yyyy年MM月dd日 HH:mm:ss","yyyy/MM/dd HH:mm:ss") } //获取显示取回时间 fun getShowReturnTime(): String?{ return returnTime?.dateChangePattern("yyyy年MM月dd日 HH:mm:ss","yyyy/MM/dd HH:mm:ss") } } app/src/main/java/com/xw/yunwei/model/TaskNormalRepairModel.kt
@@ -183,12 +183,23 @@ @SerializedName("vehicleLocation") val vehicleLocation: String? = null ) { //获取显示开始时间 fun getShowStartTime(): String?{ return startTime?.dateChangePattern("yyyy年MM月dd日","yyyy/MM/dd") } //获取显示结束时间 fun getShowEndTime(): String?{ return endTime?.dateChangePattern("yyyy年MM月dd日","yyyy/MM/dd") } //获取显示送修时间 fun getShowSendTime(): String?{ return sendTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") return sendTime?.dateChangePattern("yyyy年MM月dd日 HH:mm:ss","yyyy/MM/dd HH:mm:ss") } //获取显示取回时间 fun getShowReturnTime(): String?{ return returnTime?.dateChangePattern("yyyy-MM-dd HH:mm:ss","yyyy/MM/dd HH:mm:ss") return returnTime?.dateChangePattern("yyyy年MM月dd日 HH:mm:ss","yyyy/MM/dd HH:mm:ss") } } app/src/main/java/com/xw/yunwei/ui/work/car/detail/operations/check/CheckCarActivity.kt
@@ -1,8 +1,10 @@ package com.xw.yunwei.ui.work.car.detail.operations.check import android.annotation.SuppressLint import android.net.Uri import android.util.TypedValue import android.widget.TextView import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.net.toUri import androidx.lifecycle.MutableLiveData import androidx.recyclerview.widget.GridLayoutManager import com.blankj.utilcode.util.UriUtils @@ -22,15 +24,18 @@ import com.xw.yunwei.R import com.xw.yunwei.databinding.ActivityCarCheckBinding import com.xw.yunwei.extension.colorIdToColorValue import com.xw.yunwei.extension.dpToPx import com.xw.yunwei.model.CarModel import com.xw.yunwei.model.CheckRecordModel import com.xw.yunwei.utils.PictureSelectorFactory import androidx.core.net.toUri import kotlin.math.max import kotlin.math.min /** * 车辆检测 */ class CheckCarActivity : BaseBusinessActivity<ActivityCarCheckBinding, CheckCarVM>() { private val animationHeight = 100.0 override fun getBindingVariable() = BR.viewModel val adapter by lazy { CheckCarAdapter().apply { setHasStableIds(true) } } @@ -97,6 +102,34 @@ } } override fun setListener() { super.setListener() binding.scrollView.setOnScrollChangeListener { view, scrollX, scrollY, oldScrollX, oldScrollY -> updateHeader(scrollY) } } //更新标题栏 private fun updateHeader(scrollY: Int) { val scrollX = (binding.title.width + binding.basicLayout.width) / 2 + 4.dpToPx(this) val ratio = max(0.0, min(scrollY / animationHeight, 1.0)) binding.title.layoutParams = (binding.title.layoutParams as ConstraintLayout.LayoutParams).apply { val marginTop = (-15).dpToPx(this@CheckCarActivity) + (ratio * 15.dpToPx(this@CheckCarActivity)) val marginEnd = scrollX * ratio setMargins(0, marginTop.toInt(), marginEnd.toInt(), 0) } binding.title.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16 - 2 * ratio.toFloat()) binding.basicLayout.layoutParams = (binding.basicLayout.layoutParams as ConstraintLayout.LayoutParams).apply { val marginStart = scrollX * ratio val marginTop = 10.dpToPx(this@CheckCarActivity) - (ratio * 8.dpToPx(this@CheckCarActivity)) setMargins(marginStart.toInt(), marginTop.toInt(), 0, 0) } } //刷新状态 private fun refreshStatus(textView: TextView, hadChecked: Boolean) { textView.setBackgroundResource(if (hadChecked) R.drawable.shape_green_1_bg_2 else R.drawable.shape_gray_3_bg_2) app/src/main/java/com/xw/yunwei/ui/work/car/detail/operations/repair/record/RecordAdapter.kt
@@ -37,7 +37,7 @@ binding.batteryView2.setBatteryLife(item.endRemainingBattery ?: 0) } it.name.text = item.operatorName it.time.text = item.operationTime it.time.text = item.getShowOperationTime() it.root.setOnClickListener { listener.onItemClick(item) } } } app/src/main/res/layout/activity_car_charge_detail.xml
@@ -161,7 +161,7 @@ android:layout_height="wrap_content" android:layout_weight="1" tools:text="2026-09-31 11:00:09" android:text='@{viewModel.recordInfo.startTime}' android:text='@{viewModel.recordInfo.getShowStartTime()}' android:textColor="@color/gray_7" android:textSize="@dimen/sp_12" /> @@ -278,7 +278,7 @@ android:layout_height="wrap_content" android:layout_weight="1" tools:text="2026-09-31 11:00:09" android:text='@{viewModel.recordInfo.endTime}' android:text='@{viewModel.recordInfo.getShowEndTime()}' android:textColor="@color/gray_7" android:textSize="@dimen/sp_12" /> app/src/main/res/layout/activity_car_check.xml
@@ -34,23 +34,22 @@ android:textColor="@color/gray_10" android:textSize="@dimen/sp_16" android:textStyle="bold" app:layout_constraintBottom_toTopOf="@+id/basicLayout" android:layout_marginTop="-15dp" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="@+id/back" app:layout_constraintTop_toTopOf="@id/back" tools:text="粤A 88934试" /> <LinearLayout android:id="@+id/basicLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_2" android:layout_marginTop="10dp" android:gravity="center_vertical" android:orientation="horizontal" app:layout_constraintBottom_toBottomOf="@+id/back" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/title"> app:layout_constraintTop_toTopOf="@id/back"> <androidx.appcompat.widget.AppCompatTextView android:layout_width="wrap_content" @@ -82,6 +81,7 @@ </LinearLayout> <androidx.core.widget.NestedScrollView android:id="@+id/scrollView" android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginTop="@dimen/dp_88" app/src/main/res/layout/activity_car_check_detail.xml
@@ -321,7 +321,7 @@ android:layout_marginHorizontal="@dimen/dp_20" android:layout_marginTop="@dimen/dp_10" tools:text="2026年 xxxxxxxxx" android:text="@{BindUtils.INSTANCE.formatDate(viewModel.recordInfo.operationTime)}" android:text="@{viewModel.recordInfo.getShowOperationTime()}" android:textColor="@color/gray_7" android:textSize="@dimen/sp_14" app:layout_constraintTop_toBottomOf="@+id/tv8" /> app/src/main/res/layout/activity_car_clean_detail.xml
@@ -163,7 +163,7 @@ android:layout_marginHorizontal="@dimen/dp_20" android:layout_marginTop="@dimen/dp_10" tools:text="2026年 xxxxxxxxx" android:text="@{BindUtils.INSTANCE.formatDate(viewModel.recordInfo.operationTime)}" android:text="@{viewModel.recordInfo.getShowOperationTime()}" android:textColor="@color/gray_7" android:textSize="@dimen/sp_14" app:layout_constraintTop_toBottomOf="@+id/tv8" /> app/src/main/res/layout/activity_car_maintain_detail.xml
@@ -400,7 +400,7 @@ android:layout_marginHorizontal="@dimen/dp_20" android:layout_marginTop="@dimen/dp_10" tools:text="2026年 xxxxxxxxx" android:text="@{BindUtils.INSTANCE.formatDate(viewModel.recordInfo.operationTime)}" android:text="@{viewModel.recordInfo.getShowOperationTime()}" android:textColor="@color/gray_7" android:textSize="@dimen/sp_14" app:layout_constraintTop_toBottomOf="@+id/tv8" /> app/src/main/res/layout/activity_car_repair_detail.xml
@@ -112,7 +112,7 @@ android:layout_marginHorizontal="@dimen/dp_20" android:layout_marginTop="@dimen/dp_10" tools:text="2026年 xxxxxxxxx - 2026年 xxxxxxxxx" android:text='@{BindUtils.INSTANCE.formatDate(viewModel.recordInfo.startTime) + " ~ " + BindUtils.INSTANCE.formatDate(viewModel.recordInfo.endTime)}' android:text='@{viewModel.recordInfo.getShowStartTime() + " ~ " + viewModel.recordInfo.getShowEndTime()}' android:textColor="@color/gray_7" android:textSize="@dimen/sp_14" /> @@ -188,7 +188,7 @@ android:layout_marginHorizontal="@dimen/dp_20" android:layout_marginTop="@dimen/dp_10" tools:text="2026年 xxxxx" android:text="@{BindUtils.INSTANCE.formatDate(viewModel.recordInfo.sendTime)}" android:text="@{viewModel.recordInfo.getShowSendTime()}" android:textColor="@color/gray_7" android:textSize="@dimen/sp_14" /> @@ -303,7 +303,7 @@ android:layout_marginTop="@dimen/dp_10" show="@{viewModel.recordInfo.repairMoney != null}" tools:text="2026年 xxxxx" android:text='@{BindUtils.INSTANCE.formatDate(viewModel.recordInfo.returnTime)}' android:text='@{viewModel.recordInfo.getShowReturnTime()}' android:textColor="@color/gray_7" android:textSize="@dimen/sp_14" /> app/src/main/res/layout/dialog_accident_filter.xml
@@ -61,7 +61,7 @@ android:layout_width="0dp" android:layout_height="0dp" android:layout_marginHorizontal="@dimen/dp_20" android:layout_marginTop="@dimen/dp_20" android:layout_marginTop="@dimen/dp_12" android:layout_weight="1" android:background="@android:color/white" android:scrollbars="vertical" app/src/main/res/layout/item_work_site.xml
@@ -35,18 +35,41 @@ app:layout_constraintTop_toTopOf="parent" app:riv_corner_radius="@dimen/dp_5" /> <LinearLayout android:id="@+id/nav" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/dp_20" android:gravity="center" android:orientation="vertical" app:layout_constraintTop_toTopOf="@id/icon" app:layout_constraintEnd_toEndOf="parent"> <androidx.appcompat.widget.AppCompatImageView android:layout_width="@dimen/dp_10" android:layout_height="@dimen/dp_10" android:src="@mipmap/icon_arrow_blue" /> <androidx.appcompat.widget.AppCompatTextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="去导航" android:textColor="@color/blue_5" android:textSize="@dimen/sp_12" /> </LinearLayout> <androidx.appcompat.widget.AppCompatTextView android:id="@+id/name" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="@dimen/dp_8" android:layout_marginEnd="@dimen/dp_20" android:layout_marginEnd="@dimen/dp_8" android:maxLines="1" android:text="广州市白云机场T2航站楼" android:textColor="@color/gray_9" android:textSize="@dimen/sp_14" android:textStyle="bold" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toStartOf="@id/nav" app:layout_constraintStart_toEndOf="@+id/icon" app:layout_constraintTop_toTopOf="@+id/icon" /> @@ -54,13 +77,12 @@ android:id="@+id/address" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_4" android:layout_marginRight="@dimen/dp_20" android:layout_marginTop="@dimen/dp_10" android:maxLines="2" android:text="深圳市宝安区西大街阳光绿色温馨家园17号楼313" android:textColor="@color/gray_6" android:textSize="@dimen/sp_12" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="@id/name" app:layout_constraintStart_toStartOf="@+id/name" app:layout_constraintTop_toBottomOf="@+id/name" /> @@ -87,31 +109,6 @@ android:visibility="gone" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toBottomOf="@+id/address" /> <LinearLayout android:id="@+id/nav" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/dp_20" android:layout_marginBottom="@dimen/dp_8" android:gravity="center" android:orientation="vertical" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent"> <androidx.appcompat.widget.AppCompatImageView android:layout_width="@dimen/dp_10" android:layout_height="@dimen/dp_10" android:src="@mipmap/icon_arrow_blue" /> <androidx.appcompat.widget.AppCompatTextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="去导航" android:textColor="@color/blue_5" android:textSize="@dimen/sp_12" /> </LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout> <View @@ -135,6 +132,6 @@ android:textColor="@color/gray_9" android:textSize="@dimen/sp_14" android:visibility="gone" tools:visibility="visible" /> /> </FrameLayout> </layout> app/src/main/res/layout/layout_normal_task_car_repair_detail.xml
@@ -31,7 +31,7 @@ android:layout_height="wrap_content" android:layout_marginTop="@dimen/dp_10" tools:text="2026年 xxxxxxxxx - 2026年 xxxxxxxxx" android:text='@{viewModel.repairModel.startTime + " - " + viewModel.repairModel.endTime}' android:text='@{viewModel.repairModel.getShowStartTime() + " - " + viewModel.repairModel.getShowEndTime()}' android:textColor="@color/gray_7" android:textSize="@dimen/sp_14" />