[6.7.0][状态栏改变] 状态栏小铃铛点击后弹出的窗口
@@ -34,29 +34,24 @@ class StatusSummaryAdapter(private val ctx: Context, var data: ArrayList<StatusS
|
|||||||
fun bind(entity: StatusSummaryEntity) {
|
fun bind(entity: StatusSummaryEntity) {
|
||||||
when(entity.type) {
|
when(entity.type) {
|
||||||
0 -> {
|
0 -> {
|
||||||
ivFuncView.setImageResource(R.drawable.driver_server)
|
ivFuncView.setImageResource(if (entity.isException) R.drawable.icon_over_driver_start_error else R.drawable.icon_over_driver_start_ok)
|
||||||
}
|
}
|
||||||
1 -> {
|
1 -> {
|
||||||
ivFuncView.setImageResource(R.drawable.gps)
|
ivFuncView.setImageResource(if (entity.isException) R.drawable.icon_over_gps_error else R.drawable.icon_over_gps_ok)
|
||||||
}
|
}
|
||||||
2 -> {
|
2 -> {
|
||||||
ivFuncView.setImageResource(R.drawable.cloud_socket)
|
ivFuncView.setImageResource(if (entity.isException) R.drawable.icon_over_socket_error else R.drawable.icon_over_socket_ok)
|
||||||
}
|
}
|
||||||
3 -> {
|
3 -> {
|
||||||
ivFuncView.setImageResource(R.drawable.tracing)
|
ivFuncView.setImageResource(if (entity.isException) R.drawable.icon_over_route_error else R.drawable.icon_over_route_ok)
|
||||||
}
|
}
|
||||||
4 -> {
|
4 -> {
|
||||||
ivFuncView.setImageResource(R.drawable.controller)
|
ivFuncView.setImageResource(if (entity.isException) R.drawable.icon_over_ipc_error else R.drawable.icon_over_ipc_ok)
|
||||||
}
|
}
|
||||||
5 -> {
|
5 -> {
|
||||||
ivFuncView.setImageResource(R.drawable.ssl_check)
|
ivFuncView.setImageResource(if (entity.isException) R.drawable.icon_over_auth_error else R.drawable.icon_over_auth_ok)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (entity.isException) {
|
|
||||||
tvStatusDesc.setTextColor(Color.parseColor("#FF4444"))
|
|
||||||
} else {
|
|
||||||
tvStatusDesc.setTextColor(Color.parseColor("#FFFFFF"))
|
|
||||||
}
|
|
||||||
tvStatusDesc.text = entity.desc
|
tvStatusDesc.text = entity.desc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,21 +32,12 @@ import com.mogo.eagle.core.utilcode.kotlin.PX
|
|||||||
import com.mogo.eagle.core.utilcode.rv.divider.CommonDividerItemDecoration
|
import com.mogo.eagle.core.utilcode.rv.divider.CommonDividerItemDecoration
|
||||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||||
import com.zhjt.mogo.adas.data.AdasConstants
|
import com.zhjt.mogo.adas.data.AdasConstants
|
||||||
|
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态汇总View控件
|
* 状态汇总View控件
|
||||||
*/
|
*/
|
||||||
class StatusSummaryView @JvmOverloads constructor(
|
class StatusSummaryView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : FrameLayout(context, attrs, defStyleAttr), IConnectStatusListener, IMogoStatusChangedListener, IMoGoDevaToolsListener, IMoGoAutopilotStatusListener, IMoGoAutopilotCarConfigListener, IMoGoCloudListener {
|
||||||
context: Context,
|
|
||||||
attrs: AttributeSet? = null,
|
|
||||||
defStyleAttr: Int = 0
|
|
||||||
) : FrameLayout(
|
|
||||||
context,
|
|
||||||
attrs,
|
|
||||||
defStyleAttr
|
|
||||||
), IConnectStatusListener, IMogoStatusChangedListener,
|
|
||||||
IMoGoDevaToolsListener, IMoGoAutopilotStatusListener, IMoGoAutopilotCarConfigListener,
|
|
||||||
IMoGoCloudListener {
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val TAG = "SummaryStatusView"
|
private const val TAG = "SummaryStatusView"
|
||||||
}
|
}
|
||||||
@@ -61,13 +52,7 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
it.add(StatusSummaryEntity(2))
|
it.add(StatusSummaryEntity(2))
|
||||||
it.add(StatusSummaryEntity(3))
|
it.add(StatusSummaryEntity(3))
|
||||||
it.add(StatusSummaryEntity(4, "域控未连接", true))
|
it.add(StatusSummaryEntity(4, "域控未连接", true))
|
||||||
it.add(
|
it.add(StatusSummaryEntity(5, CallerAutopilotCarConfigListenerManager.getCertFileResult(), CallerCloudCertManager.getRootCrtF().isNullOrEmpty()))
|
||||||
StatusSummaryEntity(
|
|
||||||
5,
|
|
||||||
CallerAutopilotCarConfigListenerManager.getCertFileResult(),
|
|
||||||
CallerCloudCertManager.getRootCrtF().isNullOrEmpty()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,12 +63,9 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun onAttachedToWindow() {
|
override fun onAttachedToWindow() {
|
||||||
super.onAttachedToWindow()
|
super.onAttachedToWindow()
|
||||||
CallerDevaToolsListenerManager.addListener(TAG, this)
|
CallerDevaToolsListenerManager.addListener(TAG, this) // 司机屏Server服务是否开启的状态
|
||||||
// 司机屏Server服务是否开启的状态
|
CallerTelematicStatusListenerManager.addListener(TAG, this) // 云socket连接状态
|
||||||
CallerTelematicStatusListenerManager.addListener(TAG, this)
|
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.CLOUD_SOCKET, this)
|
||||||
// 云socket连接状态
|
|
||||||
MogoStatusManager.getInstance()
|
|
||||||
.registerStatusChangedListener(TAG, StatusDescriptor.CLOUD_SOCKET, this)
|
|
||||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||||
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
|
||||||
CallerCloudListenerManager.addListener(TAG, this)
|
CallerCloudListenerManager.addListener(TAG, this)
|
||||||
@@ -99,12 +81,7 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
removeDuration = 0
|
removeDuration = 0
|
||||||
}
|
}
|
||||||
it.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
it.layoutManager = LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false)
|
||||||
it.addItemDecoration(
|
it.addItemDecoration(CommonDividerItemDecoration.Builder().spanCountTBCare(false).verticalInnerSpace(AutoSizeUtils.dp2px(context, 20.0f)).build())
|
||||||
CommonDividerItemDecoration.Builder()
|
|
||||||
.spanCountTBCare(false)
|
|
||||||
.horizontalInnerSpace(10.PX)
|
|
||||||
.build()
|
|
||||||
)
|
|
||||||
StatusSummaryAdapter(context, data).apply {
|
StatusSummaryAdapter(context, data).apply {
|
||||||
adapter = this
|
adapter = this
|
||||||
it.adapter = this
|
it.adapter = this
|
||||||
@@ -121,13 +98,10 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onDetachedFromWindow() {
|
override fun onDetachedFromWindow() {
|
||||||
super.onDetachedFromWindow()
|
super.onDetachedFromWindow() // 司机屏Server服务是否开启的状态
|
||||||
// 司机屏Server服务是否开启的状态
|
|
||||||
CallerTelematicStatusListenerManager.removeListener(TAG)
|
CallerTelematicStatusListenerManager.removeListener(TAG)
|
||||||
CallerDevaToolsListenerManager.removeListener(TAG)
|
CallerDevaToolsListenerManager.removeListener(TAG) // 云socket连接状态
|
||||||
// 云socket连接状态
|
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.CLOUD_SOCKET, this)
|
||||||
MogoStatusManager.getInstance()
|
|
||||||
.unregisterStatusChangedListener(TAG, StatusDescriptor.CLOUD_SOCKET, this)
|
|
||||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||||
CallerAutopilotCarConfigListenerManager.removeListener(TAG)
|
CallerAutopilotCarConfigListenerManager.removeListener(TAG)
|
||||||
CallerCloudListenerManager.removeListener(TAG)
|
CallerCloudListenerManager.removeListener(TAG)
|
||||||
@@ -171,8 +145,7 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun tracingStatus(status: Boolean) {
|
override fun tracingStatus(status: Boolean) {
|
||||||
super.tracingStatus(status)
|
super.tracingStatus(status) // 发送事件前限制了频率
|
||||||
// 发送事件前限制了频率
|
|
||||||
UiThreadHandler.post({
|
UiThreadHandler.post({
|
||||||
if (data.size < 4) return@post
|
if (data.size < 4) return@post
|
||||||
data[3].desc = "寻迹算路${if (status) "正常" else "异常"}"
|
data[3].desc = "寻迹算路${if (status) "正常" else "异常"}"
|
||||||
@@ -181,10 +154,7 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
}, UiThreadHandler.MODE.QUEUE)
|
}, UiThreadHandler.MODE.QUEUE)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onAutopilotIpcConnectStatusChanged(
|
override fun onAutopilotIpcConnectStatusChanged(status: AdasConstants.IpcConnectionStatus, reason: String?) {
|
||||||
status: AdasConstants.IpcConnectionStatus,
|
|
||||||
reason: String?
|
|
||||||
) {
|
|
||||||
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
super.onAutopilotIpcConnectStatusChanged(status, reason)
|
||||||
var pair: Pair<String, Boolean>? = null
|
var pair: Pair<String, Boolean>? = null
|
||||||
when (status) {
|
when (status) {
|
||||||
@@ -238,8 +208,8 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun authCrtFile(device: String, root: String) {
|
override fun authCrtFile(device: String, root: String) {
|
||||||
super.authCrtFile(device, root)
|
super.authCrtFile(device, root)
|
||||||
UiThreadHandler.post ({
|
UiThreadHandler.post({
|
||||||
if(CallerAutopilotCarConfigListenerManager.getCertFileResult()!= "未开启认证"){
|
if (CallerAutopilotCarConfigListenerManager.getCertFileResult() != "未开启认证") {
|
||||||
return@post
|
return@post
|
||||||
}
|
}
|
||||||
if (data.size < 6) return@post
|
if (data.size < 6) return@post
|
||||||
@@ -251,7 +221,7 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
|
|
||||||
override fun authCrtError(errorMsg: String) {
|
override fun authCrtError(errorMsg: String) {
|
||||||
super.authCrtError(errorMsg)
|
super.authCrtError(errorMsg)
|
||||||
UiThreadHandler.post ({
|
UiThreadHandler.post({
|
||||||
if (data.size < 6) return@post
|
if (data.size < 6) return@post
|
||||||
data[5].desc = "本机证书下载异常:$errorMsg"
|
data[5].desc = "本机证书下载异常:$errorMsg"
|
||||||
data[5].isException = true
|
data[5].isException = true
|
||||||
@@ -262,14 +232,10 @@ class StatusSummaryView @JvmOverloads constructor(
|
|||||||
override fun onCertificationResult(msg: String) {
|
override fun onCertificationResult(msg: String) {
|
||||||
super.onCertificationResult(msg)
|
super.onCertificationResult(msg)
|
||||||
hmiAction("证书验证状态", msg, true)
|
hmiAction("证书验证状态", msg, true)
|
||||||
if (!SharedPrefsMgr.getInstance().getBoolean(
|
if (!SharedPrefsMgr.getInstance().getBoolean("${MoGoConfig.AUTOPILOT_CERTIFICATION}-${DebugConfig.getNetMode()}", MoGoConfig.AUTOPILOT_CERTIFICATION_DEFAULT_VALUE)) {
|
||||||
"${MoGoConfig.AUTOPILOT_CERTIFICATION}-${DebugConfig.getNetMode()}",
|
|
||||||
MoGoConfig.AUTOPILOT_CERTIFICATION_DEFAULT_VALUE
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
UiThreadHandler.post ({
|
UiThreadHandler.post({
|
||||||
if (data.size < 6) return@post
|
if (data.size < 6) return@post
|
||||||
data[5].desc = msg
|
data[5].desc = msg
|
||||||
data[5].isException = !msg.contains("成功校验")
|
data[5].isException = !msg.contains("成功校验")
|
||||||
|
|||||||
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -1,35 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.mogo.eagle.core.widget.RoundConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="@dimen/dp_600"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_height="@dimen/dp_80"
|
android:layout_width="@dimen/dp_509"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
android:layout_height="wrap_content"
|
||||||
app:roundLayoutRadius="@dimen/dp_16"
|
tools:background="#83000000"
|
||||||
android:layout_marginTop="@dimen/dp_12"
|
android:orientation="horizontal">
|
||||||
android:layout_marginBottom="@dimen/dp_12"
|
|
||||||
>
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivFuncView"
|
android:id="@+id/ivFuncView"
|
||||||
android:layout_width="@dimen/dp_64"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dp_64"
|
android:layout_height="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
android:layout_gravity="center_vertical"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
tools:src="@drawable/icon_over_driver_start_ok"/>
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvStatusDesc"
|
android:id="@+id/tvStatusDesc"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="已连接xxxxxxxxxxxxxxxx"
|
android:layout_gravity="center_vertical"
|
||||||
android:textSize="@dimen/dp_20"
|
android:layout_marginStart="@dimen/dp_20"
|
||||||
android:layout_marginStart="@dimen/dp_10"
|
android:textSize="@dimen/dp_28"
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
android:textColor="#ffffff"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
tools:text="已连接xxxxxxxxxxxxxxxx" />
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
</LinearLayout>
|
||||||
android:layout_marginEnd="10dp"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
|
||||||
@@ -1,32 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:tools="http://schemas.android.com/tools"
|
<androidx.recyclerview.widget.RecyclerView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
android:id="@+id/rvStatusView"
|
||||||
android:layout_width="@dimen/dp_600"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/notice_dialog_check_background"
|
android:background="@drawable/bg_status_overview"
|
||||||
tools:ignore="MissingDefaultResource">
|
android:padding="@dimen/dp_60"
|
||||||
|
tools:ignore="MissingDefaultResource" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvTitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:text="状态汇总:"
|
|
||||||
android:textSize="@dimen/dp_32"
|
|
||||||
android:textColor="#FFFFFF"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/rvStatusView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvTitle"
|
|
||||||
android:layout_marginTop="12dp"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||