[6.4.4]显示连接过程及系统冷启动结果
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhjt.mogo.adas.data.AdasConstants
|
||||
import system_master.SsmInfo
|
||||
import system_master.SystemStatusInfo
|
||||
|
||||
/**
|
||||
* 显示连接过程及系统冷启动结果View
|
||||
* 域控连接成功后显示该View,连接SSM的超时时间为5分钟,冷启动的超时时间为10分钟
|
||||
* 首次连接成功域控后立即展示该View,首次连接成功后断连1分钟后,并且再次连接域控成功后展示该View
|
||||
*/
|
||||
class ConnectionProcessView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener{
|
||||
|
||||
companion object {
|
||||
const val TAG = "ConnectionProcessView"
|
||||
}
|
||||
|
||||
private var isFirstTimeConnect = true //是否是第一次连接域控,默认是首次连接
|
||||
private var ipcConnectStatus = false //连接域控状态,默认是未连接
|
||||
private var ssmConnectStatus = false //SSM连接状态,默认是未连接
|
||||
private var autopilotReadyStatus = false //冷启动状态,默认是未冷启动成功
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_connection_process, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
private fun initView(){
|
||||
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
override fun onAutopilotIpcConnectStatusChanged(
|
||||
status: AdasConstants.IpcConnectionStatus,
|
||||
reason: String?
|
||||
) {
|
||||
ipcConnectStatus = status == AdasConstants.IpcConnectionStatus.CONNECTED
|
||||
if(ipcConnectStatus){
|
||||
isFirstTimeConnect = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态查询应答
|
||||
* @param status 数据
|
||||
* HQ、M1 MAP350开始弃用,其他车型MAP360开始弃用
|
||||
*/
|
||||
override fun onAutopilotStatusRespByQuery(status: SystemStatusInfo.StatusInfo) {
|
||||
ssmConnectStatus = true
|
||||
autopilotReadyStatus = status.autoPilotReady
|
||||
}
|
||||
|
||||
/**
|
||||
* 定频SSM接口
|
||||
* 1hz hq m1 MAP350开始支持,其他车型MAP360开始支持
|
||||
* 定频SSM接入后 onStatusQueryResp 状态查询应答接口将弃用
|
||||
* @param statusInf 数据
|
||||
*/
|
||||
override fun onSystemStatus(statusInf: SsmInfo.SsmStatusInf) {
|
||||
ssmConnectStatus = true
|
||||
autopilotReadyStatus = statusInf.autoPilotReady
|
||||
}
|
||||
|
||||
/**
|
||||
* 展示冷启动成功视图
|
||||
*/
|
||||
private fun showConnectionSuccessView(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<!--缩放范围-->
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_30"/>
|
||||
<gradient
|
||||
android:startColor="#FF8D20"
|
||||
android:endColor="#FF0000"
|
||||
android:angle="0"/>
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<!--缩放范围-->
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_30"/>
|
||||
<gradient
|
||||
android:startColor="#20AAFF"
|
||||
android:endColor="#004DFF"
|
||||
android:angle="0"/>
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item android:id="@android:id/progress">
|
||||
<!--缩放范围-->
|
||||
<scale android:scaleWidth="100%">
|
||||
<shape>
|
||||
<corners android:radius="@dimen/dp_30"/>
|
||||
<gradient
|
||||
android:startColor="#00FF90"
|
||||
android:endColor="#1EAD57"
|
||||
android:angle="0"/>
|
||||
</shape>
|
||||
</scale>
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/pb_connection_progress"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="@dimen/dp_1003"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:progress="50"
|
||||
android:background="@drawable/bg_connection_progress"
|
||||
android:progressDrawable="@drawable/connection_progress_style" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_connection_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="@id/pb_connection_progress"
|
||||
app:layout_constraintRight_toRightOf="@id/pb_connection_progress"
|
||||
app:layout_constraintTop_toTopOf="@id/pb_connection_progress"
|
||||
app:layout_constraintBottom_toBottomOf="@id/pb_connection_progress"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/cl_connection_tip"
|
||||
android:layout_width="@dimen/dp_600"
|
||||
android:layout_height="@dimen/dp_186"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/pb_connection_progress"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@drawable/bg_connection_tip"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_connection_tip"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_110"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_marginStart="@dimen/dp_33"
|
||||
android:layout_marginTop="@dimen/dp_40"
|
||||
android:src="@drawable/icon_connection_tip"
|
||||
android:scaleType="fitXY"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_connection_tip_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_connection_tip"
|
||||
app:layout_constraintLeft_toRightOf="@id/iv_connection_tip"
|
||||
android:layout_marginStart="@dimen/dp_28"
|
||||
android:textSize="@dimen/sp_40"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_connection_tip_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_connection_tip"
|
||||
app:layout_constraintLeft_toRightOf="@id/iv_connection_tip"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1026,6 +1026,7 @@
|
||||
<dimen name="dp_998">998dp</dimen>
|
||||
<dimen name="dp_999">999dp</dimen>
|
||||
<dimen name="dp_1000">1000dp</dimen>
|
||||
<dimen name="dp_1003">1003dp</dimen>
|
||||
<dimen name="dp_1100">1100dp</dimen>
|
||||
<dimen name="dp_1125">1125dp</dimen>
|
||||
<dimen name="dp_1200">1200dp</dimen>
|
||||
|
||||
Reference in New Issue
Block a user