Merge branch 'dev_arch_opt_3.0' into dev_robosweeper-d_app-module_221230_1.1.0
# Conflicts: # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/fragment/BaseSweeperTabFragment.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/model/SweeperOrderModel.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperLimitingVelocityView.java # OCH/mogo-och-sweeper/src/main/java/com/mogo/och/sweeper/view/SweeperTrafficDataView.java # OCH/mogo-och-sweeper/src/main/res/drawable/sweeper_list_left_top_line.xml # app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt # core/function-impl/mogo-core-function-datacenter/src/main/java/com/mogo/eagle/core/function/datacenter/autopilot/adapter/MoGoAdasListenerImpl.kt # core/function-impl/mogo-core-function-hmi/src/main/res/layout/fragment_hmi.xml
This commit is contained in:
@@ -57,7 +57,7 @@ class V2XLimitingVelocityBroadcastReceiver : BroadcastReceiver() {
|
||||
* @param limitingVelocitySpeed 限速速度
|
||||
*/
|
||||
private fun dispatchShowWaring(limitingVelocitySpeed: Int) {
|
||||
CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed)
|
||||
CallerHmiManager.showLimitingVelocity(limitingVelocitySpeed, 1)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,7 +76,7 @@ class V2XWarningBroadcastReceiver : BroadcastReceiver() {
|
||||
tag: String?
|
||||
) {
|
||||
if (EventTypeEnum.TYPE_USECASE_ID_IVP.poiType == v2xType.toString()) {
|
||||
CallerHmiManager.showLimitingVelocity(1)
|
||||
CallerHmiManager.showLimitingVelocity(1, 1)
|
||||
}
|
||||
if (alertContent.isNullOrEmpty() || ttsContent.isNullOrEmpty()) {
|
||||
Log.d("MsgBox-V2XWarningBR", "alertContent或ttsContent为空!")
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,8 @@ import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
|
||||
|
||||
/**
|
||||
@@ -18,8 +18,24 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
*/
|
||||
class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
companion object{
|
||||
private const val TAG = "BindingCarDialog"
|
||||
companion object {
|
||||
private const val TAG = "ModifyBindingCarDialog"
|
||||
|
||||
private var modifyBindingCarDialog: ModifyBindingCarDialog? = null
|
||||
|
||||
fun show(context: Context?) {
|
||||
context?.let {
|
||||
if (modifyBindingCarDialog == null) {
|
||||
modifyBindingCarDialog = ModifyBindingCarDialog(it)
|
||||
}
|
||||
modifyBindingCarDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var confirmTv: TextView? = null
|
||||
@@ -58,7 +74,7 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
* 修改绑定车机
|
||||
*/
|
||||
private fun modifyBindingCar() {
|
||||
CallerDevaToolsManager.modifyCarInfo{
|
||||
CallerDevaToolsManager.modifyCarInfo {
|
||||
if (it.code == 200) {
|
||||
TipToast.shortTip("修改绑定成功")
|
||||
} else {
|
||||
@@ -70,6 +86,7 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
modifyBindingCarDialog = null
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
@@ -77,12 +94,4 @@ class ModifyBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifec
|
||||
)
|
||||
}
|
||||
|
||||
fun showModifyBindingCarDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -8,28 +8,45 @@ import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
|
||||
|
||||
|
||||
/**
|
||||
* @brief 绑定车辆对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
companion object{
|
||||
companion object {
|
||||
private const val TAG = "ToBindingCarDialog"
|
||||
|
||||
private var toBindingCarDialog: ToBindingCarDialog? = null
|
||||
|
||||
fun show(context: Context?) {
|
||||
context?.let {
|
||||
if (toBindingCarDialog == null) {
|
||||
toBindingCarDialog = ToBindingCarDialog(it)
|
||||
}
|
||||
toBindingCarDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancelTv: TextView? = null
|
||||
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
private val statusChangedListenerForCheckNotice =
|
||||
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_to_bindingcar)
|
||||
@@ -57,7 +74,7 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
* 修改绑定车机
|
||||
*/
|
||||
private fun toBindingCar() {
|
||||
CallerDevaToolsManager.modifyCarInfo{
|
||||
CallerDevaToolsManager.modifyCarInfo {
|
||||
if (it.code == 200) {
|
||||
TipToast.shortTip("绑定成功")
|
||||
} else {
|
||||
@@ -69,6 +86,7 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
toBindingCarDialog = null
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
@@ -76,12 +94,4 @@ class ToBindingCarDialog(context: Context) : BaseFloatDialog(context), Lifecycle
|
||||
)
|
||||
}
|
||||
|
||||
fun showToBindingCarDialog() {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -15,15 +15,40 @@ import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
*/
|
||||
class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private val TAG = "UpgradeAppDialog"
|
||||
companion object{
|
||||
private const val TAG = "UpgradeAppDialog"
|
||||
|
||||
private var upgradeAppDialog: UpgradeAppDialog? = null
|
||||
|
||||
fun show(context: Context?,
|
||||
name: String,
|
||||
url: String,
|
||||
title: String,
|
||||
content: String,
|
||||
installType: String) {
|
||||
context?.let {
|
||||
if (upgradeAppDialog == null) {
|
||||
upgradeAppDialog = UpgradeAppDialog(it)
|
||||
}
|
||||
upgradeAppDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.showUpgradeAppDialog(name, url, title, content, installType)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private var confirmTv: TextView? = null
|
||||
private var cancleTv: TextView? = null
|
||||
private var cancelTv: TextView? = null
|
||||
private var upgradeTitleTv: TextView? = null
|
||||
private var upgradeContentTv: TextView? = null
|
||||
private var verticalLineView: View? = null
|
||||
private var confirmForceTv: TextView? = null
|
||||
private var tag: String? = null
|
||||
private var downloarUrl: String? = null
|
||||
private var downloadUrl: String? = null
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_upgrade_app)
|
||||
@@ -32,7 +57,7 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
upgradeTitleTv = findViewById(R.id.tv_upgrade_title)
|
||||
upgradeContentTv = findViewById(R.id.tv_upgrade_content)
|
||||
confirmTv = findViewById(R.id.tv_upgrade_confirm)
|
||||
cancleTv = findViewById(R.id.tv_upgrade_cancel)
|
||||
cancelTv = findViewById(R.id.tv_upgrade_cancel)
|
||||
verticalLineView = findViewById(R.id.view_vertical_line)
|
||||
confirmForceTv = findViewById(R.id.tv_upgrade_confirm_force)
|
||||
|
||||
@@ -40,7 +65,7 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
downloadApp()
|
||||
}
|
||||
|
||||
cancleTv?.setOnClickListener {
|
||||
cancelTv?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
@@ -55,13 +80,14 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
*/
|
||||
fun downloadApp() {
|
||||
ToastUtils.showLong("开始下载APK,稍后可前往downloads文件夹查看,通知栏查看下载进度")
|
||||
tag?.let { downloarUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
||||
tag?.let { downloadUrl?.let { it1 -> CallerDevaToolsManager.downLoadPackage(it, it1) } }
|
||||
|
||||
dismiss()
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
upgradeAppDialog = null
|
||||
}
|
||||
|
||||
// 升级类型 1:提示升级 2:静默升级 3:强制升级
|
||||
@@ -72,29 +98,29 @@ class UpgradeAppDialog(context: Context) : BaseFloatDialog(context), LifecycleOb
|
||||
content: String,
|
||||
installType: String
|
||||
) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
tag = name
|
||||
downloarUrl = url
|
||||
downloadUrl = url
|
||||
upgradeTitleTv?.text = title
|
||||
upgradeContentTv?.text = content
|
||||
|
||||
if (installType.equals("1")) {
|
||||
confirmForceTv?.visibility = View.GONE
|
||||
confirmTv?.visibility = View.VISIBLE
|
||||
cancleTv?.visibility = View.VISIBLE
|
||||
verticalLineView?.visibility = View.VISIBLE
|
||||
} else if (installType.equals("3")) {
|
||||
confirmTv?.visibility = View.GONE
|
||||
cancleTv?.visibility = View.GONE
|
||||
verticalLineView?.visibility = View.GONE
|
||||
when (installType) {
|
||||
"1" -> {
|
||||
confirmForceTv?.visibility = View.GONE
|
||||
confirmTv?.visibility = View.VISIBLE
|
||||
cancelTv?.visibility = View.VISIBLE
|
||||
verticalLineView?.visibility = View.VISIBLE
|
||||
}
|
||||
"3" -> {
|
||||
confirmTv?.visibility = View.GONE
|
||||
cancelTv?.visibility = View.GONE
|
||||
verticalLineView?.visibility = View.GONE
|
||||
|
||||
confirmForceTv?.visibility = View.VISIBLE
|
||||
} else if (installType.equals("2")) {
|
||||
//静默安装
|
||||
confirmForceTv?.visibility = View.VISIBLE
|
||||
}
|
||||
"2" -> {
|
||||
//静默安装
|
||||
}
|
||||
}
|
||||
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
||||
@@ -30,7 +30,25 @@ import tv.danmaku.ijk.media.player.IjkMediaPlayer
|
||||
*/
|
||||
class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private val TAG = "RoadVideoDialog"
|
||||
companion object {
|
||||
private const val TAG = "RoadVideoDialog"
|
||||
|
||||
private var roadVideoDialog: RoadVideoDialog? = null
|
||||
|
||||
fun show(context: Context?, infList: List<Infrastructure>) {
|
||||
context?.let {
|
||||
if (roadVideoDialog == null) {
|
||||
roadVideoDialog = RoadVideoDialog(it)
|
||||
}
|
||||
roadVideoDialog?.let { dialog ->
|
||||
if(dialog.isShowing){
|
||||
return
|
||||
}
|
||||
dialog.show(infList)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val gsyVideoOptionBuilder by lazy {
|
||||
GSYVideoOptionBuilder()
|
||||
@@ -150,6 +168,7 @@ class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObs
|
||||
private fun stopLive() {
|
||||
try {
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
roadVideoDialog = null
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ public class DispatchDialogManager {
|
||||
}
|
||||
|
||||
public void showDialog(DispatchAdasAutoPilotLocReceiverBean msgData) {
|
||||
if(isShowing()){
|
||||
return;
|
||||
}
|
||||
if (msgData == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,15 +10,15 @@ import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleVideoPlayer
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
@@ -28,9 +28,28 @@ import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
* @brief 点击查看对话框
|
||||
* @author lixiaopeng
|
||||
*/
|
||||
class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver{
|
||||
class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "NoticeCheckDialog"
|
||||
|
||||
private var pushCheckDialog: NoticeCheckDialog? = null
|
||||
|
||||
fun show(context: Context?, normalData: NoticeNormalData) {
|
||||
context?.let {
|
||||
if (pushCheckDialog == null) {
|
||||
pushCheckDialog = NoticeCheckDialog(it)
|
||||
}
|
||||
pushCheckDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.showCheckDialog(normalData)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val TAG = "NoticeCheckDialog"
|
||||
private var pushCheckClose: ImageView? = null
|
||||
private var pushCheckTitle: TextView? = null
|
||||
private var pushCheckContent: TextView? = null
|
||||
@@ -42,11 +61,12 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
private var mVideoUrl: String = ""
|
||||
private var playErrorImageView: ImageView? = null
|
||||
private var connectTextView: TextView? = null
|
||||
private val statusChangedListenerForCheckNotice = IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
private val statusChangedListenerForCheckNotice =
|
||||
IMogoStatusChangedListener { descriptor, isTrue ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.notice_dialog_check_with_accessory)
|
||||
@@ -92,13 +112,21 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
playVideo(mVideoUrl)
|
||||
}
|
||||
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForCheckNotice)
|
||||
pushCheckDialog = null
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForCheckNotice
|
||||
)
|
||||
stopLive()
|
||||
}
|
||||
|
||||
@@ -106,10 +134,6 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
* 展示详情页面
|
||||
*/
|
||||
fun showCheckDialog(noticeNormal: NoticeNormalData) {
|
||||
if (isShowing || noticeNormal == null) {
|
||||
return
|
||||
}
|
||||
|
||||
if (noticeNormal.title.isBlank() || noticeNormal.content.isBlank()) {
|
||||
return
|
||||
}
|
||||
@@ -148,7 +172,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
private fun playVideo(videoUrl: String) {
|
||||
try {
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag(TAG)
|
||||
.build(pushVideo)
|
||||
.build(pushVideo)
|
||||
pushVideo!!.startButton.performClick()
|
||||
playImageView!!.visibility = View.GONE
|
||||
thumbnailImageView!!.visibility = View.GONE
|
||||
@@ -187,11 +211,11 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
/**
|
||||
* 播放结束后
|
||||
*/
|
||||
private fun complete(firstbitmap: Bitmap, path: String) {
|
||||
private fun complete(firstBitmap: Bitmap, path: String) {
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||
thumbnailImageView!!.visibility = View.VISIBLE
|
||||
GlideApp.with(context).load(firstbitmap).optionalTransform(
|
||||
GlideApp.with(context).load(firstBitmap).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
@@ -201,7 +225,7 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
}
|
||||
|
||||
private fun startVideoCallBack(path: String) {
|
||||
Thread(Runnable {
|
||||
Thread {
|
||||
val firstBitmap = BitmapHelper.getVideoThumbnail(path) /*获取第一帧图*/
|
||||
pushVideo!!.setVideoAllCallBack(object : VideoAllCallBack {
|
||||
override fun onAutoComplete(url: String, vararg objects: Any) {
|
||||
@@ -214,15 +238,15 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
}
|
||||
|
||||
override fun onClickStop(url: String, vararg objects: Any) {
|
||||
CallerLogger.d(M_HMI + TAG, "onClickStop")
|
||||
CallerLogger.d(M_HMI + TAG, "onClickStop")
|
||||
}
|
||||
|
||||
override fun onStartPrepared(url: String, vararg objects: Any) {
|
||||
CallerLogger.d(M_HMI + TAG, "onStartPrepared")
|
||||
CallerLogger.d(M_HMI + TAG, "onStartPrepared")
|
||||
}
|
||||
|
||||
override fun onPlayError(url: String, vararg objects: Any) {
|
||||
CallerLogger.d(M_HMI + TAG, "onPlayError")
|
||||
CallerLogger.d(M_HMI + TAG, "onPlayError")
|
||||
pushImageView?.visibility = View.GONE
|
||||
pushVideo?.visibility = View.GONE
|
||||
playImageView!!.visibility = View.GONE
|
||||
@@ -249,10 +273,10 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context), LifecycleO
|
||||
override fun onClickStartThumb(url: String, vararg objects: Any) {}
|
||||
override fun onClickBlank(url: String, vararg objects: Any) {}
|
||||
override fun onClickBlankFullscreen(url: String, vararg objects: Any) {
|
||||
CallerLogger.d(M_HMI + TAG, "onClickBlankFullscreen")
|
||||
CallerLogger.d(M_HMI + TAG, "onClickBlankFullscreen")
|
||||
}
|
||||
})
|
||||
}).start()
|
||||
}.start()
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,451 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.lifecycle.LifecycleObserver;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
|
||||
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig;
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener;
|
||||
import com.mogo.commons.module.status.MogoStatusManager;
|
||||
import com.mogo.commons.module.status.StatusDescriptor;
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeValue;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp;
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform;
|
||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper;
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils;
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer;
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog;
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager;
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder;
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack;
|
||||
import com.shuyu.gsyvideoplayer.utils.NetworkUtils;
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 交警事故详情弹框
|
||||
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=66917475 根据infoId获取事故详情
|
||||
* @since: 10/26/21
|
||||
*/
|
||||
public class NoticeTrafficDialog extends BaseFloatDialog implements LifecycleObserver {
|
||||
private String TAG = "AINotice";
|
||||
private Context mContext;
|
||||
private RecyclerView mRecyclerView;
|
||||
private NoticeSimpleSmallVideoPlayer mVideoPlayer;
|
||||
private NoticeTrafficStylePushData mPushData;
|
||||
private ImageView close;
|
||||
private ImageView playImageView;
|
||||
private MogoImageView thumbnailImage;
|
||||
private final GSYVideoOptionBuilder gsyVideoOptionBuilder = new GSYVideoOptionBuilder();
|
||||
private TextView accept;//接受
|
||||
private TextView refuse;//拒绝
|
||||
private TextView connect;//连接
|
||||
private NoticeTrafficAdapter adapter;
|
||||
private final ArrayList<NoticeValue> dataArrayList = new ArrayList<>();
|
||||
private NoticeTrafficStyleInfo.NoticeTrafficAccountInfo mTrafficStyleInfo;
|
||||
|
||||
public NoticeTrafficDialog(@NonNull Context context, NoticeTrafficStylePushData pushData) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
mPushData = pushData;
|
||||
initView();
|
||||
}
|
||||
|
||||
public NoticeTrafficDialog(@NonNull Context context, int themeResId) {
|
||||
super(context, themeResId);
|
||||
}
|
||||
|
||||
public void initView() {
|
||||
setContentView(R.layout.notice_dialog_traffic_police);
|
||||
setCanceledOnTouchOutside(true);
|
||||
playerShow();//视频播放器及接操作按钮
|
||||
recyclerVie();//详情信息列表
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据推送消息渲染顶部图片/视频
|
||||
* type 0图片 1视频
|
||||
*/
|
||||
private void playerShow() {
|
||||
mVideoPlayer = findViewById(R.id.video_player);
|
||||
thumbnailImage = findViewById(R.id.thumbnail_image);
|
||||
playImageView = this.findViewById(R.id.start_for_traffic);
|
||||
playImageView.setOnClickListener(v -> startLive());
|
||||
close = findViewById(R.id.notice_traffic_dialog_close);
|
||||
close.setOnClickListener(v -> {
|
||||
releasePlayer();
|
||||
dismiss();
|
||||
});
|
||||
accept = findViewById(R.id.accept_traffic);
|
||||
refuse = findViewById(R.id.refuse_traffic);
|
||||
connect = findViewById(R.id.notice_connect);
|
||||
accept.setOnClickListener(v -> feedBackTraffic(1));
|
||||
refuse.setOnClickListener(v -> feedBackTraffic(0));
|
||||
//重新连接
|
||||
connect.setOnClickListener(v -> {
|
||||
netWorkStatus();
|
||||
startLive();
|
||||
requestTrafficInfo();
|
||||
});
|
||||
requestTrafficInfo();
|
||||
netWorkStatus();
|
||||
if (mPushData.getType() == 1) {
|
||||
startLive();
|
||||
} else {
|
||||
GlideApp.with(mContext).load(mPushData.getPoiImgUrl()).optionalTransform(new GlideRoundedCornersTransform
|
||||
(20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImage);
|
||||
mVideoPlayer.setVisibility(View.INVISIBLE);
|
||||
playImageView.setVisibility(View.INVISIBLE);
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mVideoPlayer.setOnClickListener(v -> {
|
||||
if (mVideoPlayer.getCurrentState() == GSYVideoView.CURRENT_STATE_PAUSE) {/*播放中*/
|
||||
resume();
|
||||
} else {
|
||||
pause();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void recyclerVie() {
|
||||
//网格绘制
|
||||
try {
|
||||
mRecyclerView = findViewById(R.id.traffic_info_recyclerView);
|
||||
//网格布局
|
||||
StaggeredGridLayoutManager staggeredGridLayoutManager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL);
|
||||
mRecyclerView.setLayoutManager(staggeredGridLayoutManager);
|
||||
NoticeTrafficInfoGridItemDivider gridLayoutDivider = new NoticeTrafficInfoGridItemDivider(1,
|
||||
(mContext.getResources().getColor(R.color.notice_check_dialog_bg_color)));
|
||||
mRecyclerView.addItemDecoration(gridLayoutDivider);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
adapter = new NoticeTrafficAdapter(mContext, dataArrayList);
|
||||
mRecyclerView.setAdapter(adapter);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @param i 是否接受交通事故任务
|
||||
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
||||
*/
|
||||
private void feedBackTraffic(int i) {
|
||||
CallerFuncBizManager.getBizProvider().feedBackNoticeTraffic(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), i);
|
||||
if (i == 1) {
|
||||
startAutoPilot();
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*/
|
||||
private void startAutoPilot() {
|
||||
if (mTrafficStyleInfo != null) {
|
||||
AutopilotControlParameters parameters = new AutopilotControlParameters();
|
||||
parameters.isSpeakVoice = false;
|
||||
parameters.vehicleType = 10;
|
||||
//云平台使用的是火星坐标,自动驾驶需要wgs84
|
||||
double[] gcj02 = CoordinateUtils.transformGcj02toWgs84(mTrafficStyleInfo.getLat(), mTrafficStyleInfo.getLon());
|
||||
parameters.startLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat(),
|
||||
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon());
|
||||
parameters.endLatLon = new AutopilotControlParameters.AutoPilotLonLat
|
||||
(gcj02[0], gcj02[1]);
|
||||
CallerAutoPilotManager.INSTANCE.startAutoPilot(parameters);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
private void pause() {
|
||||
playImageView.setVisibility(View.VISIBLE);
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
playImageView.setOnClickListener(v -> mVideoPlayer.onVideoResume());
|
||||
thumbnailImage.setOnClickListener(v -> mVideoPlayer.onVideoResume());
|
||||
}
|
||||
|
||||
/**
|
||||
* 继续
|
||||
*/
|
||||
private void resume() {
|
||||
playImageView.setImageResource(R.drawable.notice_video_pause);
|
||||
playImageView.setVisibility(View.GONE);
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放结束后
|
||||
*/
|
||||
private void complete(Bitmap firstbitmap) {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
// thumbnailImage.setImageBitmap(firstbitmap);
|
||||
GlideApp.with(mContext).load(firstbitmap).optionalTransform(new GlideRoundedCornersTransform
|
||||
(20f, GlideRoundedCornersTransform.CornerType.ALL)).into(thumbnailImage);
|
||||
playImageView.setImageResource(R.drawable.notice_video_play);
|
||||
playImageView.setVisibility(View.VISIBLE);
|
||||
playImageView.setOnClickListener(v -> startLive());
|
||||
thumbnailImage.setOnClickListener(v -> startLive());
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频播放
|
||||
*/
|
||||
private void startLive() {
|
||||
if (mPushData != null) {
|
||||
try {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交警事故开始播放视频startLive");
|
||||
String videoUrl = mPushData.getPoiImgUrl();
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false).setPlayTag("NoticeTrafficDialog")
|
||||
.build(mVideoPlayer);
|
||||
mVideoPlayer.getStartButton().performClick();
|
||||
liveCallBack();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
if (dataArrayList.size() == 0) {
|
||||
requestTrafficInfo();
|
||||
}
|
||||
}
|
||||
|
||||
private void liveCallBack() {
|
||||
new Thread(() -> {
|
||||
Bitmap firstBitmap = BitmapHelper.getVideoThumbnail(mPushData.getPoiImgUrl());/*获取第一帧图*/
|
||||
mVideoPlayer.setVideoAllCallBack(new VideoAllCallBack() {
|
||||
@Override
|
||||
public void onAutoComplete(String url, Object... objects) {
|
||||
complete(firstBitmap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickResume(String url, Object... objects) {
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
playImageView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStop(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStop");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartPrepared(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onStartPrepared");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPrepared(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onPrepared");
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
playImageView.setVisibility(View.GONE);
|
||||
connect.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStartIcon(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStartIcon");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStartError(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.e(M_HMI + TAG, "onClickStartError");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStopFullscreen(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStopFullscreen");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickResumeFullscreen(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickSeekbar(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickSeekbarFullscreen(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnterFullscreen(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQuitFullscreen(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQuitSmallWidget(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnterSmallWidget(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchScreenSeekVolume(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchScreenSeekPosition(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouchScreenSeekLight(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPlayError(String url, Object... objects) {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
connect.setVisibility(View.VISIBLE);
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onPlayError");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickStartThumb(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickStartThumb");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickBlank(String url, Object... objects) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickBlankFullscreen(String url, Object... objects) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onClickBlankFullscreen");
|
||||
|
||||
}
|
||||
});
|
||||
}).start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取交通事故详情
|
||||
*/
|
||||
private void requestTrafficInfo() {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "requestTrafficInfo");
|
||||
CallerFuncBizManager.getBizProvider().requestAccidentInfo(mPushData.getInfoId(), MoGoAiCloudClientConfig.getInstance().getSn(), trafficInfo -> {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "交通事故详情::" + trafficInfo);
|
||||
mTrafficStyleInfo = trafficInfo.getResult().getAccidentInfo();
|
||||
infoRefresh(mTrafficStyleInfo);
|
||||
});
|
||||
}
|
||||
|
||||
private void infoRefresh(NoticeTrafficStyleInfo.NoticeTrafficAccountInfo info) {
|
||||
if (dataArrayList.size() > 0) {
|
||||
dataArrayList.clear();
|
||||
}
|
||||
NoticeValue laiYuan = new NoticeValue();
|
||||
laiYuan.setKey("事故来源:");
|
||||
laiYuan.setValue(info.getUploadType());
|
||||
dataArrayList.add(laiYuan);
|
||||
|
||||
NoticeValue cTime = new NoticeValue();
|
||||
cTime.setKey("事故时间:");
|
||||
cTime.setValue(DateTimeUtils.getTimeText(info.getDataCreateTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
|
||||
dataArrayList.add(cTime);
|
||||
|
||||
NoticeValue hTime = new NoticeValue();
|
||||
hTime.setKey("处理时间:");
|
||||
hTime.setValue(DateTimeUtils.getTimeText(info.getDataHandleTime(), DateTimeUtils.MM_Yue_dd_Ri_HH_mm));
|
||||
dataArrayList.add(hTime);
|
||||
|
||||
NoticeValue reason = new NoticeValue();
|
||||
reason.setKey("事故原因:");
|
||||
reason.setValue(info.getReason());
|
||||
dataArrayList.add(reason);
|
||||
|
||||
NoticeValue status = new NoticeValue();
|
||||
status.setKey("处理状态:");
|
||||
if (info.getOperaStatus().equals("1")) {
|
||||
status.setValue("待处理");
|
||||
} else {
|
||||
status.setValue("已处理");
|
||||
}
|
||||
dataArrayList.add(status);
|
||||
|
||||
NoticeValue location = new NoticeValue();
|
||||
location.setKey("事故地点:");
|
||||
location.setValue(info.getUploadAddress());
|
||||
dataArrayList.add(location);
|
||||
|
||||
NoticeValue style = new NoticeValue();
|
||||
style.setKey("事故等级:");
|
||||
style.setValue(info.getTroubleTypeName());
|
||||
dataArrayList.add(style);
|
||||
|
||||
adapter.setData(dataArrayList);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断网络状态
|
||||
*/
|
||||
private void netWorkStatus() {
|
||||
if (NetworkUtils.isAvailable(getContext())) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "网络可用");
|
||||
thumbnailImage.setVisibility(View.GONE);
|
||||
connect.setVisibility(View.GONE);
|
||||
thumbnailImage.setBackgroundResource(R.drawable.notice_traffic_placeholder);
|
||||
} else {
|
||||
thumbnailImage.setVisibility(View.VISIBLE);
|
||||
thumbnailImage.setBackgroundResource(R.drawable.notice_unsuccess_traffic);
|
||||
connect.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void cancel() {
|
||||
|
||||
}
|
||||
|
||||
private void releasePlayer() {
|
||||
try {
|
||||
GSYVideoManager.releaseAllVideos();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dismiss() {
|
||||
super.dismiss();
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "trafficDialog dismiss");
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(M_HMI + TAG, StatusDescriptor.MAIN_PAGE_IS_BACKGROUND, statusChangedListenerForNotice);
|
||||
releasePlayer();
|
||||
}
|
||||
|
||||
private final IMogoStatusChangedListener statusChangedListenerForNotice = (descriptor, isTrue) -> {
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
CallerLogger.INSTANCE.d(M_HMI + TAG, "onStatusChanged==MAIN_PAGE_IS_BACKGROUND");
|
||||
dismiss();
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,445 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.notice.traffic
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Bitmap
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.recyclerview.widget.StaggeredGridLayoutManager
|
||||
import com.mogo.cloud.commons.utils.CoordinateUtils
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.module.status.IMogoStatusChangedListener
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.commons.module.status.StatusDescriptor
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters.AutoPilotLonLat
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo.NoticeTrafficAccountInfo
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.data.notice.NoticeValue
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager.startAutoPilot
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager.bizProvider
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.GlideApp
|
||||
import com.mogo.eagle.core.utilcode.mogo.glide.transform.GlideRoundedCornersTransform
|
||||
import com.mogo.eagle.core.utilcode.mogo.imageloader.MogoImageView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.d
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.e
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.BitmapHelper
|
||||
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
|
||||
import com.mogo.eagle.core.widget.media.video.NoticeSimpleSmallVideoPlayer
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.listener.VideoAllCallBack
|
||||
import com.shuyu.gsyvideoplayer.utils.NetworkUtils
|
||||
import com.shuyu.gsyvideoplayer.video.base.GSYVideoView
|
||||
|
||||
/**
|
||||
* @author liujing
|
||||
* @description 交警事故详情弹框
|
||||
* http://wiki.zhidaohulian.com/pages/viewpage.action?pageId=66917475 根据infoId获取事故详情
|
||||
* @since: 10/26/21
|
||||
*/
|
||||
class NoticeTrafficDialog : BaseFloatDialog, LifecycleObserver {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "AINotice"
|
||||
|
||||
private var noticeTrafficDialog: NoticeTrafficDialog? = null
|
||||
|
||||
fun show(context: Context?, trafficStylePushData: NoticeTrafficStylePushData) {
|
||||
context?.let {
|
||||
if (noticeTrafficDialog == null) {
|
||||
noticeTrafficDialog = NoticeTrafficDialog(it, trafficStylePushData)
|
||||
}
|
||||
noticeTrafficDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private var mContext: Context? = null
|
||||
private var mRecyclerView: RecyclerView? = null
|
||||
private var mVideoPlayer: NoticeSimpleSmallVideoPlayer? = null
|
||||
private var mPushData: NoticeTrafficStylePushData? = null
|
||||
private var close: ImageView? = null
|
||||
private var playImageView: ImageView? = null
|
||||
private var thumbnailImage: MogoImageView? = null
|
||||
private val gsyVideoOptionBuilder = GSYVideoOptionBuilder()
|
||||
private var accept: TextView? = null//接受
|
||||
private var refuse: TextView? = null//拒绝
|
||||
private var connect: TextView? = null//连接
|
||||
private var adapter: NoticeTrafficAdapter? = null
|
||||
private val dataArrayList = ArrayList<NoticeValue?>()
|
||||
private var mTrafficStyleInfo: NoticeTrafficAccountInfo? = null
|
||||
|
||||
constructor(context: Context, pushData: NoticeTrafficStylePushData?) : super(context) {
|
||||
mContext = context
|
||||
mPushData = pushData
|
||||
initView()
|
||||
}
|
||||
|
||||
fun initView() {
|
||||
setContentView(R.layout.notice_dialog_traffic_police)
|
||||
setCanceledOnTouchOutside(true)
|
||||
playerShow() //视频播放器及接操作按钮
|
||||
recyclerVie() //详情信息列表
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
SceneConstant.M_HMI + TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForNotice
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据推送消息渲染顶部图片/视频
|
||||
* type 0图片 1视频
|
||||
*/
|
||||
private fun playerShow() {
|
||||
mVideoPlayer = findViewById(R.id.video_player)
|
||||
thumbnailImage = findViewById(R.id.thumbnail_image)
|
||||
playImageView = findViewById(R.id.start_for_traffic)
|
||||
close = findViewById(R.id.notice_traffic_dialog_close)
|
||||
accept = findViewById(R.id.accept_traffic)
|
||||
refuse = findViewById(R.id.refuse_traffic)
|
||||
connect = findViewById(R.id.notice_connect)
|
||||
|
||||
playImageView?.setOnClickListener { startLive() }
|
||||
close?.setOnClickListener {
|
||||
releasePlayer()
|
||||
dismiss()
|
||||
}
|
||||
accept?.setOnClickListener { feedBackTraffic(1) }
|
||||
refuse?.setOnClickListener { feedBackTraffic(0) }
|
||||
//重新连接
|
||||
connect?.setOnClickListener {
|
||||
netWorkStatus()
|
||||
startLive()
|
||||
requestTrafficInfo()
|
||||
}
|
||||
requestTrafficInfo()
|
||||
netWorkStatus()
|
||||
if (mPushData!!.type == 1) {
|
||||
startLive()
|
||||
} else {
|
||||
GlideApp.with(mContext!!).load(mPushData!!.poiImgUrl).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(thumbnailImage!!)
|
||||
mVideoPlayer?.visibility = View.INVISIBLE
|
||||
playImageView?.visibility = View.INVISIBLE
|
||||
thumbnailImage?.visibility = View.VISIBLE
|
||||
}
|
||||
mVideoPlayer?.setOnClickListener {
|
||||
if (mVideoPlayer!!.currentState == GSYVideoView.CURRENT_STATE_PAUSE) { /*播放中*/
|
||||
resume()
|
||||
} else {
|
||||
pause()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun recyclerVie() {
|
||||
//网格绘制
|
||||
try {
|
||||
mRecyclerView = findViewById(R.id.traffic_info_recyclerView)
|
||||
//网格布局
|
||||
val staggeredGridLayoutManager =
|
||||
StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL)
|
||||
mRecyclerView?.layoutManager = staggeredGridLayoutManager
|
||||
val gridLayoutDivider = NoticeTrafficInfoGridItemDivider(
|
||||
1,
|
||||
mContext!!.resources.getColor(R.color.notice_check_dialog_bg_color)
|
||||
)
|
||||
mRecyclerView?.addItemDecoration(gridLayoutDivider)
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
adapter = NoticeTrafficAdapter(mContext!!, dataArrayList)
|
||||
mRecyclerView!!.adapter = adapter
|
||||
}
|
||||
|
||||
/**
|
||||
* @param i 是否接受交通事故任务
|
||||
* 0不接收 1接受 发起自动驾驶任务,显示引导线
|
||||
*/
|
||||
private fun feedBackTraffic(i: Int) {
|
||||
bizProvider.feedBackNoticeTraffic(
|
||||
mPushData!!.infoId,
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
i
|
||||
)
|
||||
if (i == 1) {
|
||||
startAutoPilot()
|
||||
}
|
||||
dismiss()
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启自动驾驶
|
||||
*/
|
||||
private fun startAutoPilot() {
|
||||
if (mTrafficStyleInfo != null) {
|
||||
val parameters = AutopilotControlParameters()
|
||||
parameters.isSpeakVoice = false
|
||||
parameters.vehicleType = 10
|
||||
//云平台使用的是火星坐标,自动驾驶需要wgs84
|
||||
val gcj02 = CoordinateUtils.transformGcj02toWgs84(
|
||||
mTrafficStyleInfo!!.lat, mTrafficStyleInfo!!.lon
|
||||
)
|
||||
parameters.startLatLon = AutoPilotLonLat(
|
||||
getCurWgs84Lat(),
|
||||
getCurWgs84Lon()
|
||||
)
|
||||
parameters.endLatLon = AutoPilotLonLat(gcj02[0], gcj02[1])
|
||||
startAutoPilot(parameters)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 暂停
|
||||
*/
|
||||
private fun pause() {
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
playImageView!!.setOnClickListener { v: View? -> mVideoPlayer!!.onVideoResume() }
|
||||
thumbnailImage!!.setOnClickListener { v: View? -> mVideoPlayer!!.onVideoResume() }
|
||||
}
|
||||
|
||||
/**
|
||||
* 继续
|
||||
*/
|
||||
private fun resume() {
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_pause)
|
||||
playImageView!!.visibility = View.GONE
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
}
|
||||
|
||||
/**
|
||||
* 播放结束后
|
||||
*/
|
||||
private fun complete(firstBitmap: Bitmap) {
|
||||
thumbnailImage!!.visibility = View.VISIBLE
|
||||
GlideApp.with(mContext!!).load(firstBitmap).optionalTransform(
|
||||
GlideRoundedCornersTransform(
|
||||
20f,
|
||||
GlideRoundedCornersTransform.CornerType.ALL
|
||||
)
|
||||
).into(
|
||||
thumbnailImage!!
|
||||
)
|
||||
playImageView!!.setImageResource(R.drawable.notice_video_play)
|
||||
playImageView!!.visibility = View.VISIBLE
|
||||
playImageView!!.setOnClickListener { v: View? -> startLive() }
|
||||
thumbnailImage!!.setOnClickListener { v: View? -> startLive() }
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频播放
|
||||
*/
|
||||
private fun startLive() {
|
||||
if (mPushData != null) {
|
||||
try {
|
||||
d(SceneConstant.M_HMI + TAG, "交警事故开始播放视频startLive")
|
||||
val videoUrl = mPushData!!.poiImgUrl
|
||||
gsyVideoOptionBuilder.setUrl(videoUrl).setCacheWithPlay(false)
|
||||
.setPlayTag("NoticeTrafficDialog")
|
||||
.build(mVideoPlayer)
|
||||
mVideoPlayer!!.startButton.performClick()
|
||||
liveCallBack()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
if (dataArrayList.size == 0) {
|
||||
requestTrafficInfo()
|
||||
}
|
||||
}
|
||||
|
||||
private fun liveCallBack() {
|
||||
Thread {
|
||||
val firstBitmap = BitmapHelper.getVideoThumbnail(mPushData!!.poiImgUrl) /*获取第一帧图*/
|
||||
mVideoPlayer!!.setVideoAllCallBack(object : VideoAllCallBack {
|
||||
override fun onAutoComplete(url: String, vararg objects: Any) {
|
||||
complete(firstBitmap)
|
||||
}
|
||||
|
||||
override fun onClickResume(url: String, vararg objects: Any) {
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
playImageView!!.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun onClickStop(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickStop")
|
||||
}
|
||||
|
||||
override fun onStartPrepared(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onStartPrepared")
|
||||
}
|
||||
|
||||
override fun onPrepared(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onPrepared")
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
playImageView!!.visibility = View.GONE
|
||||
connect!!.visibility = View.GONE
|
||||
}
|
||||
|
||||
override fun onClickStartIcon(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickStartIcon")
|
||||
}
|
||||
|
||||
override fun onClickStartError(url: String, vararg objects: Any) {
|
||||
e(SceneConstant.M_HMI + TAG, "onClickStartError")
|
||||
}
|
||||
|
||||
override fun onClickStopFullscreen(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickStopFullscreen")
|
||||
}
|
||||
|
||||
override fun onClickResumeFullscreen(url: String, vararg objects: Any) {}
|
||||
override fun onClickSeekbar(url: String, vararg objects: Any) {}
|
||||
override fun onClickSeekbarFullscreen(url: String, vararg objects: Any) {}
|
||||
override fun onEnterFullscreen(url: String, vararg objects: Any) {}
|
||||
override fun onQuitFullscreen(url: String, vararg objects: Any) {}
|
||||
override fun onQuitSmallWidget(url: String, vararg objects: Any) {}
|
||||
override fun onEnterSmallWidget(url: String, vararg objects: Any) {}
|
||||
override fun onTouchScreenSeekVolume(url: String, vararg objects: Any) {}
|
||||
override fun onTouchScreenSeekPosition(url: String, vararg objects: Any) {}
|
||||
override fun onTouchScreenSeekLight(url: String, vararg objects: Any) {}
|
||||
override fun onPlayError(url: String, vararg objects: Any) {
|
||||
thumbnailImage!!.visibility = View.VISIBLE
|
||||
connect!!.visibility = View.VISIBLE
|
||||
d(SceneConstant.M_HMI + TAG, "onPlayError")
|
||||
}
|
||||
|
||||
override fun onClickStartThumb(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickStartThumb")
|
||||
}
|
||||
|
||||
override fun onClickBlank(url: String, vararg objects: Any) {}
|
||||
override fun onClickBlankFullscreen(url: String, vararg objects: Any) {
|
||||
d(SceneConstant.M_HMI + TAG, "onClickBlankFullscreen")
|
||||
}
|
||||
})
|
||||
}.start()
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取交通事故详情
|
||||
*/
|
||||
private fun requestTrafficInfo() {
|
||||
d(SceneConstant.M_HMI + TAG, "requestTrafficInfo")
|
||||
bizProvider.requestAccidentInfo(
|
||||
mPushData!!.infoId,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
) { trafficInfo: NoticeTrafficStyleInfo ->
|
||||
d(SceneConstant.M_HMI + TAG, "交通事故详情::$trafficInfo")
|
||||
mTrafficStyleInfo = trafficInfo.getResult().accidentInfo
|
||||
infoRefresh(mTrafficStyleInfo)
|
||||
}
|
||||
}
|
||||
|
||||
private fun infoRefresh(info: NoticeTrafficAccountInfo?) {
|
||||
if (dataArrayList.size > 0) {
|
||||
dataArrayList.clear()
|
||||
}
|
||||
val laiYuan = NoticeValue()
|
||||
laiYuan.key = "事故来源:"
|
||||
laiYuan.value = info!!.uploadType
|
||||
dataArrayList.add(laiYuan)
|
||||
val cTime = NoticeValue()
|
||||
cTime.key = "事故时间:"
|
||||
cTime.value = DateTimeUtils.getTimeText(
|
||||
info.dataCreateTime,
|
||||
DateTimeUtils.MM_Yue_dd_Ri_HH_mm
|
||||
)
|
||||
dataArrayList.add(cTime)
|
||||
val hTime = NoticeValue()
|
||||
hTime.key = "处理时间:"
|
||||
hTime.value = DateTimeUtils.getTimeText(
|
||||
info.dataHandleTime,
|
||||
DateTimeUtils.MM_Yue_dd_Ri_HH_mm
|
||||
)
|
||||
dataArrayList.add(hTime)
|
||||
val reason = NoticeValue()
|
||||
reason.key = "事故原因:"
|
||||
reason.value = info.reason
|
||||
dataArrayList.add(reason)
|
||||
val status = NoticeValue()
|
||||
status.key = "处理状态:"
|
||||
if (info.operaStatus == "1") {
|
||||
status.value = "待处理"
|
||||
} else {
|
||||
status.value = "已处理"
|
||||
}
|
||||
dataArrayList.add(status)
|
||||
val location = NoticeValue()
|
||||
location.key = "事故地点:"
|
||||
location.value = info.uploadAddress
|
||||
dataArrayList.add(location)
|
||||
val style = NoticeValue()
|
||||
style.key = "事故等级:"
|
||||
style.value = info.troubleTypeName
|
||||
dataArrayList.add(style)
|
||||
adapter!!.setData(dataArrayList)
|
||||
adapter!!.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断网络状态
|
||||
*/
|
||||
private fun netWorkStatus() {
|
||||
if (NetworkUtils.isAvailable(context)) {
|
||||
d(SceneConstant.M_HMI + TAG, "网络可用")
|
||||
thumbnailImage!!.visibility = View.GONE
|
||||
connect!!.visibility = View.GONE
|
||||
thumbnailImage!!.setBackgroundResource(R.drawable.notice_traffic_placeholder)
|
||||
} else {
|
||||
thumbnailImage!!.visibility = View.VISIBLE
|
||||
thumbnailImage!!.setBackgroundResource(R.drawable.notice_unsuccess_traffic)
|
||||
connect!!.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
override fun cancel() {}
|
||||
private fun releasePlayer() {
|
||||
try {
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
d(SceneConstant.M_HMI + TAG, "trafficDialog dismiss")
|
||||
noticeTrafficDialog = null
|
||||
MogoStatusManager.getInstance().unregisterStatusChangedListener(
|
||||
SceneConstant.M_HMI + TAG,
|
||||
StatusDescriptor.MAIN_PAGE_IS_BACKGROUND,
|
||||
statusChangedListenerForNotice
|
||||
)
|
||||
releasePlayer()
|
||||
}
|
||||
|
||||
private val statusChangedListenerForNotice =
|
||||
IMogoStatusChangedListener { descriptor: StatusDescriptor, isTrue: Boolean ->
|
||||
if (descriptor == StatusDescriptor.MAIN_PAGE_IS_BACKGROUND && isTrue) {
|
||||
d(SceneConstant.M_HMI + TAG, "onStatusChanged==MAIN_PAGE_IS_BACKGROUND")
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.camera.CameraEntity
|
||||
import com.mogo.eagle.core.data.deva.bizconfig.FuncBizConfig
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
|
||||
import com.zhjt.service_biz.BizConfig
|
||||
|
||||
class CameraLiveView private constructor() {
|
||||
|
||||
companion object {
|
||||
val cameraLiveView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
CameraLiveView()
|
||||
}
|
||||
}
|
||||
|
||||
// 超视距、路侧、前车直播
|
||||
private var cameraListView: CameraListView? = null
|
||||
private var cameraViewFloat: WarningFloat.Builder? = null
|
||||
|
||||
|
||||
@BizConfig(FuncBizConfig.V2I, "", FuncBizConfig.BIZ_RTS)
|
||||
fun showCameraList(
|
||||
context: Context?,
|
||||
cameraList: List<CameraEntity>?,
|
||||
liveStatus: ((Boolean) -> Unit)
|
||||
) {
|
||||
context?.let {
|
||||
if (cameraViewFloat == null) {
|
||||
if (cameraListView == null) {
|
||||
cameraListView = CameraListView(it)
|
||||
cameraListView!!.updateCameraData(cameraList)
|
||||
}
|
||||
cameraListView!!.setClickListener(object : CameraListView.ClickListener {
|
||||
override fun onClose(v: View) {
|
||||
// Builder和cameraListView都置空
|
||||
dismissFloatView()
|
||||
// 丢弃开启摄像头推流请求,同时monitor回调hmi的startRoadCameraLive()
|
||||
// 也做了cameraListView的非空判断
|
||||
CallerFuncBizManager.bizProvider.closeCameraLive()
|
||||
}
|
||||
|
||||
override fun onShowLive(isShow: Boolean) {
|
||||
liveStatus.invoke(isShow)
|
||||
}
|
||||
|
||||
override fun refreshCameraList() {
|
||||
cameraListView?.refreshCameraList(CallerFuncBizManager.bizProvider.getCameraList)
|
||||
}
|
||||
})
|
||||
cameraViewFloat = WarningFloat.with(it)
|
||||
.setTag("CameraListFloat")
|
||||
.setLayout(cameraListView!!)
|
||||
.setSidePattern(SidePattern.RIGHT)
|
||||
.setGravity(Gravity.RIGHT, -40, 255)
|
||||
.setImmersionStatusBar(true)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
cameraViewFloat = null
|
||||
cameraListView = null
|
||||
liveStatus.invoke(false)
|
||||
}
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
cameraViewFloat?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun startRoadCameraLive(flvUrl: String) {
|
||||
cameraListView?.startRoadCameraLive(flvUrl)
|
||||
}
|
||||
|
||||
fun showNoSignView() {
|
||||
cameraListView?.showNoSignal()
|
||||
}
|
||||
|
||||
private fun dismissFloatView() {
|
||||
cameraViewFloat?.let {
|
||||
WarningFloat.dismiss(it.config.floatTag, false)
|
||||
cameraViewFloat = null
|
||||
cameraListView = null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,6 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManage
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerHDMapManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapLocationListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerSmpManager
|
||||
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
|
||||
@@ -89,7 +88,9 @@ import kotlin.collections.component3
|
||||
import kotlin.collections.component4
|
||||
import kotlin.collections.set
|
||||
import kotlin.math.abs
|
||||
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import kotlinx.coroutines.launch
|
||||
import com.mogo.eagle.core.utilcode.kotlin.lifecycleOwner
|
||||
|
||||
/**
|
||||
* @author xiaoyuzhou
|
||||
@@ -97,7 +98,7 @@ import kotlin.math.abs
|
||||
* 调试使用的设置页面,这里只作为调试使用
|
||||
* 展示 本机、网络、工控机、OBU等状态信息,支持设置IP,等参数进行调试
|
||||
*/
|
||||
class DebugSettingView @JvmOverloads constructor(
|
||||
internal class DebugSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
@@ -196,8 +197,6 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
// 添加 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.addListener(TAG, this)
|
||||
// 添加 地图样式改变 监听
|
||||
CallerMapLocationListenerManager.addListener(TAG, this, false)
|
||||
// 添加 域控制器感知数据 监听
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
// 添加 规划路径相关回调 监听
|
||||
@@ -224,7 +223,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
logInfoView!!.onEnterForeground()
|
||||
}
|
||||
// 开启定时查询速度
|
||||
Timer().schedule(timerTaskRefresh, Date(), 100)
|
||||
Timer().schedule(timerTaskRefresh, Date(), 300)
|
||||
if (AppConfigInfo.isConnectAutopilot && (AppConfigInfo.plateNumber.isNullOrEmpty() || AppConfigInfo.iPCMacAddress.isNullOrEmpty())) {
|
||||
//查询工控机基础配置信息
|
||||
CallerAutoPilotManager.getCarConfig()
|
||||
@@ -240,7 +239,7 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
// 移除 ADAS车辆状态&定位 监听
|
||||
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
|
||||
// 移除 地图样式改变 监听
|
||||
CallerMapLocationListenerManager.removeListener(TAG, false)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
// 移除 域控制器感知数据 监听
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
// 移除 规划路径相关回调 监听
|
||||
@@ -1695,10 +1694,10 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}"
|
||||
)
|
||||
|
||||
|
||||
tvAutopilotInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||
tvIpcInfo.text = GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||
tvIpcInfoKey.text = GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||
val autopilotJson = GsonUtils.toJson(mAutoPilotStatusInfo)
|
||||
tvAutopilotInfo.text = autopilotJson
|
||||
tvIpcInfo.text = autopilotJson
|
||||
tvIpcInfoKey.text = autopilotJson
|
||||
|
||||
tvCarInfo.text =
|
||||
"GPS时间:${(mGnssInfo?.satelliteTime?.times(1000))?.toLong()}\n" +
|
||||
@@ -1743,18 +1742,20 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
* OBU状态回调
|
||||
*/
|
||||
override fun onObuStatusResponse(obuStatusInfo: ObuStatusInfo) {
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
lifecycleOwner.lifecycleScope.launch {
|
||||
tvObuInfo.text = GsonUtils.toJson(obuStatusInfo)
|
||||
|
||||
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
|
||||
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus
|
||||
AppConfigInfo.obuSdkVersion = obuStatusInfo.obuSdkVersion
|
||||
AppConfigInfo.isConnectObu = obuStatusInfo.obuStatus
|
||||
|
||||
if (obuStatusInfo.obuStatus) {
|
||||
obuConnectStatus = true
|
||||
}
|
||||
//OBU断开连接,提示异常
|
||||
if (obuConnectStatus && !obuStatusInfo.obuStatus) {
|
||||
obuConnectStatus = false
|
||||
toastMsg("OBU连接状态异常")
|
||||
if (obuStatusInfo.obuStatus) {
|
||||
obuConnectStatus = true
|
||||
}
|
||||
//OBU断开连接,提示异常
|
||||
if (obuConnectStatus && !obuStatusInfo.obuStatus) {
|
||||
obuConnectStatus = false
|
||||
toastMsg("OBU连接状态异常")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.graphics.PixelFormat
|
||||
import android.util.DisplayMetrics
|
||||
import android.view.*
|
||||
@@ -12,14 +13,36 @@ import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.toast.ResourcesHelper.getDrawable
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import java.lang.reflect.Field
|
||||
import com.mogo.eagle.core.utilcode.util.SoundUtils
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机异常节点上报
|
||||
* @since: 2022/5/12
|
||||
*/
|
||||
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "IPCReportWindow"
|
||||
|
||||
private var ipcReportWindow: IPCReportWindow? = null
|
||||
|
||||
fun show(
|
||||
context: Context?,
|
||||
errorReportList: ArrayList<ReportEntity>,
|
||||
warningReportList: ArrayList<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
context?.let {
|
||||
if (ipcReportWindow == null) {
|
||||
ipcReportWindow = IPCReportWindow(it as Activity)
|
||||
SoundUtils.playRing(it)
|
||||
}
|
||||
ipcReportWindow?.showFloatWindow()
|
||||
ipcReportWindow?.refreshData(errorReportList, warningReportList, reportLevel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var mActivity: Activity = activity
|
||||
private var mWindowParams: WindowManager.LayoutParams? = null
|
||||
@@ -28,7 +51,7 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
private lateinit var ivIpcClose: ImageView
|
||||
private lateinit var tvIpcErrorTab: TextView
|
||||
private lateinit var tvIpcWarningTab: TextView
|
||||
private var ipcReportAdapter: IPCReportAdapter?=null
|
||||
private var ipcReportAdapter: IPCReportAdapter? = null
|
||||
|
||||
private lateinit var mFloatLayout: View
|
||||
private var mInViewX = 0f
|
||||
@@ -38,8 +61,6 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
private var mInScreenX = 0f
|
||||
private var mInScreenY = 0f
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
private var ipcErrorReportList: List<ReportEntity>? = null //错误上报列表
|
||||
private var ipcWarningReportList: List<ReportEntity>? = null//警告上报列表
|
||||
|
||||
@@ -47,10 +68,11 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
initFloatWindow();
|
||||
}
|
||||
|
||||
private fun initFloatWindow(){
|
||||
mFloatLayout = LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
|
||||
private fun initFloatWindow() {
|
||||
mFloatLayout =
|
||||
LayoutInflater.from(mActivity).inflate(R.layout.view_ipc_report, null) as View
|
||||
mFloatLayout.setOnTouchListener(this)
|
||||
rvIPCReport= mFloatLayout.findViewById(R.id.rv_ipc_report)
|
||||
rvIPCReport = mFloatLayout.findViewById(R.id.rv_ipc_report)
|
||||
ivIpcClose = mFloatLayout.findViewById(R.id.iv_ipc_close)
|
||||
tvIpcErrorTab = mFloatLayout.findViewById(R.id.tv_ipc_error_tab)
|
||||
tvIpcWarningTab = mFloatLayout.findViewById(R.id.tv_ipc_warning_tab)
|
||||
@@ -65,35 +87,43 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
it.alpha = 1.0f
|
||||
}
|
||||
ipcReportAdapter = IPCReportAdapter()
|
||||
rvIPCReport.layoutManager = WrapContentLinearLayoutManager(mActivity,
|
||||
LinearLayoutManager.VERTICAL,false)
|
||||
rvIPCReport.layoutManager = WrapContentLinearLayoutManager(
|
||||
mActivity,
|
||||
LinearLayoutManager.VERTICAL, false
|
||||
)
|
||||
rvIPCReport.adapter = ipcReportAdapter
|
||||
//关闭按钮
|
||||
ivIpcClose.setOnClickListener {
|
||||
clickListener?.closeWindow()
|
||||
hideFloatWindow()
|
||||
}
|
||||
//错误列表
|
||||
tvIpcErrorTab.setOnClickListener {
|
||||
tvIpcErrorTab.background = getDrawable(mActivity,R.drawable.ipc_error_tab_normal_bg)
|
||||
tvIpcWarningTab.background = getDrawable(mActivity,R.drawable.ipc_warning_tab_normal_bg)
|
||||
tvIpcErrorTab.background = getDrawable(mActivity, R.drawable.ipc_error_tab_normal_bg)
|
||||
tvIpcWarningTab.background =
|
||||
getDrawable(mActivity, R.drawable.ipc_warning_tab_normal_bg)
|
||||
ipcReportAdapter?.setData(ipcErrorReportList)
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
//预警列表
|
||||
tvIpcWarningTab.setOnClickListener {
|
||||
tvIpcErrorTab.background = getDrawable(mActivity,R.drawable.ipc_error_tab_select_bg)
|
||||
tvIpcWarningTab.background = getDrawable(mActivity,R.drawable.ipc_warning_tab_select_bg)
|
||||
tvIpcErrorTab.background = getDrawable(mActivity, R.drawable.ipc_error_tab_select_bg)
|
||||
tvIpcWarningTab.background =
|
||||
getDrawable(mActivity, R.drawable.ipc_warning_tab_select_bg)
|
||||
ipcReportAdapter?.setData(ipcWarningReportList)
|
||||
ipcReportAdapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun refreshData(errorReportList:List<ReportEntity>,warningReportList:List<ReportEntity>,reportLevel: Int){
|
||||
if(reportLevel == 1){
|
||||
fun refreshData(
|
||||
errorReportList: List<ReportEntity>,
|
||||
warningReportList: List<ReportEntity>,
|
||||
reportLevel: Int
|
||||
) {
|
||||
if (reportLevel == 1) {
|
||||
ipcReportAdapter?.setData(errorReportList)
|
||||
ipcErrorReportList = errorReportList
|
||||
}else{
|
||||
} else {
|
||||
ipcReportAdapter?.setData(warningReportList)
|
||||
ipcWarningReportList = warningReportList
|
||||
}
|
||||
@@ -135,22 +165,16 @@ class IPCReportWindow constructor(activity: Activity) : View.OnTouchListener{
|
||||
mWindowManager!!.defaultDisplay.getMetrics(metrics)
|
||||
mWindowParams!!.x = metrics.widthPixels
|
||||
// mWindowParams!!.y = metrics.heightPixels / 2 - BarUtils.getStatusBarHeight()
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight()-100
|
||||
mWindowParams!!.y = metrics.heightPixels - BarUtils.getStatusBarHeight() - 100
|
||||
mWindowManager!!.addView(mFloatLayout, mWindowParams)
|
||||
}
|
||||
}
|
||||
|
||||
fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null) mWindowManager!!.removeView(mFloatLayout)
|
||||
private fun hideFloatWindow() {
|
||||
if (mFloatLayout.parent != null) {
|
||||
mWindowManager!!.removeView(mFloatLayout)
|
||||
}
|
||||
ipcReportWindow = null
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
interface ClickListener {
|
||||
fun closeWindow()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -29,7 +29,7 @@ import java.util.*
|
||||
/**
|
||||
* SOP设置窗口
|
||||
*/
|
||||
class SOPSettingView @JvmOverloads constructor(
|
||||
internal class SOPSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
@@ -78,6 +78,7 @@ class SOPSettingView @JvmOverloads constructor(
|
||||
/**
|
||||
* obu弱势交通控制
|
||||
*/
|
||||
tbObuWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowObuWeaknessTrafficView
|
||||
tbObuWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (!isChecked) { //默认开启
|
||||
CallerHmiManager.setObuWeaknessTraffic(true)
|
||||
@@ -89,6 +90,7 @@ class SOPSettingView @JvmOverloads constructor(
|
||||
/**
|
||||
* 云端弱势交通控制
|
||||
*/
|
||||
tbCloudWeaknessTrafficSop.isChecked = HmiBuildConfig.isShowCloudWeaknessTrafficView
|
||||
tbCloudWeaknessTrafficSop.setOnCheckedChangeListener { _, isChecked ->
|
||||
if (isChecked) { //默认关闭
|
||||
CallerHmiManager.setCloudWeaknessTraffic(true)
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
|
||||
class SopView private constructor(){
|
||||
|
||||
companion object{
|
||||
val sopView by lazy(LazyThreadSafetyMode.SYNCHRONIZED){
|
||||
SopView()
|
||||
}
|
||||
}
|
||||
|
||||
//SOPSettingView
|
||||
private var mSOPSettingViewFloat: WarningFloat.Builder? = null
|
||||
private var mSOPSettingView: SOPSettingView? = null
|
||||
|
||||
fun toggle(context: Context?, gravity: Int = Gravity.RIGHT, sidePattern: SidePattern = SidePattern.RIGHT) {
|
||||
context?.let {
|
||||
if (mSOPSettingViewFloat != null) {
|
||||
WarningFloat.dismiss(mSOPSettingViewFloat!!.config.floatTag, false)
|
||||
mSOPSettingViewFloat = null
|
||||
mSOPSettingView = null
|
||||
} else {
|
||||
if (mSOPSettingView == null) {
|
||||
mSOPSettingView = SOPSettingView(it)
|
||||
}
|
||||
// var side = SidePattern.RIGHT
|
||||
// var gravity = Gravity.RIGHT
|
||||
// //调试窗默认靠右显示,Bus的乘客端右端有视图覆盖,调试窗靠左显示
|
||||
// if (AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode) &&
|
||||
// AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
// ) {
|
||||
// side = SidePattern.LEFT
|
||||
// gravity = Gravity.LEFT
|
||||
// }
|
||||
mSOPSettingViewFloat = WarningFloat.with(it)
|
||||
.setTag("mSOPSettingView")
|
||||
.setLayout(mSOPSettingView!!)
|
||||
.setSidePattern(sidePattern)
|
||||
.setGravity(gravity, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
|
||||
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.data.report.ReportEntity
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import me.jessyan.autosize.utils.AutoSizeUtils
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
class ToggleDebugView private constructor() : IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
val toggleDebugView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
ToggleDebugView()
|
||||
}
|
||||
}
|
||||
|
||||
// DebugSettingView
|
||||
private var mDebugSettingViewFloat: WarningFloat.Builder? = null
|
||||
private var mDebugSettingView: DebugSettingView? = null
|
||||
|
||||
//工控机节点上报列表
|
||||
private val reportList = arrayListOf<ReportEntity>()
|
||||
|
||||
//工控机上报列表悬浮窗
|
||||
private var reportListFloatWindow: ReportListFloatWindow? = null
|
||||
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
guardianInfo?.let {
|
||||
if (reportList.size > 49) {
|
||||
reportList.removeLast()
|
||||
}
|
||||
reportList.add(
|
||||
0,
|
||||
ReportEntity(
|
||||
TimeUtils.millis2String(System.currentTimeMillis()),
|
||||
it.src, it.level, it.msg, it.code, it.resultList, it.actionsList
|
||||
)
|
||||
)
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开关DebugView
|
||||
*/
|
||||
fun toggle(context: Context, gravity: Int = Gravity.RIGHT, sidePattern: SidePattern = SidePattern.RIGHT) {
|
||||
if (mDebugSettingViewFloat != null) {
|
||||
dismiss()
|
||||
} else {
|
||||
if (mDebugSettingView == null) {
|
||||
mDebugSettingView = DebugSettingView(context)
|
||||
mDebugSettingView?.reportInit(reportList)
|
||||
mDebugSettingView?.setClickListener(object : DebugSettingView.ClickListener {
|
||||
override fun showReportListWindow(show: Boolean) {
|
||||
if (show) {
|
||||
//打开工控机上报列表
|
||||
reportListFloatWindow =
|
||||
ReportListFloatWindow(context.applicationContext as Activity)
|
||||
reportListFloatWindow?.showFloatWindow()
|
||||
reportListFloatWindow?.refreshData(reportList)
|
||||
} else {
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
mDebugSettingViewFloat = WarningFloat.with(context)
|
||||
.setTag("DebugSettingView")
|
||||
.setLayout(mDebugSettingView!!)
|
||||
.setSidePattern(sidePattern)
|
||||
.setGravity(gravity, offsetY = 70)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(AutoSizeUtils.dp2px(context, 1100f))
|
||||
.setWindowWidth(AutoSizeUtils.dp2px(context, 800f))
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun dismiss() {
|
||||
mDebugSettingViewFloat?.let {
|
||||
WarningFloat.dismiss(it.config.floatTag, false)
|
||||
mDebugSettingViewFloat = null
|
||||
mDebugSettingView = null
|
||||
//关闭工控机上报列表
|
||||
reportListFloatWindow?.hideFloatWindow()
|
||||
reportListFloatWindow = null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.setting
|
||||
|
||||
import android.animation.Animator
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.WindowManager
|
||||
import android.view.animation.OvershootInterpolator
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.data.bindingcar.IPCUpgradeStateInfo
|
||||
import com.mogo.eagle.core.data.enums.SidePattern
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.notification.WarningFloat
|
||||
import com.mogo.eagle.core.function.hmi.notification.anim.DefaultAnimator
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.SopView.Companion.sopView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView.Companion.toggleDebugView
|
||||
import com.mogo.eagle.core.function.hmi.ui.tools.AutoPilotAndCheckView
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
|
||||
class ToolsView private constructor() {
|
||||
|
||||
companion object {
|
||||
val toolsView by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
ToolsView()
|
||||
}
|
||||
}
|
||||
|
||||
private var toolsView: AutoPilotAndCheckView? = null
|
||||
|
||||
// 检测、自动驾驶速度设置
|
||||
private var toolsViewFloat: WarningFloat.Builder? = null
|
||||
|
||||
fun showToolsFloat(context: Context?) {
|
||||
context?.let {
|
||||
if (toolsViewFloat == null) {
|
||||
if (toolsView == null) {
|
||||
toolsView = AutoPilotAndCheckView(it)
|
||||
toolsView!!.setClickListener(object : AutoPilotAndCheckView.ClickListener {
|
||||
override fun onClose(v: View) {
|
||||
dismissToolsFloatView()
|
||||
}
|
||||
|
||||
override fun showDebugPanelView() {
|
||||
toggleDebugView.toggle(it)
|
||||
}
|
||||
|
||||
override fun showFeedbackView() {
|
||||
dismissToolsFloatView()
|
||||
CallerDevaToolsManager.showFeedbackView(it)
|
||||
}
|
||||
|
||||
override fun showSOPSettingView() {
|
||||
sopView.toggle(it)
|
||||
}
|
||||
})
|
||||
}
|
||||
toolsViewFloat = WarningFloat.with(it)
|
||||
.setTag("ToolsViewFloat")
|
||||
.setLayout(toolsView!!)
|
||||
.setSidePattern(SidePattern.LEFT)
|
||||
.setGravity(Gravity.LEFT)
|
||||
.setImmersionStatusBar(true)
|
||||
.setWindowHeight(WindowManager.LayoutParams.MATCH_PARENT)
|
||||
.setAnimator(object : DefaultAnimator() {
|
||||
override fun enterAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.enterAnim(view, params, windowManager, sidePattern)
|
||||
?.apply {
|
||||
interpolator = OvershootInterpolator()
|
||||
}
|
||||
|
||||
override fun exitAnim(
|
||||
view: View,
|
||||
params: WindowManager.LayoutParams,
|
||||
windowManager: WindowManager,
|
||||
sidePattern: SidePattern
|
||||
): Animator? =
|
||||
super.exitAnim(view, params, windowManager, sidePattern)
|
||||
?.setDuration(200)
|
||||
})
|
||||
.addWarningStatusListener(object : IMoGoWarningStatusListener {
|
||||
override fun onDismiss() {
|
||||
toolsViewFloat = null
|
||||
toolsView = null
|
||||
}
|
||||
})
|
||||
.show()
|
||||
} else {
|
||||
toolsViewFloat?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun showAdUpgradeStatus(ipcUpgradeStateInfo: IPCUpgradeStateInfo){
|
||||
toolsView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
ipcUpgradeStateInfo.status.let {
|
||||
if (AdUpgradeStateHelper.isUpgradeSuccess(it)) {
|
||||
ToastUtils.showLong("升级成功")
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun dismissToolsFloatView() {
|
||||
toolsViewFloat?.let {
|
||||
WarningFloat.dismiss(it.config.floatTag, false)
|
||||
toolsViewFloat = null
|
||||
toolsView = null
|
||||
}
|
||||
}
|
||||
|
||||
fun dismiss() {
|
||||
dismissToolsFloatView()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.switch
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
|
||||
class DemoModeHiddenSwitch(context: Context?, attrs: AttributeSet?) : View(context, attrs) {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
setOnClickListener {
|
||||
//只在司机端设置美化模式开关功能
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
//单次查询,是否有行程信息(订单进行中时点击不生效),autopilotControlParameters为null代表不处于自动驾驶状态下
|
||||
if (CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo().autopilotControlParameters == null) {
|
||||
FunctionBuildConfig.isDemoMode = !FunctionBuildConfig.isDemoMode
|
||||
context?.let {
|
||||
CallerHmiManager.updateStatusBarLeftView(
|
||||
FunctionBuildConfig.isDemoMode,
|
||||
"demoMode",
|
||||
DemoModeView(it)
|
||||
)
|
||||
}
|
||||
CallerAutoPilotManager.setDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
if (!FunctionBuildConfig.isDemoMode) {
|
||||
//关闭美化模式时,通知工控机
|
||||
CallerAutoPilotManager.setIPCDemoMode(FunctionBuildConfig.isDemoMode)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,16 +3,85 @@ package com.mogo.eagle.core.function.hmi.ui.takeover
|
||||
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.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.enums.EventTypeEnum
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.zhidao.support.adas.high.common.MogoReport
|
||||
import mogo_msg.MogoReportMsg
|
||||
|
||||
class TakeOverView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoAutopilotStatusListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "TakeOverView"
|
||||
}
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_take_over, this, true)
|
||||
}
|
||||
|
||||
private var takeOver = false
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
/**
|
||||
* 工控机监控节点上报
|
||||
*/
|
||||
override fun onAutopilotGuardian(guardianInfo: MogoReportMsg.MogoReportMessage?) {
|
||||
super.onAutopilotGuardian(guardianInfo)
|
||||
ThreadUtils.runOnUiThread {
|
||||
guardianInfo?.let {
|
||||
if (FunctionBuildConfig.isDemoMode) {
|
||||
return@let
|
||||
}
|
||||
if (takeOver) {
|
||||
return@let
|
||||
}
|
||||
when (it.code) {
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_PLANNING,
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_LOCATION,
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_CHASSIS,
|
||||
MogoReport.Code.Error.EMAP.EXIT_AUTOPILOT_FOR_DISTANCE -> {
|
||||
CallerHmiManager.warningV2X(
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.content,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.tts,
|
||||
EventTypeEnum.TAKE_OVER_EVENT.poiType,
|
||||
object : IMoGoWarningStatusListener {
|
||||
override fun onShow() {
|
||||
takeOver = true
|
||||
visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onDismiss() {
|
||||
takeOver = false
|
||||
visibility = View.GONE
|
||||
}
|
||||
},
|
||||
true,
|
||||
6000L
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
@@ -3,55 +3,79 @@ package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
import android.content.Context
|
||||
import android.widget.TextView
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.dialog.BaseFloatDialog
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
* @description 工控机确认升级对话框
|
||||
* @since: 2022/1/13
|
||||
*/
|
||||
class AdUpgradeDialog(context: Context,images: List<String>,padSn: String,releaseId: String)
|
||||
: BaseFloatDialog(context), LifecycleObserver {
|
||||
class AdUpgradeDialog(context: Context, images: List<String>, padSn: String, releaseId: String) :
|
||||
BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private var upgradeConfirm : TextView? = null
|
||||
private var upgradeCancel : TextView? = null
|
||||
companion object {
|
||||
private var adUpgradeDialog: AdUpgradeDialog? = null
|
||||
|
||||
fun show(context: Context?, images: List<String>, padSn: String, releaseId: String) {
|
||||
context?.let {
|
||||
if (adUpgradeDialog == null) {
|
||||
adUpgradeDialog = AdUpgradeDialog(it, images, padSn, releaseId)
|
||||
}
|
||||
adUpgradeDialog?.let { dialog ->
|
||||
if (dialog.isShowing) {
|
||||
return
|
||||
}
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var upgradeConfirm: TextView? = null
|
||||
private var upgradeCancel: TextView? = null
|
||||
|
||||
private var clickListener: ClickListener? = null
|
||||
|
||||
private var images: List<String>?=null
|
||||
private var padSn: String?=null
|
||||
private var releaseId: String?=null
|
||||
private var images: List<String>? = null
|
||||
private var padSn: String? = null
|
||||
private var releaseId: String? = null
|
||||
|
||||
init {
|
||||
setContentView(R.layout.dialog_ad_upgrade)
|
||||
setCanceledOnTouchOutside(false)
|
||||
upgradeConfirm=findViewById(R.id.tv_upgrade_confirm)
|
||||
upgradeCancel=findViewById(R.id.tv_upgrade_cancel)
|
||||
upgradeConfirm = findViewById(R.id.tv_upgrade_confirm)
|
||||
upgradeCancel = findViewById(R.id.tv_upgrade_cancel)
|
||||
|
||||
upgradeConfirm?.setOnClickListener{
|
||||
clickListener?.confirm()
|
||||
}
|
||||
upgradeCancel?.setOnClickListener {
|
||||
clickListener?.cancel()
|
||||
}
|
||||
this.images = images
|
||||
this.padSn = padSn
|
||||
this.releaseId = releaseId
|
||||
|
||||
upgradeConfirm?.setOnClickListener {
|
||||
//确认升级
|
||||
CallerDevaToolsManager.upgradeConfirm(images, padSn, releaseId)
|
||||
AdUpgradeStateHelper.setConfirmUpgrade(true)
|
||||
ToastUtils.showLong("最新版本下载中...")
|
||||
dismiss()
|
||||
}
|
||||
upgradeCancel?.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
adUpgradeDialog = null
|
||||
}
|
||||
|
||||
fun setClickListener(clickListener: ClickListener) {
|
||||
this.clickListener = clickListener
|
||||
}
|
||||
|
||||
fun showUpgradeDialog(){
|
||||
if(isShowing){
|
||||
return
|
||||
}
|
||||
show()
|
||||
}
|
||||
|
||||
interface ClickListener{
|
||||
interface ClickListener {
|
||||
fun confirm()
|
||||
fun cancel()
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ import kotlin.system.exitProcess
|
||||
* @author ChenFufeng
|
||||
* 设置自动驾驶速度和检测页入口
|
||||
*/
|
||||
class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
internal class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
@@ -165,7 +165,7 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
MsgBoxConfig.setUserRecord(0)
|
||||
}
|
||||
actvLoginout.visibility = View.VISIBLE
|
||||
CallerHmiManager.setBusOperationView(toolBusOperationView)
|
||||
toolBusOperationView.showBusOperation()
|
||||
|
||||
// TODO 这里判断方式可以替换为使用 AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)等进行替换
|
||||
when (DebugConfig.getProductFlavor()) {
|
||||
@@ -199,7 +199,6 @@ class AutoPilotAndCheckView @JvmOverloads constructor(
|
||||
systemVersionView?.showAdUpgradeStatus(ipcUpgradeStateInfo)
|
||||
}
|
||||
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
|
||||
@@ -4,9 +4,9 @@ import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.temp.EventLogout
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IOchBusView
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
@@ -23,7 +23,7 @@ class BusOperationView @JvmOverloads constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0)
|
||||
: IOchBusView(context, attrs, defStyleAttr) {
|
||||
: LinearLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_och_bus_operation,this,true)
|
||||
@@ -47,15 +47,11 @@ class BusOperationView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun showBusOperation() {
|
||||
fun showBusOperation() {
|
||||
ochBusOperationStatus.visibility = View.VISIBLE
|
||||
initPersonalIcon()
|
||||
}
|
||||
|
||||
override fun changerOperationStatus(isOut: Boolean) {
|
||||
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
context?.let {
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
|
||||
/**
|
||||
* @author lixiaopeng
|
||||
* 蒙层view
|
||||
*/
|
||||
class MaskView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(
|
||||
context,
|
||||
attrs,
|
||||
defStyleAttr
|
||||
) {
|
||||
|
||||
private val TAG = "MaskView"
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_mask, this, true)
|
||||
initView()
|
||||
}
|
||||
|
||||
companion object {
|
||||
private var speedLimit: Double = 0.0
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
private fun initView() {
|
||||
// background = ColorDrawable(Color.parseColor("#F0151D41"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.tools
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.ToolsView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||
|
||||
class ToolsImageView(context: Context, attrs: AttributeSet?) :
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
setBackgroundResource(R.drawable.module_ext_check)
|
||||
setImageResource(R.drawable.icon_tools_nor)
|
||||
scaleType = ScaleType.CENTER
|
||||
setOnClickListener{
|
||||
toolsView.showToolsFloat(context)
|
||||
}
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(ToolsView_TAG, this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(ToolsView_TAG)
|
||||
}
|
||||
}
|
||||
@@ -8,11 +8,14 @@ import androidx.constraintlayout.widget.ConstraintLayout
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotControlParameters
|
||||
import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.AutoPilotStatusView_TAG
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lat
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getCurWgs84Lon
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
|
||||
@@ -25,18 +28,21 @@ import kotlinx.android.synthetic.main.view_autopilot_status.view.*
|
||||
* @date 2021/9/22 3:59 下午
|
||||
* 自动驾驶状态按钮
|
||||
*/
|
||||
class AutoPilotStatusView @JvmOverloads constructor(
|
||||
class AutoPilotStatusView constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet
|
||||
) : ConstraintLayout(context, attrs),
|
||||
View.OnClickListener,
|
||||
IMoGoAutopilotStatusListener {
|
||||
IMoGoAutopilotStatusListener, IViewControlListener {
|
||||
|
||||
private val TAG = "AutopilotStatusView"
|
||||
companion object {
|
||||
const val TAG = "AutopilotStatusView"
|
||||
}
|
||||
|
||||
private var mAutopilotStatus: Int = 0
|
||||
|
||||
init {
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
initView(context)
|
||||
}
|
||||
|
||||
@@ -51,18 +57,22 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
setOnClickListener(this)
|
||||
// 自动驾驶状态监听
|
||||
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
|
||||
CallerHmiViewControlListenerManager.addListener(AutoPilotStatusView_TAG, this)
|
||||
|
||||
CallerLogger.d("$M_HMI$TAG", "autopilotStatus: $mAutopilotStatus")
|
||||
setAutoPilotStatus(mAutopilotStatus)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (mAutopilotStatus) {
|
||||
0 -> {// 不可自动驾驶,adas与工控机没有链接,或工控机异常
|
||||
CallerLogger.e("$M_HMI$TAG", "不可自动驾驶,adas与工控机没有链接,或工控机异常,请检查")
|
||||
ToastUtils.showShort("不可自动驾驶,adas与工控机没有链接,或工控机异常,请检查")
|
||||
// TODO 这里临时触发自动驾驶能力,测试功过这里删除
|
||||
//CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(true)
|
||||
}
|
||||
1 -> {// 可自动驾驶,目前处于人工干预状态
|
||||
CallerHmiListenerManager.invokeCheckAutoPilotBtnListener(true)
|
||||
@@ -85,7 +95,7 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
currentAutopilot.endName = "HYJC"
|
||||
currentAutopilot.isSpeakVoice = false
|
||||
currentAutopilot.startLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(),getCurWgs84Lon())
|
||||
AutopilotControlParameters.AutoPilotLonLat(getCurWgs84Lat(), getCurWgs84Lon())
|
||||
currentAutopilot.endLatLon =
|
||||
AutopilotControlParameters.AutoPilotLonLat(26.819716071924688, 112.57715442110867)
|
||||
currentAutopilot.vehicleType = 10
|
||||
@@ -126,4 +136,10 @@ class AutoPilotStatusView @JvmOverloads constructor(
|
||||
setAutoPilotStatus(autoPilotStatusInfo.state)
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerAutoPilotStatusListenerManager.removeListener(TAG)
|
||||
CallerHmiViewControlListenerManager.removeListener(AutoPilotStatusView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.CameraView_TAG
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||
|
||||
class CameraView(context: Context, attrs: AttributeSet?) :
|
||||
androidx.appcompat.widget.AppCompatImageView(context, attrs), IViewControlListener {
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
setOnClickListener {
|
||||
cameraLiveView.showCameraList(
|
||||
context,
|
||||
CallerFuncBizManager.bizProvider.getCameraList
|
||||
) { liveStatus ->
|
||||
if (liveStatus) {
|
||||
setBackgroundResource(R.drawable.icon_camera_selected)
|
||||
} else {
|
||||
setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(CameraView_TAG, this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(CameraView_TAG)
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,8 @@ class LimitingVelocityView @JvmOverloads constructor(
|
||||
LayoutInflater.from(context).inflate(R.layout.view_limiting_speed_vr, this, true)
|
||||
}
|
||||
|
||||
override fun updateLimitingSpeed(limitingSpeed: Int) {
|
||||
super.updateLimitingSpeed(limitingSpeed)
|
||||
override fun updateLimitingSpeed(limitingSpeed: Int, limitSource: Int) {
|
||||
super.updateLimitingSpeed(limitingSpeed, limitSource)
|
||||
tvLimitingVelocity.text = "$limitingSpeed"
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,9 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.PerspectiveSwitchView_TAG
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager.getMapUIController
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
@@ -19,12 +22,20 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener {
|
||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener, IViewControlListener{
|
||||
|
||||
init {
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
|
||||
setBackgroundResource(R.drawable.module_switch_map_bg)
|
||||
setOnClickListener(this)
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(PerspectiveSwitchView_TAG,this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
@@ -41,4 +52,10 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(PerspectiveSwitchView_TAG)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,10 @@ import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.config.HmiBuildConfig
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener.Companion.TrafficLightView_TAG
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewTrafficLight
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -20,7 +23,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
context: Context?,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : IViewTrafficLight(context, attrs, defStyleAttr) {
|
||||
) : IViewTrafficLight(context, attrs, defStyleAttr), IViewControlListener {
|
||||
private var mLightIconIV: ImageView? = null
|
||||
private var mLightIconBG: ImageView? = null
|
||||
private var mLightTimeTV: GradientTextView? = null
|
||||
@@ -28,17 +31,26 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
private var mLightSourceDivider: View? = null
|
||||
private var mCurrentLightId = 0
|
||||
|
||||
init {
|
||||
init(context)
|
||||
}
|
||||
|
||||
private fun init(context: Context?) {
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_view_traffic_light, this, true)
|
||||
mLightIconIV = findViewById(R.id.hmi_traffic_light_iv)
|
||||
mLightIconBG = findViewById(R.id.hmi_traffic_light_bg)
|
||||
mLightTimeTV = findViewById(R.id.hmi_traffic_light_time_tv)
|
||||
mLightSourceTV = findViewById(R.id.hmi_traffic_light_source)
|
||||
mLightSourceDivider = findViewById(R.id.hmi_traffic_light_divider)
|
||||
|
||||
CallerHmiViewControlListenerManager.addListener(TrafficLightView_TAG, this)
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(TrafficLightView_TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,11 +59,11 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
* @param checkLightId 0-都是默认,1-红,2-黄,3-绿
|
||||
* @param lightSource 1:云端下发;2:自车感知
|
||||
*/
|
||||
override fun showWarningTrafficLight(checkLightId: Int,lightSource: Int) {
|
||||
super.showWarningTrafficLight(checkLightId,lightSource)
|
||||
override fun showWarningTrafficLight(checkLightId: Int, lightSource: Int) {
|
||||
super.showWarningTrafficLight(checkLightId, lightSource)
|
||||
mCurrentLightId = checkLightId
|
||||
if(!HmiBuildConfig.isShowTrafficLightView){
|
||||
updateTrafficLightIcon(checkLightId,lightSource)
|
||||
if (!HmiBuildConfig.isShowTrafficLightView) {
|
||||
updateTrafficLightIcon(checkLightId, lightSource)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,24 +82,28 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
super.disableCountdown()
|
||||
UiThreadHandler.post {
|
||||
// 小巴车的司机端需要展示红绿灯信号来源
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
val lp = this.layoutParams as MarginLayoutParams
|
||||
lp.width = context.resources.getDimension(R.dimen.dp_325).toInt()
|
||||
this.layoutParams = lp
|
||||
mLightSourceTV!!.visibility = VISIBLE
|
||||
mLightSourceDivider!!.visibility = VISIBLE
|
||||
mLightTimeTV!!.visibility = GONE
|
||||
mLightSourceTV!!.setPadding(0,0,75,0)
|
||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_310).toInt()
|
||||
}else{
|
||||
mLightSourceTV!!.setPadding(0, 0, 75, 0)
|
||||
mLightIconBG!!.layoutParams.width =
|
||||
context.resources.getDimension(R.dimen.dp_310).toInt()
|
||||
} else {
|
||||
val lp = this.layoutParams as MarginLayoutParams
|
||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_icon_size).toInt()
|
||||
lp.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_icon_size).toInt()
|
||||
this.layoutParams = lp
|
||||
mLightTimeTV!!.visibility = GONE
|
||||
mLightSourceDivider!!.visibility = View.GONE
|
||||
mLightSourceTV!!.visibility = View.GONE
|
||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.dp_124).toInt()
|
||||
mLightIconBG!!.layoutParams.width =
|
||||
context.resources.getDimension(R.dimen.dp_124).toInt()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -176,7 +192,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
* @param lightId 0-都是默认,1-红,2-黄,3-绿
|
||||
* @param lightSource 1:云端下发;2:自车感知
|
||||
*/
|
||||
private fun updateTrafficLightIcon(lightId: Int,lightSource: Int) {
|
||||
private fun updateTrafficLightIcon(lightId: Int, lightSource: Int) {
|
||||
UiThreadHandler.post {
|
||||
when (lightId) {
|
||||
1 -> {
|
||||
@@ -193,7 +209,7 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
}
|
||||
else -> this@SingleTrafficLightView.visibility = GONE
|
||||
}
|
||||
when(lightSource){
|
||||
when (lightSource) {
|
||||
1 -> {
|
||||
mLightSourceTV!!.text = "云端下发"
|
||||
}
|
||||
@@ -207,26 +223,31 @@ class SingleTrafficLightView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun resetView(){
|
||||
private fun resetView() {
|
||||
// 小巴车的司机端需要展示红绿灯信号来源
|
||||
if(AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)){
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
) {
|
||||
val lp = this.layoutParams as MarginLayoutParams
|
||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_layout_width).toInt()
|
||||
lp.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_bus_layout_width).toInt()
|
||||
this.layoutParams = lp
|
||||
mLightTimeTV!!.visibility = View.VISIBLE
|
||||
mLightSourceDivider!!.visibility = View.VISIBLE
|
||||
mLightSourceTV!!.visibility = View.VISIBLE
|
||||
mLightSourceTV!!.setPadding(0,0,0,0)
|
||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bus_bg_width).toInt()
|
||||
}else{
|
||||
mLightSourceTV!!.setPadding(0, 0, 0, 0)
|
||||
mLightIconBG!!.layoutParams.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_bus_bg_width).toInt()
|
||||
} else {
|
||||
val lp = this.layoutParams as MarginLayoutParams
|
||||
lp.width = context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt()
|
||||
lp.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_layout_width).toInt()
|
||||
this.layoutParams = lp
|
||||
mLightTimeTV!!.visibility = View.VISIBLE
|
||||
mLightSourceDivider!!.visibility = View.GONE
|
||||
mLightSourceTV!!.visibility = View.GONE
|
||||
mLightIconBG!!.layoutParams.width = context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt()
|
||||
mLightIconBG!!.layoutParams.width =
|
||||
context.resources.getDimension(R.dimen.hmi_traffic_light_bg_width).toInt()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ public class SpeedChartView extends View {
|
||||
setAnimation(lastAngle, currentAngle, 1000);
|
||||
lastAngle = currentAngle;
|
||||
//重新绘制
|
||||
postInvalidate();
|
||||
invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,11 @@ import android.util.AttributeSet
|
||||
import android.view.Gravity
|
||||
import android.widget.FrameLayout
|
||||
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.api.hmi.view.IViewControlListener.Companion.SpeedPanelView_TAG
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ20ListenerManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
@@ -22,7 +25,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener {
|
||||
) : FrameLayout(context, attrs, defStyleAttr), IMoGoChassisLocationGCJ02Listener,IViewControlListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "SpeedPanelView"
|
||||
@@ -38,7 +41,6 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
init {
|
||||
initEvent()
|
||||
setBackgroundResource(R.drawable.yi_biao_pan_bg_nor)
|
||||
mContext = context
|
||||
mSpeedChartView = SpeedChartView(context)
|
||||
@@ -52,17 +54,13 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
addView(mSpeedChartView)
|
||||
}
|
||||
|
||||
private fun initEvent() {
|
||||
setOnLongClickListener {
|
||||
CallerHmiManager.toggleDebugView()
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private var timerTask: TimerTask? = null
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow() // 注册位置回调
|
||||
super.onAttachedToWindow()
|
||||
// 注册view控制显示隐藏监听
|
||||
CallerHmiViewControlListenerManager.addListener(SpeedPanelView_TAG,this)
|
||||
// 注册位置回调
|
||||
CallerChassisLocationGCJ20ListenerManager.addListener(TAG, this)
|
||||
// 开启定时查询速度
|
||||
timerTask?.cancel()
|
||||
@@ -82,7 +80,7 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
this.timerTask = task
|
||||
timer.schedule(task, Date(), 100)
|
||||
timer.schedule(task, Date(), 200)
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MessagePad.GnssInfo?) {
|
||||
@@ -91,9 +89,15 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
override fun visible(v: Int) {
|
||||
super.visible(v)
|
||||
visibility = v
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
// 解除注册
|
||||
CallerHmiViewControlListenerManager.removeListener(SpeedPanelView_TAG)
|
||||
CallerChassisLocationGCJ20ListenerManager.removeListener(TAG)
|
||||
try {
|
||||
timerTask?.cancel()
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.widget.*
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import android.widget.LinearLayout
|
||||
import com.mogo.eagle.core.data.mofang.MfConstants
|
||||
import com.mogo.eagle.core.function.api.hmi.view.IViewControlListener
|
||||
import com.mogo.eagle.core.function.api.setting.IMoGoSkinModeChangeListener
|
||||
import com.mogo.eagle.core.function.call.devatools.*
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.call.setting.CallerSkinModeListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils
|
||||
import com.mogo.eagle.core.utilcode.util.ScreenUtils
|
||||
import kotlinx.android.synthetic.main.view_status_bar.view.*
|
||||
import java.util.concurrent.CopyOnWriteArrayList
|
||||
|
||||
@@ -20,7 +21,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener {
|
||||
) : LinearLayout(context, attrs, defStyleAttr), IMoGoSkinModeChangeListener, IViewControlListener {
|
||||
|
||||
companion object {
|
||||
const val TAG = "StatusBarView"
|
||||
@@ -37,17 +38,19 @@ class StatusBarView @JvmOverloads constructor(
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
viewStatusBarRight.addView(BatteryGroupView(this.context))
|
||||
|
||||
//将状态窗口中的状态移到状态栏上
|
||||
CallerDevaToolsManager.showStatusBar(context, status_container)
|
||||
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
|
||||
var isBluetoothConnect = SharedPrefsMgr.getInstance(context).getBoolean(MfConstants.BLUETOOTH_STATUS, false)
|
||||
val isBluetoothConnect =
|
||||
SharedPrefsMgr.getInstance(context).getBoolean(MfConstants.BLUETOOTH_STATUS, false)
|
||||
if (isBluetoothConnect) {
|
||||
updateMfStatus("MoFangManager", true)
|
||||
}
|
||||
|
||||
//添加view控制
|
||||
CallerHmiViewControlListenerManager.addListener(TAG,this)
|
||||
// 添加换肤监听
|
||||
CallerSkinModeListenerManager.addListener(TAG, this)
|
||||
//将状态窗口中的状态移到状态栏上
|
||||
CallerDevaToolsManager.showStatusBar(context, status_container)
|
||||
|
||||
}
|
||||
|
||||
override fun onSkinModeChange(skinMode: Int) {
|
||||
@@ -57,15 +60,13 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun setStatusBarDarkOrLight(light: Boolean) {
|
||||
if (light) {
|
||||
setTextColor(resources.getColor(R.color.color_2C2E30))
|
||||
} else {
|
||||
setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
}
|
||||
override fun setStatusBarDarkOrLight(light: Boolean) = if (light) {
|
||||
setTextColor(resources.getColor(R.color.color_2C2E30))
|
||||
} else {
|
||||
setTextColor(resources.getColor(R.color.color_FFFFFF))
|
||||
}
|
||||
|
||||
fun updateRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
override fun updateStatusBarRightView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
if (insert) {
|
||||
rightViewList.add(0, tag)
|
||||
viewStatusBarRight.addView(viewGroup, 0)
|
||||
@@ -79,7 +80,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
override fun updateStatusBarLeftView(insert: Boolean, tag: String, viewGroup: ViewGroup) {
|
||||
if (insert) {
|
||||
leftViewList.add(0, tag)
|
||||
viewStatusBarLeft.addView(viewGroup, 0)
|
||||
@@ -93,7 +94,8 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateProgressView(insert: Boolean, tag: String, progress: Int) {
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun updateStatusBarDownloadView(insert: Boolean, tag: String, progress: Int) {
|
||||
if (insert) {
|
||||
viewProgressTv.visibility = VISIBLE
|
||||
viewProgressTv.text = "$progress%"
|
||||
@@ -102,7 +104,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
fun updateMfStatus(tag: String, status: Boolean) {
|
||||
override fun updateMfStatus(tag: String, status: Boolean) {
|
||||
if (status) {
|
||||
viewMofangStatus.setImageResource(R.drawable.icon_bluetooth_p)
|
||||
} else {
|
||||
@@ -117,6 +119,7 @@ class StatusBarView @JvmOverloads constructor(
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallerHmiViewControlListenerManager.removeListener(TAG)
|
||||
CallerSkinModeListenerManager.removeListener(TAG)
|
||||
CallerDevaToolsManager.hideStatusBar()
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ class V2XNotificationView @JvmOverloads constructor(
|
||||
defStyleAttr: Int = 0
|
||||
) : IViewNotification(context, attrs, defStyleAttr) {
|
||||
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.notification_v2x_msg_vr, this, true)
|
||||
// 设置View的出场位置
|
||||
|
||||
@@ -3,49 +3,71 @@ 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.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
|
||||
import com.mogo.eagle.core.function.call.vip.CallVipSetListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import kotlinx.android.synthetic.main.view_vip_identification.view.*
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
|
||||
/**
|
||||
* VIP标识控件
|
||||
*/
|
||||
class VipIdentificationView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : ConstraintLayout(context, attrs, defStyleAttr) {
|
||||
class VipIdentificationView : ConstraintLayout, IMoGoVipSetListener {
|
||||
|
||||
init {
|
||||
companion object {
|
||||
const val TAG = "VipIdentificationView"
|
||||
}
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet) : this(context, attributeSet, 0) {
|
||||
}
|
||||
|
||||
constructor(context: Context, attributeSet: AttributeSet, defStyleAttr: Int) : super(
|
||||
context,
|
||||
attributeSet,
|
||||
defStyleAttr
|
||||
) {
|
||||
init(attributeSet, defStyleAttr)
|
||||
}
|
||||
|
||||
private var marginStart: Float = 0.0f
|
||||
private var marginTop: Float = 0.0f
|
||||
|
||||
private fun init(attrs: AttributeSet, defStyleAttr: Int) {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_vip_identification, this, true)
|
||||
val a = context.obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.VipIdentificationView,
|
||||
defStyleAttr,
|
||||
0
|
||||
)
|
||||
marginStart = a.getDimension(R.styleable.VipIdentificationView_marginStart, 0.0f)
|
||||
marginTop = a.getDimension(R.styleable.VipIdentificationView_marginTop, 0.0f)
|
||||
a.recycle()
|
||||
}
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
super.onAttachedToWindow()
|
||||
val lp = this.layoutParams as LayoutParams
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_bus_passenger).toInt()
|
||||
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_passenger).toInt()
|
||||
} else if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)
|
||||
&& AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)) {
|
||||
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left_taxi_passenger).toInt()
|
||||
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top_passenger).toInt()
|
||||
} else {
|
||||
lp.marginStart = resources.getDimension(R.dimen.module_vip_margin_left).toInt()
|
||||
lp.topMargin = resources.getDimension(R.dimen.module_vip_margin_top).toInt()
|
||||
}
|
||||
lp.marginStart = marginStart.toInt()
|
||||
lp.topMargin = marginTop.toInt()
|
||||
this.layoutParams = lp
|
||||
invalidate()
|
||||
CallVipSetListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun setVipIdentificationVisible(visible: Boolean) {
|
||||
UiThreadHandler.post {
|
||||
ivVipIdentification.visibility = visibility
|
||||
override fun onVipSet(status: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
visibility = if (status) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDetachedFromWindow() {
|
||||
super.onDetachedFromWindow()
|
||||
CallVipSetListenerManager.removeListener(TAG)
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import com.mogo.eagle.core.data.config.HdMapBuildConfig;
|
||||
import com.mogo.eagle.core.data.constants.MoGoFragmentPaths;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView;
|
||||
@@ -137,7 +138,7 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
|
||||
View statusBarView = decorView.findViewWithTag("status_bar");
|
||||
if (statusBarView == null) {
|
||||
statusBarView = new StatusBarView(this);
|
||||
statusBarView = getStatusBarView();
|
||||
statusBarView.setTag("status_bar");
|
||||
}
|
||||
FrameLayout.LayoutParams statusBarLP =
|
||||
@@ -147,6 +148,14 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
decorView.addView(statusBarView, statusBarLP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改statusBar 重写实现,需要继承 StatusBarView,xml中基础系统控件不要修改其id,拿来即用
|
||||
* @return StatusBarView
|
||||
*/
|
||||
protected StatusBarView getStatusBarView(){
|
||||
return new StatusBarView(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -163,6 +172,9 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
DisplayEffectsHelper.getInstance().init(clSpecialEffect);
|
||||
|
||||
mPresenter.checkPermission(this);
|
||||
|
||||
// 同步AppInfo Config信息
|
||||
CallerDevaToolsManager.INSTANCE.syncConfig();
|
||||
}
|
||||
|
||||
private void calculateStartTime() {
|
||||
|
||||
@@ -122,7 +122,6 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
}).start();
|
||||
}
|
||||
|
||||
// TODO 李小鹏 这里需要将逻辑抽离出去,单独使用更新服务控制
|
||||
private void upgradeProgressListener() {
|
||||
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
|
||||
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
|
||||
@@ -213,13 +212,13 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_V2X_OBU_MOGO, "IMoGoObuProvider"));
|
||||
// BIZ
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_FUNC_BIZ, "IMoGoNoticeProvider"));
|
||||
// 车聊聊,IM
|
||||
// todo 后置 车聊聊,IM
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(ChatConsts.CHAT_PROVIDER_PATH, ChatConsts.CHAT_MODULE_NAME));
|
||||
// V2X 模块
|
||||
MogoModulePaths.addBaseModule(new MogoModule(MogoServicePaths.PATH_V2X_MODULE, "V2XProvider"));
|
||||
// 司机身份专属模块
|
||||
// 司机身份专属
|
||||
if (AppIdentityModeUtils.isDriver(FunctionBuildConfig.appIdentityMode)) {
|
||||
// 地图数据收集模块
|
||||
// todo 后置 地图数据收集模块
|
||||
MogoModulePaths.addModuleFunctionServer(new MogoModule(MogoServicePaths.PATH_MAP_DATA_COLLECT_PROVIDER, "MoGoMapDataCollector"));
|
||||
}
|
||||
CallerLogger.INSTANCE.i(M_HMI + TAG, "App launch timer cost " + (System.currentTimeMillis() - start) + "ms");
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
<!-- <corners android:radius="@dimen/module_mogo_och_autopilot_status_bg_corner" />-->
|
||||
<gradient
|
||||
android:startColor="#323C6F"
|
||||
android:endColor="#323C6F"
|
||||
android:angle="315"
|
||||
/>
|
||||
<size
|
||||
android:width="120dp"
|
||||
android:height="120dp"
|
||||
/>
|
||||
</shape>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:width="112dp"
|
||||
android:height="112dp"
|
||||
android:drawable="@drawable/bg_operation_status_bg" />
|
||||
<item
|
||||
android:width="80dp"
|
||||
android:height="80dp"
|
||||
android:gravity="center">
|
||||
<bitmap android:src="@drawable/toggle_setting_btn_bg" />
|
||||
</item>
|
||||
</layer-list>
|
||||
@@ -6,14 +6,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<View
|
||||
android:id="@+id/viewShowDebugView"
|
||||
android:layout_width="@dimen/dp_400"
|
||||
android:layout_height="@dimen/dp_100"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--V2X预警红色边框-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
|
||||
android:id="@+id/flV2XWarningView"
|
||||
@@ -28,26 +20,15 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingTop="72dp">
|
||||
<!--脉速表-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SpeedPanelView
|
||||
android:id="@+id/viewSpeedChart"
|
||||
android:layout_width="@dimen/module_ext_speed_width"
|
||||
android:layout_height="@dimen/module_ext_speed_height"
|
||||
android:layout_marginLeft="@dimen/module_mogo_autopilot_status_margin_left"
|
||||
android:layout_marginTop="@dimen/module_ext_arcView_top"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--Vip车辆标志-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
|
||||
android:id="@+id/flVipIdentificationView"
|
||||
android:layout_width="@dimen/module_vip_width"
|
||||
android:layout_height="@dimen/module_vip_height"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--接管提示-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.takeover.TakeOverView
|
||||
android:id="@+id/clTakeOverView"
|
||||
android:layout_width="@dimen/hmi_take_over_request_width"
|
||||
@@ -58,40 +39,6 @@
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--自动驾驶按钮及状态-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.AutoPilotStatusView
|
||||
android:id="@+id/viewAutopilotStatus"
|
||||
android:layout_width="@dimen/module_mogo_autopilot_status_bg_width"
|
||||
android:layout_height="@dimen/module_mogo_autopilot_status_bg_height"
|
||||
android:layout_marginTop="@dimen/module_mogo_autopilot_status_margin_top"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/viewSpeedChart"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart"
|
||||
app:layout_goneMarginStart="@dimen/module_mogo_autopilot_status_margin_left" />
|
||||
|
||||
<!--超视距-->
|
||||
<ImageView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:background="@drawable/icon_camera_nor"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--地图视角切换-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.PerspectiveSwitchView
|
||||
android:id="@+id/viewPerspectiveSwitch"
|
||||
@@ -103,65 +50,15 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
|
||||
<View
|
||||
<!--隐藏态下的 美化模式按钮-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.switch.DemoModeHiddenSwitch
|
||||
android:id="@+id/viewDemoModeSwitch"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="100dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginBottom="200dp"
|
||||
/>
|
||||
|
||||
<!--工具箱-->
|
||||
<ImageView
|
||||
android:id="@+id/ivToolsIcon"
|
||||
android:layout_width="@dimen/module_hmi_check_size"
|
||||
android:layout_height="@dimen/module_hmi_check_size"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:background="@drawable/module_ext_check"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/icon_tools_nor"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
|
||||
app:layout_goneMarginStart="50dp" />
|
||||
|
||||
<!--问题反馈-->
|
||||
<ImageView
|
||||
android:id="@+id/ivBadCaseTools"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:src="@drawable/bad_case_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivToolsIcon" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivAiCollectTools"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginStart="50dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:src="@drawable/ai_collect_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/ivBadCaseTools" />
|
||||
|
||||
<View
|
||||
android:id="@+id/viewUpgradeTips"
|
||||
android:layout_width="22dp"
|
||||
android:layout_height="22dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/ivToolsIcon"
|
||||
app:layout_constraintCircleAngle="45"
|
||||
app:layout_constraintCircleRadius="60dp"
|
||||
tools:ignore="MissingConstraints" />
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--限速牌子-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
|
||||
@@ -178,24 +75,43 @@
|
||||
android:textSize="60dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_goneMarginEnd="40dp"
|
||||
app:layout_goneMarginTop="40dp"
|
||||
tools:visibility="gone" />
|
||||
<!-- todo 需要放入使用方 -->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"-->
|
||||
|
||||
<!--限速来源-->
|
||||
<TextView
|
||||
android:id="@+id/tvLimitingSource"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="35dp"
|
||||
android:gravity="center"
|
||||
android:text=""
|
||||
android:textColor="@color/color_FFFFFF"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/viewLimitingVelocity" />
|
||||
|
||||
<!--消息盒子司机端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxDriver"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="150dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:button="@null"
|
||||
android:layout_marginEnd="25dp"
|
||||
android:background="@drawable/selector_msg_box"
|
||||
android:button="@null"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintRight_toLeftOf="@id/viewLimitingVelocity"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
<!-- todo 需要放入使用方 , view先gone掉方便重组 -->
|
||||
<!-- app:layout_constraintTop_toBottomOf="@+id/ivCameraIcon" />-->
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
@@ -203,26 +119,24 @@
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="32dp"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<!--消息盒子乘客端选择入口-->
|
||||
<CheckBox
|
||||
android:id="@+id/cbMsgBoxPassenger"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginStart="320dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:button="@null"
|
||||
android:background="@drawable/selector_msg_box_p"
|
||||
android:button="@null"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<!--乘客端消息提示-->
|
||||
<View
|
||||
@@ -231,54 +145,49 @@
|
||||
android:layout_height="15dp"
|
||||
android:background="@drawable/version_upgrade_tips_background"
|
||||
android:translationZ="30dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintCircle="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintCircleAngle="40"
|
||||
app:layout_constraintCircleRadius="50dp"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxListView
|
||||
android:id="@+id/viewDriverMsgBoxList"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="746px"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.DriverMsgBoxBubbleView
|
||||
android:id="@+id/viewDriverMsgBoxBubble"
|
||||
android:layout_width="864px"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
android:visibility="visible"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/cbMsgBoxDriver" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxBubbleView
|
||||
android:id="@+id/viewPassengerMsgBoxBubble"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.msgbox.PassengerMsgBoxListView
|
||||
android:id="@+id/viewPassengerMsgBoxList"
|
||||
android:layout_width="650px"
|
||||
android:layout_height="750px"
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:layout_constraintBottom_toTopOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintLeft_toLeftOf="@id/cbMsgBoxPassenger"
|
||||
app:layout_constraintRight_toRightOf="@id/cbMsgBoxPassenger" />
|
||||
|
||||
<!--左右转向灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.turnlight.TurnLightViewStatus
|
||||
@@ -300,6 +209,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!--pnc行为决策-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.pnc.PncActionsView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -328,8 +238,4 @@
|
||||
app:layout_goneMarginTop="30dp" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="parent"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -1,18 +0,0 @@
|
||||
<?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"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:background="#00000000"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivWaringIcon"
|
||||
android:layout_width="132dp"
|
||||
android:layout_height="132dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -50,8 +50,8 @@
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TapPositionView">
|
||||
<attr name="defaultColor" format="color"/> <!--档位默认色值-->
|
||||
<attr name="selectColor" format="color"/> <!--当前档位色值-->
|
||||
<attr name="defaultColor" format="color" /> <!--档位默认色值-->
|
||||
<attr name="selectColor" format="color" /> <!--当前档位色值-->
|
||||
</declare-styleable>
|
||||
|
||||
<style name="BaseFloatDialogStyle" parent="@android:style/Theme.Dialog">
|
||||
@@ -68,4 +68,10 @@
|
||||
<item name="android:topDark">@android:color/transparent</item>
|
||||
<item name="android:borderlessButtonStyle">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
<declare-styleable name="VipIdentificationView">
|
||||
<attr name="marginStart" format="dimension" />
|
||||
<attr name="marginTop" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user