[6.2.4]录包管理修改
This commit is contained in:
@@ -248,6 +248,8 @@ internal object BadCaseManager : LifecycleEventObserver, IMoGoAutopilotRecordLis
|
||||
)
|
||||
} bag录制失败"
|
||||
)
|
||||
//录包失败时,保存录包失败状态
|
||||
BadCaseConfig.bagRecordFailList.add(recordPanel.key)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ import android.os.Handler
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.EditText
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import bag_manager.BagManagerOuterClass
|
||||
@@ -222,6 +224,11 @@ class BadCaseManagerView @JvmOverloads constructor(
|
||||
recordScreenDialog?.showScreenImage(key)
|
||||
}
|
||||
|
||||
override fun startEdit(editText: EditText) {
|
||||
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager?
|
||||
imm?.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT)
|
||||
}
|
||||
|
||||
})
|
||||
val linearLayoutManager = LinearLayoutManager(context)
|
||||
rvBagList.layoutManager = linearLayoutManager
|
||||
|
||||
@@ -568,6 +568,8 @@ class InitiativeBadCaseWindow constructor(activity: Activity) : View.OnTouchList
|
||||
//开始录制
|
||||
if(recordPanel.stat == 300){
|
||||
BadCaseConfig.recordKeyList.add(recordPanel.key)
|
||||
//保存录包状态
|
||||
BadCaseConfig.bagResourceList.add(recordPanel.key)
|
||||
//开启高精地图截图
|
||||
CallerMapUIServiceManager.getMapUIController()?.getMapScreenShot()
|
||||
}
|
||||
|
||||
@@ -12,9 +12,13 @@ import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagDescriptionEntity
|
||||
import com.mogo.eagle.core.data.deva.badcase.BagInfoEntity
|
||||
import com.mogo.eagle.core.utilcode.util.FileUtils.millis2String
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import java.text.DecimalFormat
|
||||
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description Bag包管理列表适配器
|
||||
@@ -32,14 +36,14 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
|
||||
if(viewType == 1){
|
||||
return if(viewType == 1){
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_bag_time_title,parent,false)
|
||||
return BagTimeTitleHolder(view)
|
||||
BagTimeTitleHolder(view)
|
||||
}else{
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_bag_manager, parent, false)
|
||||
return BagManagerListHolder(view)
|
||||
BagManagerListHolder(view)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,18 +96,25 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
|
||||
|
||||
bagInfoEntity.description?.let { des->
|
||||
if(des.reportBI){
|
||||
//已上报
|
||||
holder.tvBagReportStatus.text = "已上报"
|
||||
if(BadCaseConfig.bagRecordFailList.contains(bagInfoEntity.key)){
|
||||
//如果在录包失败列表中找到该Bag包,则该包为录包失败状态
|
||||
holder.tvBagReportStatus.text = "录包失败"
|
||||
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_reported_button_bg)
|
||||
holder.tvBagReportStatus.isClickable = false
|
||||
}else{
|
||||
//未上报
|
||||
holder.tvBagReportStatus.text = "上报"
|
||||
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_report_button_bg)
|
||||
holder.tvBagReportStatus.isClickable = true
|
||||
holder.tvBagReportStatus.setOnClickListener {
|
||||
bagClickListener?.uploadBI(bagInfoEntity)
|
||||
if(des.reportBI){
|
||||
//已上报
|
||||
holder.tvBagReportStatus.text = "已上报"
|
||||
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_reported_button_bg)
|
||||
holder.tvBagReportStatus.isClickable = false
|
||||
}else{
|
||||
//未上报
|
||||
holder.tvBagReportStatus.text = "上报"
|
||||
holder.tvBagReportStatus.setBackgroundResource(R.drawable.bag_report_button_bg)
|
||||
holder.tvBagReportStatus.isClickable = true
|
||||
holder.tvBagReportStatus.setOnClickListener {
|
||||
bagClickListener?.uploadBI(bagInfoEntity)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(des.description.isEmpty()){
|
||||
@@ -119,6 +130,25 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
}
|
||||
}
|
||||
|
||||
//录包来源:自动 or 人工
|
||||
if(BadCaseConfig.bagResourceList.contains(bagInfoEntity.key)){
|
||||
//在该列表中找到Bag包的Key则代表该Bag为人工录包
|
||||
holder.tvBagResource.text = "人工"
|
||||
holder.tvBagResource.setBackgroundResource(R.drawable.bag_artificial_button_bg)
|
||||
}else{
|
||||
//自动录包
|
||||
holder.tvBagResource.text = "自动"
|
||||
holder.tvBagResource.setBackgroundResource(R.drawable.bag_auto_button_bg)
|
||||
}
|
||||
|
||||
//编辑文字按钮
|
||||
holder.ivEditReason.setOnClickListener {
|
||||
holder.etBagNameEdit.requestFocus()
|
||||
holder.etBagNameEdit.performClick()
|
||||
//调起软键盘
|
||||
bagClickListener?.startEdit(holder.etBagNameEdit)
|
||||
}
|
||||
|
||||
if(bagInfoEntity.description?.hasAudio == true){
|
||||
holder.ivBagAudio.visibility = View.VISIBLE
|
||||
holder.ivBagAudio.setOnClickListener {
|
||||
@@ -144,6 +174,15 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
//只有当天的Bag才显示查看截图按钮
|
||||
bagInfoEntity.timestamp.let {day ->
|
||||
val currentDay = millis2String(System.currentTimeMillis(), TimeUtils.getMdFormatTwo())
|
||||
if(day.contains(currentDay)){
|
||||
holder.ivMapScreen.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,6 +206,8 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
var tvBagTime: TextView = itemView.findViewById(R.id.tvBagTime)
|
||||
var tvBagSize: TextView = itemView.findViewById(R.id.tvBagSize)
|
||||
var ivMapScreen: ImageView = itemView.findViewById(R.id.ivMapScreen)
|
||||
var tvBagResource: TextView = itemView.findViewById(R.id.tvBagResource)
|
||||
var ivEditReason: ImageView = itemView.findViewById(R.id.ivEditReason)
|
||||
}
|
||||
|
||||
fun setListener(listener: BagClickListener){
|
||||
@@ -184,6 +225,8 @@ class BagManagerListAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder>() {
|
||||
fun bagAudio(key: Long,audioUrl: String)
|
||||
//查看高精地图截图
|
||||
fun lookMapScreen(key: Long)
|
||||
//点击按钮调起编辑Bag包信息
|
||||
fun startEdit(editText: EditText)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,5 +37,11 @@ object BadCaseConfig {
|
||||
//Bag包管理列表
|
||||
@JvmField
|
||||
var bagManagerList: ArrayList<BagInfoEntity> = ArrayList()
|
||||
//Bag包来源,将主动录包的Key保存在该列表中,不在该列表中的在录包管理页面的Bag包视为被动录包
|
||||
@JvmField
|
||||
var bagResourceList: ArrayList<Long> = ArrayList()
|
||||
//Bag包录包失败状态列表,当Bag录制失败时保存在该列表,当Bag包在该列表中不存在时即视为录包成功
|
||||
@JvmField
|
||||
var bagRecordFailList: ArrayList<Long> = ArrayList()
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#E53BC593"
|
||||
android:endColor="#E53BC593"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="8px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:startColor="#E52966EC"
|
||||
android:endColor="#E52966EC"
|
||||
android:angle="0"
|
||||
/>
|
||||
<corners android:radius="8px" />
|
||||
</shape>
|
||||
@@ -17,25 +17,56 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBagNameEdit"
|
||||
android:layout_width="0dp"
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:orientation="horizontal"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etBagNameEdit"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@id/guideline"
|
||||
app:layout_constraintLeft_toRightOf="@id/cbBagSelect"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvBagTime"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="30dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/tvBagResource"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
android:background="@null"
|
||||
android:drawableEnd="@drawable/icon_bag_edit"
|
||||
android:drawablePadding="@dimen/dp_10"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="32dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="@dimen/dp_26"
|
||||
android:gravity="start"
|
||||
app:layout_constraintTop_toBottomOf="@id/guideline"
|
||||
app:layout_constraintLeft_toLeftOf="@id/etBagNameEdit"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagSize"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#72FFFFFF"
|
||||
android:textSize="26dp"
|
||||
app:layout_constraintTop_toTopOf="@id/tvBagTime"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tvBagTime"
|
||||
app:layout_constraintStart_toEndOf="@id/tvBagTime"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
/>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagReportStatus"
|
||||
android:layout_width="162dp"
|
||||
@@ -59,7 +90,7 @@
|
||||
app:layout_constraintRight_toLeftOf="@id/tvBagReportStatus"
|
||||
android:src="@drawable/icon_bag_audio"
|
||||
android:visibility="invisible"
|
||||
android:layout_marginEnd="30dp"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
@@ -70,30 +101,36 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/ivBagAudio"
|
||||
android:src="@drawable/icon_bad_case_audio_select"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
android:visibility="invisible"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagTime"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="26dp"
|
||||
<ImageView
|
||||
android:id="@+id/ivEditReason"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_44"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/ivMapScreen"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:gravity="start"
|
||||
android:src="@drawable/icon_bag_edit"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBagSize"
|
||||
android:id="@+id/tvBagResource"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#75FFFFFF"
|
||||
android:textSize="26dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvBagTime"
|
||||
|
||||
app:layout_constraintRight_toLeftOf="@id/ivEditReason"
|
||||
android:background="@drawable/bag_auto_button_bg"
|
||||
android:textSize="@dimen/sp_25"
|
||||
android:textColor="@color/white"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:paddingTop="@dimen/dp_4"
|
||||
android:paddingBottom="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_25"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -51,6 +51,10 @@ public final class TimeUtils {
|
||||
return getSafeDateFormat("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
public static SimpleDateFormat getMdFormatTwo(){
|
||||
return getSafeDateFormat("yyyyMMdd");
|
||||
}
|
||||
|
||||
public static SimpleDateFormat getHourMinSecondFormat(){
|
||||
return getSafeDateFormat("HH:mm:ss");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user