Merge branch 'dev_robotaxi-d-app-module_290_220715_2.9.0' into 'dev_robotaxi-d-app-module_282_220707_2.8.2'
# Conflicts: # core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt # core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/V2XEventManager.kt
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
-->
|
||||
<activity
|
||||
android:name="com.mogo.eagle.core.function.main.MainLauncherActivity"
|
||||
android:clearTaskOnLaunch="true"
|
||||
android:clearTaskOnLaunch="${ACTIVITY_ROOT}"
|
||||
android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|screenLayout|fontScale|uiMode|orientation|screenSize|smallestScreenSize"
|
||||
android:enabled="true"
|
||||
android:launchMode="singleTop"
|
||||
@@ -63,6 +63,10 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<meta-data
|
||||
android:name="MAP_SDK_VERSION111111"
|
||||
android:value="${MAP_SDK_VERSION}" />
|
||||
|
||||
<service
|
||||
android:name="com.mogo.eagle.core.function.main.service.MogoMainService"
|
||||
android:enabled="true"
|
||||
|
||||
@@ -19,6 +19,8 @@ import android.widget.*
|
||||
import androidx.core.view.*
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.alibaba.android.arouter.launcher.ARouter
|
||||
import com.mogo.commons.mvp.BaseFragment
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.commons.voice.*
|
||||
import com.mogo.eagle.core.data.bindingcar.AdUpgradeStateHelper
|
||||
@@ -48,6 +50,7 @@ import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager
|
||||
import com.mogo.eagle.core.function.call.check.CallerCheckManager
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapDataCollectorManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.function.hmi.WaringConst
|
||||
@@ -57,6 +60,7 @@ import com.mogo.eagle.core.function.hmi.ui.bindingcar.ModifyBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.ToBindingCarDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.bindingcar.UpgradeAppDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.CameraListView
|
||||
import com.mogo.eagle.core.function.hmi.ui.camera.RoadVideoDialog
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeBannerView
|
||||
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeNormalBannerView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.DebugSettingView
|
||||
@@ -87,7 +91,6 @@ import kotlinx.coroutines.*
|
||||
import mogo_msg.MogoReportMsg
|
||||
import record_cache.RecordPanelOuterClass
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
|
||||
/**
|
||||
@@ -143,6 +146,12 @@ import kotlin.collections.ArrayList
|
||||
private var speakJob: Job? = null
|
||||
|
||||
private var showingV2XTip: IReminder? = null
|
||||
private var roadVideoDialog: RoadVideoDialog? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
}
|
||||
|
||||
override fun vipIdentification(visible: Boolean) {
|
||||
ThreadUtils.runOnUiThread {
|
||||
if (visible) {
|
||||
@@ -161,10 +170,10 @@ import kotlin.collections.ArrayList
|
||||
}
|
||||
}
|
||||
|
||||
/*ivCameraIcon?.setOnLongClickListener {
|
||||
activity?.let { it1 -> CarcorderPreviewView.show(it1) }
|
||||
ivCameraIcon?.setOnLongClickListener {
|
||||
showSmallFragment()
|
||||
true
|
||||
}*/
|
||||
}
|
||||
|
||||
ivToolsIcon?.setOnClickListener {
|
||||
if (toolsViewFloat == null) {
|
||||
@@ -297,6 +306,15 @@ import kotlin.collections.ArrayList
|
||||
mViewNotificationProvider = provider
|
||||
}
|
||||
|
||||
override fun showVideoDialog(url: String, isFlvUrl: Boolean) {
|
||||
context?.let {
|
||||
if (roadVideoDialog == null) {
|
||||
roadVideoDialog = RoadVideoDialog(it)
|
||||
}
|
||||
roadVideoDialog?.show(url, isFlvUrl)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 红绿灯 代理View
|
||||
*/
|
||||
@@ -1004,28 +1022,72 @@ import kotlin.collections.ArrayList
|
||||
}
|
||||
}
|
||||
|
||||
private var isLeftLight :Boolean = false
|
||||
private var isRightLight :Boolean = false
|
||||
private var isDisappare :Boolean = false
|
||||
|
||||
/**
|
||||
* 显示转向灯效果 if (HmiBuildConfig.isShowBadCaseView) {
|
||||
*/
|
||||
override fun showTurnLight(light: Int) {
|
||||
if (HmiBuildConfig.isShowTurnLightView) {
|
||||
Log.e("liyz", "showTurnLight light = $light")
|
||||
ThreadUtils.runOnUiThread {
|
||||
turnLightView?.let {
|
||||
turnLightView.setTurnLight(light)
|
||||
if (light == 1) {
|
||||
if (!isLeftLight) {
|
||||
isLeftLight = true
|
||||
isRightLight = false
|
||||
isDisappare = false
|
||||
//TODO
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
||||
}
|
||||
} else if (light == 2) {
|
||||
if (!isRightLight) {
|
||||
isRightLight = true
|
||||
isLeftLight = false
|
||||
isDisappare = false
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
||||
}
|
||||
} else {
|
||||
if (!isDisappare) {
|
||||
isDisappare = true
|
||||
isLeftLight = false
|
||||
isRightLight = false
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
|
||||
// turnLightView?.let {
|
||||
// turnLightView.setTurnLight(light)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private var isBrake: Boolean = false
|
||||
|
||||
/**
|
||||
* 显示刹车效果
|
||||
*/
|
||||
override fun showBrakeLight(light: Int) {
|
||||
if (HmiBuildConfig.isShowBrakeLightView) {
|
||||
Log.e("liyz", "showBrakeLight isBrake = $isBrake")
|
||||
ThreadUtils.runOnUiThread {
|
||||
brakeView?.let {
|
||||
brakeView.setBrakeLight(light)
|
||||
if (light == 1) { //刹车灯亮
|
||||
if (!isBrake) {
|
||||
isBrake = true
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(0, 500)
|
||||
}
|
||||
} else {
|
||||
if (isBrake) {
|
||||
isBrake = false
|
||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||
}
|
||||
}
|
||||
|
||||
// brakeView?.let {
|
||||
// brakeView.setBrakeLight(light)
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1138,6 +1200,29 @@ import kotlin.collections.ArrayList
|
||||
}
|
||||
}
|
||||
|
||||
override fun showSmallFragment() {
|
||||
// 加载全览模式图层
|
||||
val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
|
||||
.navigation() as BaseFragment
|
||||
activity?.supportFragmentManager?.beginTransaction()
|
||||
?.setCustomAnimations(R.anim.slide_in, R.anim.fade_out)?.apply {
|
||||
if (!fragmentOverview.isAdded) {
|
||||
add(R.id.module_main_id_smp_fragment, fragmentOverview, fragmentOverview.tagName)
|
||||
} else {
|
||||
show(fragmentOverview)
|
||||
}.commitAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun hideSmallFragment() {
|
||||
val fragmentOverview = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_OVERVIEW)
|
||||
.navigation() as BaseFragment
|
||||
activity?.supportFragmentManager?.beginTransaction()
|
||||
?.setCustomAnimations(R.anim.slide_in, R.anim.fade_out)
|
||||
?.hide(fragmentOverview)
|
||||
?.commitAllowingStateLoss()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
CallerLogger.d("$M_HMI$TAG", "onDestroy")
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.camera
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.PorterDuff
|
||||
import android.graphics.PorterDuffColorFilter
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import com.mogo.eagle.core.function.call.monitor.CallerMonitorManager
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
import com.mogo.module.common.dialog.BaseFloatDialog
|
||||
import com.shuyu.gsyvideoplayer.GSYVideoManager
|
||||
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
|
||||
import com.shuyu.gsyvideoplayer.model.VideoOptionModel
|
||||
import com.shuyu.gsyvideoplayer.player.IjkPlayerManager
|
||||
import com.shuyu.gsyvideoplayer.player.PlayerFactory
|
||||
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
|
||||
import kotlinx.android.synthetic.main.road_video_dialog.*
|
||||
import kotlinx.android.synthetic.main.view_camera_list.view.*
|
||||
import tv.danmaku.ijk.media.player.IjkMediaPlayer
|
||||
|
||||
|
||||
/**
|
||||
* @brief 道路视频Dialog
|
||||
* @author chenfufeng
|
||||
*/
|
||||
class RoadVideoDialog(context: Context) : BaseFloatDialog(context), LifecycleObserver {
|
||||
|
||||
private val TAG = "RoadVideoDialog"
|
||||
|
||||
private var mVideoUrl: String = ""
|
||||
|
||||
private val gsyVideoOptionBuilder by lazy {
|
||||
GSYVideoOptionBuilder()
|
||||
}
|
||||
|
||||
init {
|
||||
setContentView(R.layout.road_video_dialog)
|
||||
roadVideoPB.indeterminateDrawable.colorFilter = PorterDuffColorFilter(
|
||||
ContextCompat.getColor(context, R.color.notice_blue),
|
||||
PorterDuff.Mode.MULTIPLY
|
||||
)
|
||||
setCanceledOnTouchOutside(false)
|
||||
|
||||
roadVideoClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
initVideoPlayer()
|
||||
}
|
||||
|
||||
fun show(url: String, isFlvUrl: Boolean) {
|
||||
show()
|
||||
roadVideoPB.visibility = View.VISIBLE
|
||||
if (!isFlvUrl) {
|
||||
// 打开指定ip的摄像头直播流
|
||||
CallerMonitorManager.openCameraStream(url, { flvUrl ->
|
||||
gsyVideoPlay(flvUrl)
|
||||
}) {
|
||||
ToastUtils.showShort(it.message)
|
||||
dismiss()
|
||||
}
|
||||
} else {
|
||||
gsyVideoPlay(url)
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
stopLive()
|
||||
}
|
||||
|
||||
private fun initVideoPlayer() {
|
||||
val list: MutableList<VideoOptionModel> = ArrayList()
|
||||
list.add(VideoOptionModel(IjkMediaPlayer.OPT_CATEGORY_PLAYER, "reconnect", 3))
|
||||
GSYVideoManager.instance().optionModelList = list
|
||||
GSYVideoType.setShowType(GSYVideoType.SCREEN_MATCH_FULL)
|
||||
PlayerFactory.setPlayManager(IjkPlayerManager::class.java)
|
||||
roadVideoPlayer.setPlayListener(object : SimpleVideoPlayer.PlayListener {
|
||||
override fun onPlayEvent(event: Int) {
|
||||
CallerLogger.d("${SceneConstant.M_HMI}$TAG", "onPlayEvent: event is:$event")
|
||||
when (event) {
|
||||
SimpleVideoPlayer.PLAY_EVT_PLAY_LOADING -> {
|
||||
// 会出现临时中断后又可以继续播放,需要停掉倒计时
|
||||
|
||||
}
|
||||
SimpleVideoPlayer.PLAY_EVT_PLAY_BEGIN -> {
|
||||
roadVideoPB.visibility = View.GONE
|
||||
roadVideoPlayer.visibility = View.VISIBLE
|
||||
}
|
||||
else -> {
|
||||
CallerLogger.w("${SceneConstant.M_HMI}$TAG", "播放视频异常,event is:$event")
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun gsyVideoPlay(flvUrl: String) {
|
||||
gsyVideoOptionBuilder.setUrl(flvUrl)
|
||||
.setCacheWithPlay(false)
|
||||
.setAutoFullWithSize(false)
|
||||
.setIsTouchWigetFull(false)
|
||||
.setIsTouchWiget(false)
|
||||
.setPlayTag(TAG).build(roadVideoPlayer)
|
||||
roadVideoPlayer.startButton.performClick()
|
||||
}
|
||||
|
||||
private fun stopLive() {
|
||||
try {
|
||||
GSYVideoManager.releaseAllVideos()
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1956,6 +1956,13 @@ class DebugSettingView @JvmOverloads constructor(
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆加速度
|
||||
*/
|
||||
override fun onAutopilotAcc(carAcc: Float) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
/**
|
||||
* 吐司提示
|
||||
*/
|
||||
|
||||
@@ -176,6 +176,15 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
Log.d(TAG, "刹车灯:" + String.valueOf(brakeLight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 车辆加速度
|
||||
* @param carAcc
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotAcc(float carAcc) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
@@ -223,7 +232,7 @@ public class SteeringWheelView extends ConstraintLayout {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "档位" + gear.toString());
|
||||
Log.d(TAG, "乘客屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
@@ -30,6 +31,7 @@ public class TapPositionView extends ConstraintLayout {
|
||||
private TextView tabR;
|
||||
private TextView tabN;
|
||||
private TextView tabD;
|
||||
private TypedArray typedArray;
|
||||
|
||||
public TapPositionView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
@@ -39,90 +41,48 @@ public class TapPositionView extends ConstraintLayout {
|
||||
tabR = findViewById(R.id.tap_r);
|
||||
tabN = findViewById(R.id.tap_n);
|
||||
tabD = findViewById(R.id.tap_d);
|
||||
typedArray = context.obtainStyledAttributes(attrs, R.styleable.TapPositionView);
|
||||
}
|
||||
|
||||
public void updateWithGear(@NotNull Chassis.GearPosition gear) {
|
||||
if (tabP != null && tabR != null && tabN != null && tabD != null) {
|
||||
if (AppIdentityModeUtils.isTaxi(FunctionBuildConfig.appIdentityMode)) {
|
||||
taxiGear(gear);
|
||||
} else {
|
||||
busGear(gear);
|
||||
int defaultColor = typedArray.getColor(R.styleable.TapPositionView_defaultColor, -1);
|
||||
int selectColor = typedArray.getColor(R.styleable.TapPositionView_selectColor, -1);
|
||||
Log.d(TAG, "gear:" + gear);
|
||||
switch (gear) {
|
||||
case GEAR_NONE:
|
||||
tabP.setTextColor(defaultColor);
|
||||
tabR.setTextColor(defaultColor);
|
||||
tabN.setTextColor(defaultColor);
|
||||
tabD.setTextColor(defaultColor);
|
||||
break;
|
||||
case GEAR_P:
|
||||
tabP.setTextColor(selectColor);
|
||||
tabR.setTextColor(defaultColor);
|
||||
tabN.setTextColor(defaultColor);
|
||||
tabD.setTextColor(defaultColor);
|
||||
break;
|
||||
case GEAR_R:
|
||||
tabR.setTextColor(selectColor);
|
||||
tabP.setTextColor(defaultColor);
|
||||
tabN.setTextColor(defaultColor);
|
||||
tabD.setTextColor(defaultColor);
|
||||
break;
|
||||
case GEAR_N:
|
||||
tabN.setTextColor(selectColor);
|
||||
tabR.setTextColor(defaultColor);
|
||||
tabP.setTextColor(defaultColor);
|
||||
tabD.setTextColor(defaultColor);
|
||||
break;
|
||||
case GEAR_D:
|
||||
tabD.setTextColor(selectColor);
|
||||
tabN.setTextColor(defaultColor);
|
||||
tabR.setTextColor(defaultColor);
|
||||
tabP.setTextColor(defaultColor);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void busGear(@NotNull Chassis.GearPosition gear) {
|
||||
switch (gear) {
|
||||
case GEAR_NONE:
|
||||
tabP.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabR.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabN.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabD.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
break;
|
||||
case GEAR_P:
|
||||
tabP.setTextColor(Color.parseColor("#0043FF"));
|
||||
tabR.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabN.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabD.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
break;
|
||||
case GEAR_R:
|
||||
tabR.setTextColor(Color.parseColor("#0043FF"));
|
||||
tabP.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabN.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabD.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
break;
|
||||
case GEAR_N:
|
||||
tabN.setTextColor(Color.parseColor("#0043FF"));
|
||||
tabR.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabP.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabD.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
break;
|
||||
case GEAR_D:
|
||||
tabD.setTextColor(Color.parseColor("#0043FF"));
|
||||
tabN.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabR.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
tabP.setTextColor(Color.parseColor("#6E8EC9"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void taxiGear(@NotNull Chassis.GearPosition gear) {
|
||||
switch (gear) {
|
||||
case GEAR_NONE:
|
||||
tabP.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabR.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabN.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabD.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
break;
|
||||
case GEAR_P:
|
||||
tabP.setTextColor(Color.parseColor("#FFFFFFFF"));
|
||||
tabR.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabN.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabD.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
break;
|
||||
case GEAR_R:
|
||||
tabR.setTextColor(Color.parseColor("#FFFFFFFF"));
|
||||
tabP.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabN.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabD.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
break;
|
||||
case GEAR_N:
|
||||
tabN.setTextColor(Color.parseColor("#FFFFFFFF"));
|
||||
tabR.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabP.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabD.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
break;
|
||||
case GEAR_D:
|
||||
tabD.setTextColor(Color.parseColor("#FFFFFFFF"));
|
||||
tabN.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabR.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
tabP.setTextColor(Color.parseColor("#FF6E8EC9"));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.widget;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig;
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import chassis.Chassis;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
* @description 速度 加速度 档位 刹车 油门状态值
|
||||
* @since: 6/24/22
|
||||
*/
|
||||
public class TrafficDataView extends ConstraintLayout {
|
||||
private static final String TAG = "TrafficDataView";
|
||||
private TapPositionView tapPositionView;
|
||||
private TextView speedTextView;
|
||||
private TextView accTextView;
|
||||
private ImageView speedImage;
|
||||
//圆弧颜色
|
||||
private int mArcColor;
|
||||
|
||||
public TrafficDataView(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
CallerAutopilotVehicleStateListenerManager.INSTANCE.addListener(TAG, mIMoGoAutopilotVehicleStateListener);
|
||||
}
|
||||
|
||||
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public TrafficDataView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
private void initView(@NonNull Context context) {
|
||||
if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {
|
||||
// LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this);
|
||||
} else {
|
||||
}
|
||||
LayoutInflater.from(context).inflate(R.layout.hmi_traffic_data, this);
|
||||
tapPositionView = findViewById(R.id.traffic_position);
|
||||
speedImage = findViewById(R.id.speedImage);
|
||||
speedTextView = findViewById(R.id.speedTextView);
|
||||
accTextView = findViewById(R.id.speedAccTextView);
|
||||
}
|
||||
|
||||
private final IMoGoAutopilotVehicleStateListener mIMoGoAutopilotVehicleStateListener = new IMoGoAutopilotVehicleStateListener() {
|
||||
/**
|
||||
* 车辆转向灯
|
||||
* @param lightSwitch
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
|
||||
Log.d(TAG, "车辆转向灯:" + lightSwitch.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 刹车灯
|
||||
* @param brakeLight
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotBrakeLightData(boolean brakeLight) {
|
||||
Log.d(TAG, "刹车灯:" + String.valueOf(brakeLight));
|
||||
}
|
||||
|
||||
/**
|
||||
* 方向盘转向角 左+右-
|
||||
* @param steering
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotSteeringData(float steering) {
|
||||
Log.d(TAG, "steering原始值====" + String.valueOf(steering));
|
||||
if (Math.abs(steering) < 1) {
|
||||
steering = 0;
|
||||
}
|
||||
float steeringValue = steering;
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "steering忽略小数点后====" + String.valueOf((int) steeringValue));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 档位
|
||||
* @param gear
|
||||
*/
|
||||
@Override
|
||||
public void onAutopilotGearData(@NotNull Chassis.GearPosition gear) {
|
||||
ThreadUtils.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d(TAG, "司机屏档位" + gear.toString());
|
||||
if (tapPositionView != null) {
|
||||
tapPositionView.updateWithGear(gear);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotDataException(long timestamp) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAutopilotAcc(float carAcc) {
|
||||
Log.d(TAG, "司机屏加速度:" + carAcc);
|
||||
java.text.DecimalFormat myformat = new java.text.DecimalFormat("0.00");
|
||||
String accStr = myformat.format(carAcc);
|
||||
accTextView.setText("a: " + accStr);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 设置弧形颜色
|
||||
*
|
||||
* @param value 颜色值
|
||||
*/
|
||||
public void setArcColor(int value) {
|
||||
mArcColor = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置数据
|
||||
*
|
||||
* @param value 当前绘制的值
|
||||
*/
|
||||
public void setValues(int value) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* value呈现
|
||||
*/
|
||||
public void updateSpeedWithValue(int newSpeed) {
|
||||
if (speedTextView != null) {
|
||||
speedTextView.setText(String.valueOf(newSpeed));
|
||||
}
|
||||
if (speedImage != null) {
|
||||
speedImage.setBackgroundResource(newSpeed > 60 ? R.drawable.traffic_data_speed_warning : R.drawable.traffic_data_speed);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,7 +33,6 @@ import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager;
|
||||
import com.mogo.eagle.core.function.hmi.R;
|
||||
import com.mogo.eagle.core.function.main.cards.MogoModulesManager;
|
||||
import com.mogo.eagle.core.function.main.service.MogoMainService;
|
||||
import com.mogo.eagle.core.function.main.stagetwo.APMStartup;
|
||||
import com.mogo.eagle.core.function.main.stagetwo.AutopilotStartup;
|
||||
import com.mogo.eagle.core.function.main.utils.DisplayEffectsHelper;
|
||||
import com.mogo.eagle.core.function.main.windowview.FloatingViewHandler;
|
||||
@@ -229,7 +228,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
MogoModulesManager.getInstance().init(this);
|
||||
|
||||
IMogoHosListenerRegister listenerRegister = CallerMapUIServiceManager.INSTANCE.getHostListenerRegister();
|
||||
if (listenerRegister != null) {
|
||||
listenerRegister.registerHostMapListener(EventDispatchCenter.getInstance());
|
||||
@@ -304,7 +302,6 @@ public class MainActivity extends MvpActivity<MainView, MainPresenter> implement
|
||||
// 加载 HMI 图层
|
||||
BaseFragment fragmentHdMap = (BaseFragment) ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_HMI).navigation();
|
||||
addFragment(fragmentHdMap, fragmentHdMap.getTagName(), R.id.module_main_id_waring_fragment);
|
||||
|
||||
// 加载 小地图 图层
|
||||
BaseFragment fragmentSmpMap = (BaseFragment) ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP).navigation();
|
||||
addFragment(fragmentSmpMap, fragmentSmpMap.getTagName(), R.id.module_main_id_smp_fragment);
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.mogo.eagle.core.function.api.chat.biz.ChatConsts;
|
||||
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
|
||||
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants;
|
||||
import com.mogo.eagle.core.function.overview.OverviewDb;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.AppLaunchTimeUtils;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
@@ -48,6 +49,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
}
|
||||
start = System.currentTimeMillis();
|
||||
connectAmiIp();
|
||||
initOverviewDb();
|
||||
// Crash 日志收集
|
||||
initCrashConfig();
|
||||
initLogConfig();
|
||||
@@ -95,6 +97,10 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
|
||||
CallerDevaToolsManager.INSTANCE.init(this);
|
||||
}
|
||||
|
||||
private void initOverviewDb() {
|
||||
OverviewDb.Companion.getDb(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接ami
|
||||
*/
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
package com.mogo.eagle.core.function.main.stagetwo;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.test.crashreport.CrashReportConstants;
|
||||
import com.mogo.test.crashreport.upgrade.UpgradeReportConstants;
|
||||
import com.rousetime.android_startup.AndroidStartup;
|
||||
|
||||
public class APMStartup extends AndroidStartup<Boolean> {
|
||||
@Nullable
|
||||
@Override
|
||||
public Boolean create(@NonNull Context context) {
|
||||
// bugly
|
||||
ARouter.getInstance().build(UpgradeReportConstants.PATH).navigation();
|
||||
// apm
|
||||
ARouter.getInstance().build(CrashReportConstants.PATH).navigation();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean callCreateOnMainThread() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean waitOnMainThread() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 42 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.4 MiB |
@@ -51,7 +51,7 @@
|
||||
android:layout_marginTop="@dimen/dp_72"
|
||||
android:layout_marginRight="-16px"
|
||||
android:gravity="right"
|
||||
android:text="180°"
|
||||
android:text="0°"
|
||||
android:textColor="#415479"
|
||||
android:textSize="@dimen/dp_38"
|
||||
android:visibility="invisible"
|
||||
@@ -65,7 +65,7 @@
|
||||
android:layout_marginLeft="-16px"
|
||||
android:layout_marginTop="@dimen/dp_72"
|
||||
android:gravity="left"
|
||||
android:text="180°"
|
||||
android:text="0°"
|
||||
android:textColor="#415479"
|
||||
android:textSize="@dimen/dp_38"
|
||||
app:layout_constraintLeft_toRightOf="@+id/steering_circular"
|
||||
@@ -87,6 +87,8 @@
|
||||
android:layout_width="@dimen/dp_390"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_42"
|
||||
app:defaultColor = "@color/p_default_txt_color"
|
||||
app:selectColor="@color/bus_p_select_txt_color"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
|
||||
@@ -88,6 +88,8 @@
|
||||
android:layout_width="@dimen/dp_272"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:defaultColor="@color/p_default_txt_color"
|
||||
app:selectColor="@color/dark_mode_select_txt_color"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/steering_circular_alpha" />
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
android:gravity="center"
|
||||
android:text="P"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#6E8EC9"
|
||||
android:textColor="@color/p_default_txt_color"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -27,7 +27,7 @@
|
||||
android:gravity="center"
|
||||
android:text="R"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#6E8EC9"
|
||||
android:textColor="@color/p_default_txt_color"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -42,7 +42,7 @@
|
||||
android:gravity="center"
|
||||
android:text="N"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#6E8EC9"
|
||||
android:textColor="@color/p_default_txt_color"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
@@ -57,7 +57,7 @@
|
||||
android:gravity="center"
|
||||
android:text="D"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#0043FF"
|
||||
android:textColor="@color/p_default_txt_color"
|
||||
android:textSize="@dimen/dp_46"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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"
|
||||
android:layout_width="@dimen/dp_616"
|
||||
android:layout_height="@dimen/dp_320"
|
||||
android:background="@drawable/traffic_data_back">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/speedImage"
|
||||
android:layout_width="@dimen/dp_270"
|
||||
android:layout_height="@dimen/dp_270"
|
||||
android:layout_marginLeft="@dimen/dp_46"
|
||||
android:background="@drawable/traffic_data_speed"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/speedTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="80px"
|
||||
android:text="0"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/dp_70"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speedImage"
|
||||
app:layout_constraintRight_toRightOf="@+id/speedImage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/kmTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_176"
|
||||
android:text="KM/H"
|
||||
android:textAlignment="center"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/dp_30"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/speedImage"
|
||||
app:layout_constraintRight_toRightOf="@+id/speedImage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.TapPositionView
|
||||
android:id="@+id/traffic_position"
|
||||
android:layout_width="@dimen/dp_220"
|
||||
app:defaultColor="@color/acc_default_txt_color"
|
||||
app:selectColor="@color/dark_mode_select_txt_color"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp_28"
|
||||
android:layout_marginTop="@dimen/dp_80"
|
||||
android:layout_marginRight="@dimen/dp_80"
|
||||
app:layout_constraintLeft_toRightOf="@+id/speedImage"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/brakeStatus"
|
||||
android:layout_width="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_68"
|
||||
android:layout_marginLeft="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_174"
|
||||
android:layout_marginBottom="@dimen/dp_57"
|
||||
android:src="@drawable/traffic_data_empty"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toRightOf="@id/speedImage"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/speedAccTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_56"
|
||||
android:layout_marginLeft="@dimen/dp_42"
|
||||
android:layout_marginTop="@dimen/dp_190"
|
||||
android:text="a: "
|
||||
android:textAlignment="viewStart"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/dp_40"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/brakeStatus"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.mogo.eagle.core.widget.RoundConstraintLayout 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:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="1736px"
|
||||
android:minHeight="974px"
|
||||
app:roundLayoutRadius="30px"
|
||||
android:background="@drawable/road_video_bg"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<com.mogo.eagle.core.widget.media.video.SimpleVideoPlayer
|
||||
android:id="@+id/roadVideoPlayer"
|
||||
android:layout_width="1736px"
|
||||
android:layout_height="974px"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.core.widget.ContentLoadingProgressBar
|
||||
android:id="@+id/roadVideoPB"
|
||||
style="?android:attr/progressBarStyleSmall"
|
||||
android:layout_width="36dp"
|
||||
android:layout_height="36dp"
|
||||
android:visibility="visible"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/roadVideoClose"
|
||||
android:layout_width="100px"
|
||||
android:layout_height="100px"
|
||||
android:layout_marginEnd="42px"
|
||||
android:layout_marginTop="42px"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/module_push_dialog_close"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundConstraintLayout>
|
||||
@@ -6,4 +6,5 @@
|
||||
<color name="notice_check_dialog_bg_color">#E63B4577</color>
|
||||
<color name="notice_traffic_line">#555C7E</color>
|
||||
<color name="notice_dialog_back">#3B4577</color>
|
||||
<color name="acc_default_txt_color">#FF343C63</color>
|
||||
</resources>
|
||||
@@ -49,4 +49,8 @@
|
||||
<attr name="progress" format="integer" /> <!--圆环进度-->
|
||||
</declare-styleable>
|
||||
|
||||
<declare-styleable name="TapPositionView">
|
||||
<attr name="defaultColor" format="color"/> <!--档位默认色值-->
|
||||
<attr name="selectColor" format="color"/> <!--当前档位色值-->
|
||||
</declare-styleable>
|
||||
</resources>
|
||||
@@ -60,4 +60,9 @@
|
||||
<color name="hmi_light_blue_alpha_00">#D945D3FF</color>
|
||||
<color name="hmi_light_blue_alpha_ff">#D93261B6</color>
|
||||
<color name="hmi_clear_00">#00FFFFFF</color>
|
||||
<color name="acc_default_txt_color">#FF343C63</color>
|
||||
<color name="bus_p_select_txt_color">#0043FF</color>
|
||||
<color name="p_default_txt_color">#FF6E8EC9</color>
|
||||
<color name="dark_mode_select_txt_color">#FFFFFFFF</color>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user