BadCase自定义Topic
This commit is contained in:
@@ -1,35 +1,35 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.RadioButton
|
||||
import android.widget.RadioGroup
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.mogo.eagle.core.data.badcase.RecordTypeEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.SizeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.RecordTemplateAdapter
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.consts.BadCaseConfig
|
||||
import kotlinx.android.synthetic.main.layout_badcase_config.view.*
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import java.lang.Exception
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase上报信息配置页面
|
||||
* @since: 2022/7/5
|
||||
*/
|
||||
internal class BadCaseConfigView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotRecordListener {
|
||||
|
||||
companion object {
|
||||
@@ -37,18 +37,21 @@ defStyleAttr: Int = 0
|
||||
}
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
private var recordTemplateAdapter: RecordTemplateAdapter? = null
|
||||
private var mIdentity = BadCaseConfig.identity
|
||||
private var mPreviousDuration = BadCaseConfig.previousDuration
|
||||
private var mBackDuration = BadCaseConfig.backDuration
|
||||
private var mType = 1
|
||||
private var recordTypesList = ArrayList<RecordTypeEntity>()
|
||||
private var caseTopicListDialog: CaseTopicListDialog? = null
|
||||
|
||||
init{
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.layout_badcase_config, this, true)
|
||||
background = ColorDrawable(Color.parseColor("#F0151D41"))
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
private fun initView() {
|
||||
//关闭BadCase配置窗口
|
||||
ivConfigClose.setOnClickListener {
|
||||
clickListener?.onClose()
|
||||
@@ -75,41 +78,42 @@ defStyleAttr: Int = 0
|
||||
//保存配置按钮
|
||||
tvConfigSave.setOnClickListener {
|
||||
//判断、保存录制时间信息
|
||||
val preTimeStr=etInitiativePreTime.text.toString()
|
||||
val afterTimeStr=etInitiativeAfterTime.text.toString()
|
||||
val preTimeStr = etInitiativePreTime.text.toString()
|
||||
val afterTimeStr = etInitiativeAfterTime.text.toString()
|
||||
|
||||
try {
|
||||
if(preTimeStr.isEmpty()){
|
||||
if (preTimeStr.isEmpty()) {
|
||||
mPreviousDuration = BadCaseConfig.previousDuration
|
||||
}else{
|
||||
} else {
|
||||
mPreviousDuration = preTimeStr.toInt()
|
||||
}
|
||||
if(afterTimeStr.isEmpty()){
|
||||
if (afterTimeStr.isEmpty()) {
|
||||
mBackDuration = BadCaseConfig.backDuration
|
||||
}else{
|
||||
} else {
|
||||
mBackDuration = afterTimeStr.toInt()
|
||||
}
|
||||
|
||||
if(mPreviousDuration<0 || mPreviousDuration>30){
|
||||
if (mPreviousDuration < 0 || mPreviousDuration > 30) {
|
||||
ToastUtils.showLong("前溯采集时长最长30S")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if(mBackDuration<0 || mBackDuration>300){
|
||||
if (mBackDuration < 0 || mBackDuration > 300) {
|
||||
ToastUtils.showLong("采集总时长最长300S")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if((mPreviousDuration+mBackDuration)<5){
|
||||
if ((mPreviousDuration + mBackDuration) < 5) {
|
||||
ToastUtils.showLong("采集总时长最短5S")
|
||||
return@setOnClickListener
|
||||
}
|
||||
if((mPreviousDuration+mBackDuration)>300){
|
||||
if ((mPreviousDuration + mBackDuration) > 300) {
|
||||
ToastUtils.showLong("采集总时长最长300S")
|
||||
return@setOnClickListener
|
||||
}
|
||||
BadCaseConfig.previousDuration = mPreviousDuration
|
||||
BadCaseConfig.backDuration = mBackDuration
|
||||
BadCaseConfig.totalDuration = BadCaseConfig.previousDuration + BadCaseConfig.backDuration
|
||||
}catch (e: Exception){
|
||||
BadCaseConfig.totalDuration =
|
||||
BadCaseConfig.previousDuration + BadCaseConfig.backDuration
|
||||
} catch (e: Exception) {
|
||||
ToastUtils.showLong("输入时间格式不合法,请重新输入")
|
||||
etInitiativePreTime.text = null
|
||||
etInitiativeAfterTime.text = null
|
||||
@@ -126,14 +130,14 @@ defStyleAttr: Int = 0
|
||||
}
|
||||
|
||||
//现场恢复
|
||||
when(BadCaseConfig.identity){
|
||||
"安全员"->{
|
||||
when (BadCaseConfig.identity) {
|
||||
"安全员" -> {
|
||||
rbSafetyOfficer.isChecked = true
|
||||
}
|
||||
"QA、研发"->{
|
||||
"QA、研发" -> {
|
||||
rbDeveloper.isChecked = true
|
||||
}
|
||||
"产品、运营、演示"->{
|
||||
"产品、运营、演示" -> {
|
||||
rbProduct.isChecked = true
|
||||
}
|
||||
}
|
||||
@@ -141,128 +145,67 @@ defStyleAttr: Int = 0
|
||||
etInitiativePreTime.hint = "${BadCaseConfig.previousDuration}S"
|
||||
etInitiativeAfterTime.hint = "${BadCaseConfig.backDuration}S"
|
||||
|
||||
// val test1 = TestBean(1,"人工接管自动录制")
|
||||
// val test2 = TestBean(2,"地图采集")
|
||||
// val test3 = TestBean(3,"画龙问题排查")
|
||||
// val test4 = TestBean(4,"误识别问题排查")
|
||||
// val test5 = TestBean(5,"lidar+planning")
|
||||
// val test6 = TestBean(6,"camera+planning")
|
||||
// val test7 = TestBean(7,"bus lidar+planning")
|
||||
// val test8 = TestBean(8,"bus camera+planning")
|
||||
// val test99 = TestBean(99,"ai data")
|
||||
//
|
||||
// val list = ArrayList<TestBean>()
|
||||
// list.add(test1)
|
||||
// list.add(test2)
|
||||
// list.add(test3)
|
||||
// list.add(test4)
|
||||
// list.add(test5)
|
||||
// list.add(test6)
|
||||
// list.add(test7)
|
||||
// list.add(test8)
|
||||
// list.add(test99)
|
||||
// list.iterator().forEach {
|
||||
// if(it.id!=99){
|
||||
// val radioButton = RadioButton(context)
|
||||
// val lp = RadioGroup.LayoutParams(
|
||||
// RadioGroup.LayoutParams.WRAP_CONTENT,
|
||||
// RadioGroup.LayoutParams.WRAP_CONTENT
|
||||
// )
|
||||
// //设置RadioButton边距 (int left, int top, int right, int bottom)
|
||||
// lp.setMargins(
|
||||
// SizeUtils.dp2px(0f),
|
||||
// SizeUtils.dp2px(8f),
|
||||
// SizeUtils.dp2px(10f),
|
||||
// SizeUtils.dp2px(8f)
|
||||
// )
|
||||
// //设置RadioButton背景
|
||||
// radioButton.setTextColor(Color.WHITE)
|
||||
//
|
||||
// radioButton.buttonDrawable = resources.getDrawable(R.drawable.badcase_radio_button_style)
|
||||
// //设置文字距离四周的距离
|
||||
// radioButton.setPadding(
|
||||
// SizeUtils.dp2px(12f),
|
||||
// SizeUtils.dp2px(5f),
|
||||
// SizeUtils.dp2px(10f),
|
||||
// SizeUtils.dp2px(5f)
|
||||
// )
|
||||
// radioButton.textSize = SizeUtils.sp2px(9f).toFloat()
|
||||
// radioButton.id = it.id
|
||||
// radioButton.isChecked = it.id == BadCaseConfig.type
|
||||
// //设置文字
|
||||
// radioButton.text = it.src
|
||||
// //将radioButton添加到radioGroup中
|
||||
// rgRecordConfig.addView(radioButton, lp)
|
||||
// rgRecordConfig.setOnCheckedChangeListener { _, checkedId ->
|
||||
// mType = checkedId
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
recordTemplateAdapter = RecordTemplateAdapter()
|
||||
recordTemplateAdapter?.setListener(object :RecordTemplateAdapter.ClickTemplateListener{
|
||||
override fun onClick(recordTypeEntity: RecordTypeEntity) {
|
||||
//弹窗Topic清单列表
|
||||
showCaseTopicListDialog(recordTypeEntity)
|
||||
}
|
||||
|
||||
})
|
||||
val gridLayoutManager = GridLayoutManager(context,2)
|
||||
rvTemplate.layoutManager = gridLayoutManager
|
||||
rvTemplate.adapter = recordTemplateAdapter
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
override fun onAutopilotRecordConfig(config: MessagePad.RecordDataConfig) {
|
||||
super.onAutopilotRecordConfig(config)
|
||||
ThreadUtils.runOnUiThread{
|
||||
config.recordTypesList.iterator().forEach {
|
||||
if(it.id!=99){
|
||||
val radioButton = RadioButton(context)
|
||||
val lp = RadioGroup.LayoutParams(
|
||||
RadioGroup.LayoutParams.WRAP_CONTENT,
|
||||
RadioGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
//设置RadioButton边距 (int left, int top, int right, int bottom)
|
||||
lp.setMargins(
|
||||
SizeUtils.dp2px(0f),
|
||||
SizeUtils.dp2px(8f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(8f)
|
||||
)
|
||||
//设置RadioButton背景
|
||||
radioButton.setTextColor(Color.WHITE)
|
||||
private fun showCaseTopicListDialog(recordTypeEntity: RecordTypeEntity){
|
||||
if(caseTopicListDialog == null){
|
||||
caseTopicListDialog = CaseTopicListDialog(context)
|
||||
}
|
||||
caseTopicListDialog?.setData(recordTypeEntity)
|
||||
caseTopicListDialog?.show()
|
||||
}
|
||||
|
||||
radioButton.buttonDrawable = resources.getDrawable(R.drawable.badcase_radio_button_style)
|
||||
//设置文字距离四周的距离
|
||||
radioButton.setPadding(
|
||||
SizeUtils.dp2px(12f),
|
||||
SizeUtils.dp2px(5f),
|
||||
SizeUtils.dp2px(10f),
|
||||
SizeUtils.dp2px(5f)
|
||||
)
|
||||
radioButton.textSize = SizeUtils.sp2px(9f).toFloat()
|
||||
radioButton.id = it.id
|
||||
radioButton.isChecked = it.id == BadCaseConfig.type
|
||||
//设置文字
|
||||
radioButton.text = it.desc
|
||||
//将radioButton添加到radioGroup中
|
||||
rgRecordConfig.addView(radioButton, lp)
|
||||
rgRecordConfig.setOnCheckedChangeListener { _, checkedId ->
|
||||
mType = checkedId
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
override fun onAutopilotRecordConfig(config: MessagePad.RecordDataConfig) {
|
||||
super.onAutopilotRecordConfig(config)
|
||||
ThreadUtils.runOnUiThread {
|
||||
config.recordTypesList.iterator().forEach {
|
||||
if (it.id != 99){
|
||||
val topicList = ArrayList<String>()
|
||||
it.topicsList.iterator().forEach {
|
||||
topicList.add(it)
|
||||
}
|
||||
recordTypesList.add(RecordTypeEntity(it.id,it.desc,topicList))
|
||||
}
|
||||
}
|
||||
if(recordTypesList.size>1){
|
||||
recordTemplateAdapter?.setData(recordTypesList)
|
||||
recordTemplateAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
//获取数据采集录制模式配置列表 TODO
|
||||
// CallerAutoPilotManager.getBadCaseConfig()
|
||||
}
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutopilotRecordListenerManager.addListener(TAG, this)
|
||||
//获取数据采集录制模式配置列表
|
||||
CallerAutoPilotManager.getBadCaseConfig(0, 0, listOf())
|
||||
recordTypesList.add(RecordTypeEntity(0,"自定义", arrayListOf()))
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
}
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutopilotRecordListenerManager.removeListener(TAG)
|
||||
recordTypesList.clear()
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
fun onClose()
|
||||
}
|
||||
interface ClickListener {
|
||||
fun onClose()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.zhjt.mogo_core_function_devatools.R;
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.CaseListAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase清单选择对话框
|
||||
* @since: 2022/10/19
|
||||
*/
|
||||
public class CaseListDialog extends Dialog {
|
||||
|
||||
private TextView tvCancel;
|
||||
private RecyclerView rvCaseList;
|
||||
private CaseListAdapter caseListAdapter;
|
||||
|
||||
public CaseListDialog(@NonNull Context context) {
|
||||
super(context, R.style.bad_case_dialog);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_case_list);
|
||||
setCanceledOnTouchOutside(false);
|
||||
init();
|
||||
initEvent();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
tvCancel = findViewById(R.id.tvCancel);
|
||||
rvCaseList = findViewById(R.id.rvCaseList);
|
||||
caseListAdapter = new CaseListAdapter();
|
||||
GridLayoutManager gridLayoutManager = new GridLayoutManager(getContext(),2);
|
||||
gridLayoutManager.setOrientation(RecyclerView.VERTICAL);
|
||||
rvCaseList.setLayoutManager(gridLayoutManager);
|
||||
rvCaseList.setAdapter(caseListAdapter);
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
list.add("红绿灯检测错误");
|
||||
list.add("接管默认录制");
|
||||
list.add("行程冲突");
|
||||
list.add("自定义A");
|
||||
caseListAdapter.setData(list);
|
||||
caseListAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
private void initEvent() {
|
||||
tvCancel.setOnClickListener(v -> dismiss());
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz;
|
||||
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.mogo.eagle.core.data.badcase.RecordTypeEntity;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotRecordListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
import com.zhjt.mogo_core_function_devatools.R;
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.adapter.TopicListAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import mogo.telematics.pad.MessagePad;
|
||||
import record_cache.RecordPanelOuterClass;
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description BadCase Topic列表选择对话框
|
||||
* @since: 2022/10/19
|
||||
*/
|
||||
public class CaseTopicListDialog extends Dialog implements IMoGoAutopilotRecordListener {
|
||||
|
||||
private static final String TAG = "CaseTopicListDialog";
|
||||
private TextView tvCaseName;
|
||||
private TextView tvSave;
|
||||
private TextView tvCancel;
|
||||
private ImageView ivSearch;
|
||||
private EditText etSearch;
|
||||
private RecyclerView rvTopicList;
|
||||
private TopicListAdapter topicListAdapter;
|
||||
private String searchStr;
|
||||
private List<String> allTopicList = new ArrayList<>();
|
||||
|
||||
|
||||
public CaseTopicListDialog(@NonNull Context context) {
|
||||
super(context, R.style.bad_case_dialog);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.dialog_case_topic_list);
|
||||
setCanceledOnTouchOutside(false);
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.addListener(TAG, this);
|
||||
init();
|
||||
initEvent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow();
|
||||
CallerAutopilotRecordListenerManager.INSTANCE.removeListener(TAG);
|
||||
}
|
||||
|
||||
public void setData(RecordTypeEntity recordTypeEntity){
|
||||
tvCaseName.setText(recordTypeEntity.getDesc());
|
||||
//获取所有Topic
|
||||
CallerAutoPilotManager.INSTANCE.getBadCaseConfig(1, 0, new ArrayList<>());
|
||||
if(recordTypeEntity.getTopicsList().size()>0){
|
||||
topicListAdapter.setData(recordTypeEntity.getTopicsList());
|
||||
topicListAdapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
private void init() {
|
||||
tvCaseName = findViewById(R.id.tvCaseName);
|
||||
tvSave = findViewById(R.id.tvSave);
|
||||
tvCancel = findViewById(R.id.tvCancel);
|
||||
ivSearch = findViewById(R.id.ivSearch);
|
||||
etSearch = findViewById(R.id.etSearch);
|
||||
rvTopicList = findViewById(R.id.rvTopicList);
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||
linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
rvTopicList.setLayoutManager(linearLayoutManager);
|
||||
topicListAdapter = new TopicListAdapter();
|
||||
rvTopicList.setAdapter(topicListAdapter);
|
||||
}
|
||||
|
||||
private void initEvent() {
|
||||
etSearch.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
searchStr = s.toString();
|
||||
if(searchStr!=null && searchStr.length()>0){
|
||||
ivSearch.setImageDrawable(getContext().getDrawable(R.drawable.icon_bad_case_delect));
|
||||
} else {
|
||||
ivSearch.setImageDrawable(getContext().getDrawable(R.drawable.icon_bad_case_search));
|
||||
}
|
||||
//TODO
|
||||
}
|
||||
});
|
||||
|
||||
ivSearch.setOnClickListener(v -> {
|
||||
if(searchStr!=null && searchStr.length()>0){
|
||||
etSearch.setText("");
|
||||
ivSearch.setImageDrawable(getContext().getDrawable(R.drawable.icon_bad_case_search));
|
||||
}
|
||||
});
|
||||
|
||||
tvCancel.setOnClickListener(v -> {
|
||||
dismiss();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordConfig(MessagePad.RecordDataConfig config) {
|
||||
ThreadUtils.runOnUiThread(() -> {
|
||||
if(config.getAllTopicsCount()>0){
|
||||
for(int index=0;index<config.getAllTopicsCount();index++){
|
||||
allTopicList.add(config.getAllTopics(index));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotRecordResult(@NonNull RecordPanelOuterClass.RecordPanel recordPanel) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description Case清单列表适配器
|
||||
* @since: 2022/10/19
|
||||
*/
|
||||
class CaseListAdapter: RecyclerView.Adapter<CaseListAdapter.CaseListHolder>() {
|
||||
|
||||
private var data:List<String>? = null
|
||||
|
||||
fun setData( data: List<String>?){
|
||||
this.data = data
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CaseListHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_case_list, parent, false)
|
||||
return CaseListHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: CaseListHolder, position: Int) {
|
||||
data?.let {
|
||||
holder.caseName.text = it[position]
|
||||
holder.caseName.setOnClickListener {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class CaseListHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var caseName: TextView = itemView.findViewById(R.id.caseName)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.data.badcase.RecordTypeEntity
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
import com.zhjt.mogo_core_function_devatools.badcase.biz.BadCaseConfigView
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 录制模板清单列表适配器
|
||||
* @since: 2022/10/19
|
||||
*/
|
||||
class RecordTemplateAdapter : RecyclerView.Adapter<RecordTemplateAdapter.RecordTemplateHolder>(){
|
||||
|
||||
private var data:List<RecordTypeEntity>? = null
|
||||
private var clickTemplateListener: ClickTemplateListener? = null
|
||||
|
||||
fun setData( data: List<RecordTypeEntity>?){
|
||||
this.data = data
|
||||
}
|
||||
|
||||
fun setListener(listener: ClickTemplateListener){
|
||||
clickTemplateListener = listener
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecordTemplateHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_record_template, parent, false)
|
||||
return RecordTemplateHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: RecordTemplateHolder, position: Int) {
|
||||
data?.let {recordTypeEntity->
|
||||
holder.caseName.text = recordTypeEntity[position].desc
|
||||
holder.caseName.setOnClickListener {
|
||||
clickTemplateListener?.onClick(recordTypeEntity[position])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class RecordTemplateHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var caseName: TextView = itemView.findViewById(R.id.caseName)
|
||||
}
|
||||
|
||||
interface ClickTemplateListener{
|
||||
fun onClick(recordTypeEntity: RecordTypeEntity)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zhjt.mogo_core_function_devatools.badcase.biz.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.CheckBox
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.zhjt.mogo_core_function_devatools.R
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description Topic列表适配器
|
||||
* @since: 2022/10/19
|
||||
*/
|
||||
class TopicListAdapter: RecyclerView.Adapter<TopicListAdapter.TopicListHolder>() {
|
||||
|
||||
private var data:List<String>? = null
|
||||
|
||||
fun setData( data: List<String>?){
|
||||
this.data = data
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TopicListHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_topic_list, parent, false)
|
||||
return TopicListHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: TopicListHolder, position: Int) {
|
||||
data?.let{
|
||||
holder.topic_check_box.text = it[position]
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = data?.size ?: 0
|
||||
|
||||
class TopicListHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
|
||||
var topic_check_box: CheckBox = itemView.findViewById(R.id.topic_check_box);
|
||||
}
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 489 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#3B4577" />
|
||||
<corners android:radius="32px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#29305E" />
|
||||
<corners android:radius="48px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#29305E" />
|
||||
<corners android:radius="20px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#2B6EFF" />
|
||||
<corners android:radius="20px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/case_list_select" android:state_focused="true" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/case_list_select" android:state_focused="false" android:state_pressed="true" />
|
||||
<item android:drawable="@drawable/case_list_select" android:state_selected="true" />
|
||||
<item android:drawable="@drawable/case_list_select" android:state_focused="true" />
|
||||
<item android:drawable="@drawable/case_list_normal" />
|
||||
</selector>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#33E1E5FF" />
|
||||
<corners android:radius="32px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#29305E" />
|
||||
<corners android:radius="32px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="#3B4577" />
|
||||
<corners android:radius="24px" />
|
||||
</shape>
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="1110px"
|
||||
android:layout_height="668px"
|
||||
android:background="#3B4577"
|
||||
app:roundLayoutRadius="32px"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCaseListTitle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="case清单"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="56px"
|
||||
android:gravity="center"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="50px"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="52px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:paddingBottom="50px"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewCancelDivider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/tvCancel"
|
||||
android:layout_marginBottom="50px"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvCaseList"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCaseListTitle"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewCancelDivider"
|
||||
android:layout_margin="50px"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="1270px"
|
||||
android:layout_height="959px"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCaseName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="56px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_marginTop="50px"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewVerticalLine"
|
||||
android:layout_width="2px"
|
||||
android:layout_height="160px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
<View
|
||||
android:id="@+id/viewHorizontalLine"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2px"
|
||||
android:background="#66B8BFE8"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewVerticalLine"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvSave"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewHorizontalLine"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewVerticalLine"
|
||||
android:text="保存"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="52px"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvCancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/viewHorizontalLine"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/viewVerticalLine"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:text="取消"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="52px"
|
||||
android:gravity="center"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/clSearchLayout"
|
||||
android:layout_width="1030px"
|
||||
android:layout_height="96px"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvCaseName"
|
||||
android:layout_marginTop="50px"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:background="@drawable/bad_case_search_bg"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivSearch"
|
||||
android:layout_width="38px"
|
||||
android:layout_height="42px"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:src="@drawable/icon_bad_case_search"
|
||||
android:layout_marginEnd="40px"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/etSearch"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toLeftOf="@id/ivSearch"
|
||||
android:hint="topic搜索"
|
||||
android:textSize="38px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textColorHint="#B3FFFFFF"
|
||||
android:background="@null"
|
||||
android:layout_marginStart="40px"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvTopicList"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintLeft_toLeftOf="@id/clSearchLayout"
|
||||
app:layout_constraintRight_toRightOf="@id/clSearchLayout"
|
||||
app:layout_constraintTop_toBottomOf="@id/clSearchLayout"
|
||||
app:layout_constraintBottom_toTopOf="@id/viewHorizontalLine"
|
||||
android:layout_marginTop="50px"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:scrollbars="vertical"
|
||||
android:fadeScrollbars="false"
|
||||
style="@style/rv_vertical_style"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/caseName"
|
||||
android:layout_width="430px"
|
||||
android:layout_height="116px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="43px"
|
||||
android:background="@drawable/case_list_selector"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
>
|
||||
</TextView>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/caseName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="84px"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="34px"
|
||||
android:background="@drawable/case_list_selector"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="20dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:paddingStart="30dp"
|
||||
android:paddingEnd="30dp"
|
||||
android:layout_marginStart="20dp"
|
||||
>
|
||||
</TextView>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<CheckBox xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/topic_check_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@drawable/badcase_radio_button_style"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="38px"
|
||||
android:paddingStart="5dp"
|
||||
android:gravity="center_vertical"
|
||||
>
|
||||
</CheckBox>
|
||||
@@ -308,6 +308,17 @@
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rvTemplate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/tvRecordTemplate"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvRecordTemplate"
|
||||
android:background="@drawable/template_list_bg"
|
||||
android:layout_marginTop="@dimen/dp_50"
|
||||
/>
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/rgRecordConfig"
|
||||
android:layout_width="0dp"
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="bad_case_dialog" parent="@android:style/Theme.Dialog">
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowBackground">@drawable/bad_case_dialog_bg</item>
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="rv_vertical_style">
|
||||
<item name="android:scrollbarSize">5dp</item>
|
||||
<item name="android:scrollbars">horizontal</item>
|
||||
<item name="android:scrollbarThumbVertical">@drawable/rv_scroll_bar_thumb</item>
|
||||
<item name="android:scrollbarTrackVertical">@drawable/rv_scroll_bar_track</item>
|
||||
</style>
|
||||
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user