Merge branch 'dev_robotaxi-d_240705_6.5.0' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_240705_6.5.0

# Conflicts:
#	core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt
This commit is contained in:
aibingbing
2024-07-10 09:57:21 +08:00
71 changed files with 1668 additions and 598 deletions

View File

@@ -1,6 +1,7 @@
package com.mogo.eagle.core.function.hmi.ui
import android.content.Context
import android.telecom.Call
import android.text.TextUtils
import android.view.Gravity
import android.view.ViewGroup
@@ -86,9 +87,6 @@ class MoGoHmiProvider : IMoGoHmiProvider {
private val xiaozhi by lazy { XiaoZhiStateManager() }
private val greenWave by lazy { AtomicReference<MoGoPopWindow>() }
override fun init(context: Context?) {
this.context = context
}
@@ -410,39 +408,10 @@ class MoGoHmiProvider : IMoGoHmiProvider {
}
override fun showGreenWave(min: Int, max: Int, cross: Int) {
val activity = AppStateManager.currentActivity() ?: return
activity.lifeCycleScope.launch {
greenWave.get()?.hide()
val content = GreenWaveView(activity)
MoGoPopWindow.Builder()
.contentView(content)
.width(WindowManager.LayoutParams.WRAP_CONTENT)
.height(WindowManager.LayoutParams.WRAP_CONTENT)
.attachToActivity(activity)
.draggable(true)
.gravityInActivity(Gravity.CENTER)
.also {
if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
it.offsetX(960)
it.offsetY(445)
} else {
it.offsetX(980)
it.offsetY(-324)
}
}
.onDismissed {
greenWave.set(null)
}
.onShowed {
content.bind(min, max, cross)
}
.build().also {
greenWave.set(it)
}.show()
}
CallerHmiViewControlListenerManager.invokeGreenWaveVisible(min, max, cross)
}
override fun dismissGreenWave() {
greenWave.get()?.hide()
CallerHmiViewControlListenerManager.invokeGreenWaveDismiss()
}
}

View File

@@ -141,7 +141,8 @@ class RoadCrossLiveView @JvmOverloads constructor(
}
}
private fun gsyVideoPlay(img: String, live: String) {
private fun gsyVideoPlay(img: String?, live: String?) {
if (live.isNullOrEmpty()) return
resetView()
gsyVideoOptionBuilder.setUrl(live)
.setCacheWithPlay(false)

View File

@@ -4,6 +4,7 @@ import android.content.Context
import android.util.AttributeSet
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.LinearLayout
@@ -13,7 +14,9 @@ import androidx.recyclerview.widget.RecyclerView
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.kotlin.scope
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
@@ -32,7 +35,7 @@ import kotlinx.android.synthetic.main.view_green_wave_driver_layout.view.recomme
import kotlinx.android.synthetic.main.view_green_wave_passenger_layout.view.recommend_cross as passenger_recommend_cross
import kotlinx.android.synthetic.main.view_green_wave_driver_layout.view.recommend_cross as driver_recommend_cross
class GreenWaveView: LinearLayout, IMoGoChassisLocationGCJ02Listener, RecyclerView.OnItemTouchListener, Runnable {
class GreenWaveView: LinearLayout, IMoGoChassisLocationGCJ02Listener, RecyclerView.OnItemTouchListener, Runnable, IViewControlListener {
companion object {
private const val TAG = "GreenWaveView"
@@ -86,15 +89,7 @@ class GreenWaveView: LinearLayout, IMoGoChassisLocationGCJ02Listener, RecyclerVi
override fun onAttachedToWindow() {
super.onAttachedToWindow()
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 5, this)
val rv: RecyclerView? = if (isDriver) driver_wave_rv else passenger_wave_rv
rv?.addItemDecoration(CommonDividerItemDecoration.Builder()
.spanCountTBCare(false)
.horizontalInnerSpace(SizeUtils.dp2px(10f))
.build())
rv?.addOnItemTouchListener(this)
rv?.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, true)
rv?.adapter = WaveAdapter()
startAutoScroll()
CallerHmiViewControlListenerManager.addListener(TAG, this)
}
private fun startAutoScroll() {
@@ -123,6 +118,7 @@ class GreenWaveView: LinearLayout, IMoGoChassisLocationGCJ02Listener, RecyclerVi
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
CallerHmiViewControlListenerManager.removeListener(this)
val rv: RecyclerView? = if (isDriver) driver_wave_rv else passenger_wave_rv
rv?.removeOnItemTouchListener(this)
stopAutoScroll()
@@ -146,8 +142,18 @@ class GreenWaveView: LinearLayout, IMoGoChassisLocationGCJ02Listener, RecyclerVi
}
}
fun bind(minSpeed: Int, maxSpeed: Int, cross: Int) {
private fun show(minSpeed: Int, maxSpeed: Int, cross: Int) {
scope.launch {
this@GreenWaveView.visibility = View.VISIBLE
val rv: RecyclerView? = if (isDriver) driver_wave_rv else passenger_wave_rv
rv?.addItemDecoration(CommonDividerItemDecoration.Builder()
.spanCountTBCare(false)
.horizontalInnerSpace(SizeUtils.dp2px(10f))
.build())
rv?.addOnItemTouchListener(this@GreenWaveView)
rv?.layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, true)
rv?.adapter = WaveAdapter()
startAutoScroll()
if (isDriver) {
driver_recommend_speed?.text = "建议车速${minSpeed}-${maxSpeed}km/h"
driver_recommend_cross?.text = "可丝滑通过${cross}个路口"
@@ -157,4 +163,19 @@ class GreenWaveView: LinearLayout, IMoGoChassisLocationGCJ02Listener, RecyclerVi
}
}
}
private fun hide() {
scope.launch {
visibility = View.GONE
}
}
override fun onGreenWaveViewDismiss() {
hide()
}
override fun onGreenWaveViewVisible(min: Int, max: Int, cross: Int) {
super.onGreenWaveViewVisible(min, max, cross)
show(min, max, cross)
}
}

View File

@@ -8,10 +8,8 @@ import android.net.wifi.WifiManager
import android.os.Handler
import android.os.Message
import android.util.AttributeSet
import android.util.Log
import android.util.TypedValue
import android.view.LayoutInflater
import android.widget.ImageView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
@@ -90,7 +88,6 @@ class WifiStateView @JvmOverloads constructor(
wifiHandler = WifiHandler(this)
val wifiInfo = wifiManager!!.connectionInfo
wifiName = wifiInfo.ssid.replace("\"","")
// Log.i("emArrow", "init wifiName: $wifiName")
}
private val wifiStateReceiver: BroadcastReceiver = object : BroadcastReceiver() {
@@ -105,7 +102,6 @@ class WifiStateView @JvmOverloads constructor(
}
val wifiInfo = wifiManager!!.connectionInfo
wifiName = wifiInfo.ssid.replace("\"","")
// Log.i("emArrow", "wifiName: $wifiName")
level = WifiManager.calculateSignalLevel(wifiInfo.rssi, 5)
wifiHandler?.sendEmptyMessage(level)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -3,8 +3,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_15"
>
<ImageView

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="@dimen/dp_500"
android:layout_height="@dimen/dp_421"
android:layout_width="@dimen/dp_600"
android:layout_height="@dimen/dp_520"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/bg_auto_exploration">