Merge remote-tracking branch 'origin/dev_robotaxi-d-app-module_265_220329_2.6.5' into dev_robotaxi-d-app-module_265_220329_2.6.5

This commit is contained in:
xinfengkun
2022-03-30 15:15:01 +08:00
5 changed files with 28 additions and 9 deletions

View File

@@ -4,6 +4,7 @@ import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEV
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import androidx.annotation.Nullable;
@@ -107,7 +108,6 @@ public class MoGoHandAdasMsgManager implements
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
}
@Override
@@ -148,13 +148,13 @@ public class MoGoHandAdasMsgManager implements
//根据加速度判断 是否刹车
if (gnssInfo != null) {
//设置刹车信息
if (gnssInfo.getAcceleration() < -2.5) {
if (gnssInfo.getAcceleration() < SharedPrefsMgr.getInstance(mContext).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)) {
brakeLight = 1;
} else {
brakeLight = 0;
}
if (!isShowTurnLight) {
ThreadUtils.runOnUiThread(() -> CallerHmiManager.INSTANCE.showBrakeLight(brakeLight));
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
}
}
}

View File

@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
import com.mogo.eagle.core.utilcode.kotlin.shape
import com.mogo.eagle.core.utilcode.reminder.Reminder
import com.mogo.eagle.core.utilcode.reminder.api.impl.PopupWindowReminder
import com.mogo.eagle.core.utilcode.util.BarUtils
import com.mogo.eagle.core.utilcode.util.WindowUtils
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
@@ -66,8 +67,9 @@ internal fun Context.toast(text: CharSequence, duration: Long = 2, unit: TimeUni
}
@SuppressLint("ClickableViewAccessibility")
internal fun Context.pop(content: View, width: Int, height: Int, key: String, fitSystemWindow: Boolean = true, onOuterViewClicked:((focus: View) -> Unit)? = null): () -> Unit {
internal fun Context.pop(content: View, width: Int, height: Int, key: String, onOuterViewClicked:((focus: View) -> Unit)? = null): () -> Unit {
val activity = (this as? FragmentActivity) ?: throw IllegalStateException("please use Activity to trigger pop show.")
val isImmersiveMode = BarUtils.isImmersiveMode(activity)
var tempReminder: PopupWindowReminder? = null
activity.lifecycleScope.launchWhenResumed {
val pop = PopupWindow(width, height).also {
@@ -128,7 +130,7 @@ internal fun Context.pop(content: View, width: Int, height: Int, key: String, fi
}
override fun show() {
pop.showAtLocation(activity.window.decorView, Gravity.START, 0, if (fitSystemWindow) WindowUtils.getStatusBarHeight(activity) else 0)
pop.showAtLocation(activity.window.decorView, Gravity.START, 0, if (isImmersiveMode) 0 else BarUtils.getStatusBarHeight())
}
override fun isOverride(): Boolean = false
}

View File

@@ -97,7 +97,7 @@ internal class FeedBackView : ConstraintLayout {
transitionTo(0)
} else {
editOutRect.run {
transitionTo(-( it - top + height() + 300.PX))
transitionTo(-( it - top + height() + 228.PX))
}
}
}.also {

View File

@@ -14,6 +14,7 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--V2X预警红色边框-->
<com.mogo.eagle.core.function.hmi.ui.widget.V2XWarningView
android:id="@+id/flV2XWarningView"
android:layout_width="match_parent"
@@ -23,6 +24,7 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--脉速表-->
<com.mogo.eagle.core.function.hmi.ui.widget.SpeedPanelView
android:id="@+id/viewSpeedChart"
android:layout_width="@dimen/module_ext_speed_width"
@@ -33,6 +35,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--Vie车辆标志-->
<com.mogo.eagle.core.function.hmi.ui.widget.VipIdentificationView
android:id="@+id/flVipIdentificationView"
android:layout_width="@dimen/module_vip_width"
@@ -43,6 +46,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--自动驾驶按钮及状态-->
<com.mogo.eagle.core.function.hmi.ui.widget.AutoPilotStatusView
android:id="@+id/viewAutopilotStatus"
android:layout_width="@dimen/module_mogo_autopilot_status_bg_width"
@@ -53,7 +57,7 @@
app:layout_constraintTop_toBottomOf="@+id/viewSpeedChart"
app:layout_goneMarginStart="@dimen/module_mogo_autopilot_status_margin_left" />
<!--超视距-->
<ImageView
android:id="@+id/ivCameraIcon"
android:layout_width="130px"
@@ -65,6 +69,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<!--红绿灯-->
<com.mogo.eagle.core.function.hmi.ui.widget.TrafficLightView
android:id="@+id/viewTrafficLightVr"
android:layout_width="wrap_content"
@@ -77,7 +82,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />
<!--地图视角切换-->
<com.mogo.eagle.core.function.hmi.ui.widget.PerspectiveSwitchView
android:id="@+id/viewPerspectiveSwitch"
android:layout_width="wrap_content"
@@ -88,6 +93,7 @@
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" />
<!--工具箱-->
<ImageView
android:id="@+id/ivToolsIcon"
android:layout_width="@dimen/module_hmi_check_size"
@@ -102,6 +108,7 @@
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
app:layout_goneMarginStart="50px" />
<!--问题反馈-->
<ImageView
android:id="@+id/vsBadCaseToolsView"
android:layout_width="@dimen/module_hmi_check_size"
@@ -126,7 +133,7 @@
app:layout_constraintCircleRadius="60px"
tools:ignore="MissingConstraints" />
<!--限速牌子-->
<com.mogo.eagle.core.function.hmi.ui.widget.LimitingVelocityView
android:id="@+id/viewLimitingVelocity"
android:layout_width="130px"

View File

@@ -733,4 +733,14 @@ public final class BarUtils {
}
return false;
}
/**
* 当前Activity是否是沉浸式模式
*/
public static boolean isImmersiveMode(Activity activity) {
Window window = activity.getWindow();
View decor = window.getDecorView();
int systemUiVisibility = decor.getSystemUiVisibility();
return (systemUiVisibility & View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN) != 0;
}
}