Merge branch 'dev_arch_opt_3.0' into dev_robobus-m1-p-app-module_1.0.0_230112_1.0.0
# Conflicts: # app/src/main/java/com/mogo/launcher/stageone/ConfigStartUp.kt
This commit is contained in:
@@ -32,6 +32,27 @@
|
||||
app:marginStart="@dimen/dp_640"
|
||||
app:marginTop="@dimen/dp_80" />
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/module_mogo_och_autopilot_status"
|
||||
android:layout_width="@dimen/module_mogo_och_autopilot_status_bg_width"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.och.bus">
|
||||
package="com.mogo.och.noop">
|
||||
|
||||
/
|
||||
</manifest>
|
||||
@@ -4,6 +4,10 @@ import android.content.Context
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
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.CallerLogger.d
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -15,15 +19,70 @@ import com.alibaba.android.arouter.facade.annotation.Route
|
||||
@Route(path = OCHConstants.PATH)
|
||||
class MoGoOCHNoopProvider : IMogoOCH {
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MogoOCHNoopProvider"
|
||||
}
|
||||
|
||||
override val functionName: String
|
||||
get() = "MogoOCHNoopProvider"
|
||||
get() = TAG
|
||||
|
||||
private var fragment: OchNoopFragment? = null
|
||||
private var containerId = 0
|
||||
private var activity: FragmentActivity? = null
|
||||
|
||||
override fun init(context: Context) {
|
||||
MogoStatusManager.getInstance().registerStatusChangedListener(
|
||||
TAG, StatusDescriptor.VR_MODE, statusChangedListener
|
||||
)
|
||||
}
|
||||
|
||||
private val statusChangedListener =
|
||||
IMogoStatusChangedListener { descriptor: StatusDescriptor, isTrue: Boolean ->
|
||||
if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
// 进入vr模式默认显示网约车小巴fragment
|
||||
if (isTrue) {
|
||||
showFragment()
|
||||
} else {
|
||||
hideFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showFragment() {
|
||||
activity?.let {
|
||||
if (fragment == null) {
|
||||
d(TAG, "准备add fragment======")
|
||||
val fragmentByTag = it.supportFragmentManager.findFragmentByTag(TAG)
|
||||
fragment = if (fragmentByTag is OchNoopFragment) {
|
||||
fragmentByTag
|
||||
} else {
|
||||
OchNoopFragment()
|
||||
}
|
||||
if (!fragment!!.isAdded) {
|
||||
it.supportFragmentManager.beginTransaction()
|
||||
.add(containerId, fragment!!, TAG).commitAllowingStateLoss()
|
||||
}
|
||||
return
|
||||
}
|
||||
d(TAG, "准备show fragment")
|
||||
fragment?.let { noopFragment ->
|
||||
it.supportFragmentManager.beginTransaction().show(noopFragment)
|
||||
.commitAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideFragment() {
|
||||
if (fragment != null) {
|
||||
d(TAG, "准备hide fragment")
|
||||
activity?.supportFragmentManager?.beginTransaction()?.hide(fragment!!)
|
||||
?.commitAllowingStateLoss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun createCoverage(activity: FragmentActivity?, containerId: Int?): Fragment? {
|
||||
|
||||
this.containerId = containerId!!
|
||||
this.activity = activity
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,9 @@ package com.mogo.och.noop
|
||||
import android.view.View
|
||||
import com.mogo.commons.mvp.MvpFragment
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.call.biz.CallerFuncBizManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiViewControlListenerManager
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToggleDebugView
|
||||
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.DemoModeView
|
||||
import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
|
||||
import com.mogo.och.bus.R
|
||||
@@ -33,7 +30,6 @@ class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
|
||||
return OchNoopPresenter(this)
|
||||
}
|
||||
|
||||
|
||||
override fun initViews() {
|
||||
|
||||
//设置StatusBar初始状态
|
||||
@@ -44,23 +40,6 @@ class OchNoopFragment : MvpFragment<OchNoopContract.View?, OchNoopPresenter?>(),
|
||||
DemoModeView(requireContext())
|
||||
)
|
||||
|
||||
ivCameraIcon?.setOnClickListener {
|
||||
cameraLiveView.showCameraList(
|
||||
context,
|
||||
CallerFuncBizManager.bizProvider.getCameraList
|
||||
) { liveStatus ->
|
||||
if (liveStatus) {
|
||||
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_selected)
|
||||
} else {
|
||||
ivCameraIcon.setBackgroundResource(R.drawable.icon_camera_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ivToolsView?.setOnClickListener {
|
||||
toolsView.showToolsFloat(context)
|
||||
}
|
||||
|
||||
viewShowDebugView.setOnLongClickListener {
|
||||
ToggleDebugView.toggleDebugView.toggle(requireContext())
|
||||
true
|
||||
|
||||
@@ -22,8 +22,8 @@ public class SweeperLimitingVelocityView extends IViewLimitingVelocity {
|
||||
initView(context);
|
||||
}
|
||||
@Override
|
||||
public void updateLimitingSpeed(int limitingSpeed) {
|
||||
super.updateLimitingSpeed(limitingSpeed);
|
||||
public void updateLimitingSpeed(int limitingSpeed, int limitSource) {
|
||||
super.updateLimitingSpeed(limitingSpeed, limitSource);
|
||||
limitingVelocity.setText(String.valueOf(limitingSpeed));
|
||||
}
|
||||
private void initView(@NonNull Context context) {
|
||||
|
||||
@@ -26,7 +26,11 @@ import com.mogo.och.sweeper.R;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import chassis.Chassis;
|
||||
import chassis.VehicleStateOuterClass;
|
||||
|
||||
public class SweeperTrafficDataView extends ConstraintLayout
|
||||
implements IMoGoChassisLamplightListener,
|
||||
@@ -147,7 +151,7 @@ public class SweeperTrafficDataView extends ConstraintLayout
|
||||
@Override
|
||||
public void onLimitingVelocityChange(int limitingVelocity) {
|
||||
//设置限速
|
||||
sweeperLimitingVelocity.updateLimitingSpeed(limitingVelocity);
|
||||
sweeperLimitingVelocity.updateLimitingSpeed(limitingVelocity, 0);
|
||||
}
|
||||
};
|
||||
/**
|
||||
|
||||
@@ -90,6 +90,27 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<!--超视距-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CameraView
|
||||
android:id="@+id/ivCameraIcon"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
app:layout_constraintRight_toLeftOf="@id/viewTrafficLightVr"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!--红绿灯-->
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.SingleTrafficLightView
|
||||
android:id="@+id/viewTrafficLightVr"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/hmi_traffic_light_layout_margin_top"
|
||||
android:layout_marginEnd="@dimen/hmi_traffic_light_layout_margin_right"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/module_mogo_och_station_panel_container"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user