Merge branch 'dev_robotaxi-d-app-module_2120_221017_2.12.0' into 'test_robotaxi-d-app-module_2120_221017_2.12.0.1'

Dev robotaxi d app module 2120 221017 2.12.0

See merge request zhjt/AndroidApp/MoGoEagleEye!335
This commit is contained in:
wangmingjun
2022-11-01 11:30:12 +00:00
4 changed files with 54 additions and 8 deletions

View File

@@ -15,10 +15,10 @@ import com.zhjt.mogo_core_function_devatools.R
*/
class TopicListAdapter: RecyclerView.Adapter<TopicListAdapter.TopicListHolder>() {
private var data:List<TopicEntity>? = null
private var data:MutableList<TopicEntity>? = null
private var topicClickListener: TopicClickListener? = null
fun setData( data: List<TopicEntity>?){
fun setData( data: MutableList<TopicEntity>?){
this.data = data
}
@@ -39,13 +39,37 @@ class TopicListAdapter: RecyclerView.Adapter<TopicListAdapter.TopicListHolder>()
holder.topic_check_box.isChecked = topicList[position].topicStatus
holder.topic_check_box.tag = topicList
holder.topic_check_box.isClickable = topicList[position].topicCanClick
holder.topic_check_box.setOnCheckedChangeListener { _, b ->
topicList[position].topicStatus = b
topicClickListener?.onClick(topicList[position].topicName,b)
holder.topic_check_box.setOnCheckedChangeListener { _, isChecked ->
topicList[position].topicStatus = isChecked
topicClickListener?.onClick(topicList[position].topicName,isChecked)
if(isChecked){
//滚动到置顶
moveItem(topicList[position],position,0)
}else{
var lastNotCan = 0 //最后一个不能选择的
for( i in 0 until itemCount){
var topicEntity = data?.get(i)
if (topicEntity != null) {
if(!topicEntity.topicCanClick){
lastNotCan = i
}
}
}
moveItem(topicList[position],position,lastNotCan)
}
}
}
}
private fun moveItem(topicEntity: TopicEntity,removePos: Int,insertedPos: Int){
data?.remove(topicEntity)
notifyItemRemoved(removePos)
notifyItemRangeChanged(removePos, itemCount - removePos)
data?.add(insertedPos, topicEntity)
notifyItemInserted(insertedPos)
notifyItemRangeChanged(insertedPos, itemCount)
}
override fun getItemCount() = data?.size ?: 0
class TopicListHolder(itemView: View) : RecyclerView.ViewHolder(itemView){

View File

@@ -17,7 +17,9 @@ import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.module.service.routeoverlay.RouteStrategy
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import kotlinx.android.synthetic.main.view_sop_setting.view.*
import kotlinx.android.synthetic.main.view_sop_setting.view.tbRouteDynamicEffect
/**
* SOP设置窗口
@@ -134,6 +136,13 @@ class SOPSettingView @JvmOverloads constructor(
}
}
//是否开启异常上报
tbIPCReport.isChecked = FunctionBuildConfig.isReportWarning
tbIPCReport.setOnCheckedChangeListener { _, isChecked ->
FunctionBuildConfig.isReportWarning = isChecked
}
//变道绕障的目标障碍物速度阈值
tvSpeed.text = "${FunctionBuildConfig.detouringSpeed} m/s"
ivSpeedReduce.setOnClickListener {

View File

@@ -121,12 +121,25 @@
app:layout_constraintTop_toBottomOf="@id/tbRainMode"
/>
<ToggleButton
android:id="@+id/tbIPCReport"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10"
android:background="@drawable/radio_button_normal_background_right"
android:textColor="#000"
android:textOff="开启异常上报提示"
android:textOn="关闭异常上报提示"
android:textSize="@dimen/dp_24"
app:layout_constraintTop_toBottomOf="@id/tbObu"
/>
<TextView
android:id="@+id/tvSpeedThresholdTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/tbObu"
app:layout_constraintTop_toBottomOf="@id/tbIPCReport"
android:text="变道速度阈值:"
android:textSize="18sp"
android:textColor="#1A1A1A"

View File

@@ -88,8 +88,8 @@ public abstract class MvpActivity<V extends IView, P extends Presenter<V>> exten
}
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
protected void onRestart() {
super.onRestart();
BarUtils.hideStatusBarAndSticky(this.getWindow());
}