[2.13.0-arch-opt] merge
This commit is contained in:
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
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ import kotlin.math.abs
|
||||
* 调试使用的设置页面,这里只作为调试使用
|
||||
* 展示 本机、网络、工控机、OBU等状态信息,支持设置IP,等参数进行调试
|
||||
*/
|
||||
class DebugSettingView @JvmOverloads constructor(
|
||||
internal class DebugSettingView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -38,7 +38,6 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
init {
|
||||
initEvent()
|
||||
setBackgroundResource(R.drawable.yi_biao_pan_bg_nor)
|
||||
mContext = context
|
||||
mSpeedChartView = SpeedChartView(context)
|
||||
@@ -52,13 +51,6 @@ class SpeedPanelView @JvmOverloads constructor(
|
||||
addView(mSpeedChartView)
|
||||
}
|
||||
|
||||
private fun initEvent() {
|
||||
setOnLongClickListener {
|
||||
CallerHmiManager.toggleDebugView()
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
private var timerTask: TimerTask? = null
|
||||
|
||||
override fun onAttachedToWindow() {
|
||||
|
||||
@@ -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的出场位置
|
||||
|
||||
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>
|
||||
@@ -40,13 +40,13 @@
|
||||
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.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"
|
||||
@@ -102,17 +102,14 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
|
||||
<View
|
||||
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"
|
||||
/>
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<!--工具箱-->
|
||||
<ImageView
|
||||
@@ -187,14 +184,14 @@
|
||||
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_toBottomOf="@+id/ivCameraIcon" />
|
||||
|
||||
<!--司机端消息提示-->
|
||||
<View
|
||||
android:id="@+id/MsgBoxTipView"
|
||||
@@ -202,26 +199,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
|
||||
@@ -230,54 +225,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"
|
||||
/>
|
||||
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
|
||||
@@ -327,8 +317,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">
|
||||
@@ -73,4 +73,5 @@
|
||||
<attr name="marginStart" format="dimension" />
|
||||
<attr name="marginTop" format="dimension" />
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user