diff --git a/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java b/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java
index e1e70ffc01..053697ea2a 100644
--- a/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java
+++ b/OCH/taxi/driver/src/main/java/com/mogo/och/taxi/ui/BaseTaxiTabFragment.java
@@ -8,6 +8,7 @@ import android.os.Handler;
import android.os.Looper;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.ViewStub;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
diff --git a/OCH/taxi/driver/src/main/res/layout/taxi_base_fragment.xml b/OCH/taxi/driver/src/main/res/layout/taxi_base_fragment.xml
index d3588781a8..62f4f0c709 100644
--- a/OCH/taxi/driver/src/main/res/layout/taxi_base_fragment.xml
+++ b/OCH/taxi/driver/src/main/res/layout/taxi_base_fragment.xml
@@ -431,4 +431,13 @@
android:elevation="100dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />
+
+
+
+
\ No newline at end of file
diff --git a/config.gradle b/config.gradle
index 80967d1b80..1af3e24e20 100644
--- a/config.gradle
+++ b/config.gradle
@@ -238,7 +238,11 @@ ext {
handler_proxy_runtime : "com.mogo.eagle.core.handler.proxy:runtime:10.0.10",
//======================== jts-core ==============
- jts_core : "org.locationtech.jts:jts-core:1.19.0"
+ jts_core : "org.locationtech.jts:jts-core:1.19.0",
+
+ //========================= androidx-preference ====
+ preference : "androidx.preference:preference:1.2.1",
+ preference_ktx : "androidx.preference:preference-ktx:1.2.1"
]
android = [
fLauncherApplicationId : "com.mogo.launcher.f",
diff --git a/core/function-impl/mogo-core-function-hmi/build.gradle b/core/function-impl/mogo-core-function-hmi/build.gradle
index 381198ce98..2415027c8b 100644
--- a/core/function-impl/mogo-core-function-hmi/build.gradle
+++ b/core/function-impl/mogo-core-function-hmi/build.gradle
@@ -77,6 +77,8 @@ dependencies {
implementation rootProject.ext.dependencies.koomjava
implementation rootProject.ext.dependencies.koomnative
implementation rootProject.ext.dependencies.koomxhook
+ implementation rootProject.ext.dependencies.preference
+ implementation rootProject.ext.dependencies.preference_ktx
implementation rootProject.ext.dependencies.thread_opt
api project(':test:crashreport-apmbyte')
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt
index 705078d677..c2635d7e44 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiProvider.kt
@@ -2,8 +2,11 @@ package com.mogo.eagle.core.function.hmi.ui
import android.content.Context
import android.text.TextUtils
+import android.transition.Slide
+import android.util.Log
import android.view.Gravity
import android.view.ViewGroup
+import android.view.WindowManager
import androidx.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
@@ -38,6 +41,8 @@ import com.mogo.eagle.core.function.hmi.ui.notice.DispatchDialogManager
import com.mogo.eagle.core.function.hmi.ui.notice.NoticeCheckDialog
import com.mogo.eagle.core.function.hmi.ui.notice.traffic.NoticeTrafficDialog
import com.mogo.eagle.core.function.hmi.ui.setting.CameraLiveView.Companion.cameraLiveView
+import com.mogo.eagle.core.function.hmi.bone.status.fsm.FSMStatusDetailWindowManager
+import com.mogo.eagle.core.function.hmi.ui.operate.OperatePanelLayout
import com.mogo.eagle.core.function.hmi.ui.setting.StatusView
import com.mogo.eagle.core.function.hmi.ui.setting.ToolsView.Companion.toolsView
import com.mogo.eagle.core.function.hmi.ui.tools.AdUpgradeDialog
@@ -59,6 +64,8 @@ import com.zhjt.service_biz.BizConfig
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
+import me.jessyan.autosize.utils.AutoSizeUtils
+import java.lang.ref.WeakReference
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.atomic.AtomicReference
@@ -86,6 +93,8 @@ class MoGoHmiProvider : IMoGoHmiProvider {
private val xiaozhi by lazy { XiaoZhiStateManager() }
+ private val operatePanel by lazy { AtomicReference>(null) }
+
override fun init(context: Context?) {
this.context = context
}
@@ -436,4 +445,34 @@ class MoGoHmiProvider : IMoGoHmiProvider {
override fun registerToolKitDefaultItemClickListener(tag: String, listener: IToolKitItemClickListener) {
ToolKitDataManager.addListener(TAG, listener)
}
+
+ override fun toggleOperatePanel(show: Boolean) {
+ val activity = AppStateManager.currentActivity()
+ if (activity == null) {
+ Log.d(TAG, "toggleOperatePanel --- activity is null, show: $show")
+ return
+ }
+ if (show) {
+ if (operatePanel.get()?.get()?.isShowing() == true) {
+ return
+ }
+ MoGoPopWindow.Builder()
+ .attachToActivity(activity)
+ .gravityInActivity(Gravity.START or Gravity.TOP)
+ .contentView(OperatePanelLayout(activity))
+ .width(AutoSizeUtils.dp2px(activity, 1000.0f))
+ .height(WindowManager.LayoutParams.MATCH_PARENT)
+ .transition(Slide(Gravity.START), Slide(Gravity.START))
+ .onDismissed {
+ operatePanel.set(null)
+ }
+ .build()
+ .also {
+ operatePanel.set(WeakReference(it))
+ }
+ .show()
+ } else {
+ operatePanel.get()?.get()?.hide()
+ }
+ }
}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt
new file mode 100644
index 0000000000..3d8708f210
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/operate/OperatePanelLayout.kt
@@ -0,0 +1,103 @@
+package com.mogo.eagle.core.function.hmi.ui.operate
+
+import android.content.Context
+import android.os.Bundle
+import android.util.AttributeSet
+import android.util.Log
+import android.view.LayoutInflater
+import android.widget.LinearLayout
+import androidx.core.content.ContextCompat
+import androidx.preference.PreferenceFragmentCompat
+import androidx.preference.PreferenceHeaderFragmentCompat
+import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
+import com.mogo.eagle.core.function.hmi.R
+import com.mogo.eagle.core.utilcode.kotlin.onClick
+import kotlinx.android.synthetic.main.layout_operate_panel.view.iv_operate_panel_close
+
+class OperatePanelLayout: LinearLayout {
+
+ companion object {
+ private const val TAG = "OperatePanelLayout"
+ }
+
+ class PreferenceHeaderFragmentCompatImpl: PreferenceHeaderFragmentCompat() {
+
+ override fun onCreatePreferenceHeader(): PreferenceFragmentCompat {
+ Log.d(TAG, "--- onCreatePreferenceHeader ---")
+ return PreferenceHeader()
+ }
+ }
+
+ class PreferenceHeader: PreferenceFragmentCompat() {
+
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ Log.d(TAG, "PreferenceHeader --- onCreatePreferences ---")
+ setPreferencesFromResource(R.xml.operate_preference_headers, rootKey)
+ }
+ }
+
+ class V2XPreferenceFragmentCompat: PreferenceFragmentCompat() {
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ Log.d(TAG, "V2XPreferenceFragmentCompat --- onCreatePreferences ---")
+ setPreferencesFromResource(R.xml.operate_preference_details_v2x, rootKey)
+ }
+ }
+
+
+ class DemoPreferenceFragmentCompat: PreferenceFragmentCompat() {
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ Log.d(TAG, "DemoPreferenceFragmentCompat --- onCreatePreferences ---")
+ setPreferencesFromResource(R.xml.operate_preference_details_demo, rootKey)
+ }
+ }
+
+ class HdMapPreferenceFragmentCompat: PreferenceFragmentCompat() {
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ Log.d(TAG, "HdMapPreferenceFragmentCompat --- onCreatePreferences ---")
+ setPreferencesFromResource(R.xml.operate_preference_details_hdmap, rootKey)
+ }
+ }
+
+ class BusinessPreferenceFragmentCompat: PreferenceFragmentCompat() {
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ Log.d(TAG, "BusinessPreferenceFragmentCompat --- onCreatePreferences ---")
+ setPreferencesFromResource(R.xml.operate_preference_details_business, rootKey)
+ }
+ }
+
+ class MoFangPreferenceFragmentCompat: PreferenceFragmentCompat() {
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ Log.d(TAG, "MoFangPreferenceFragmentCompat --- onCreatePreferences ---")
+ setPreferencesFromResource(R.xml.operate_preference_details_mofang, rootKey)
+ }
+ }
+
+ class VehiclesPreferenceFragmentCompat: PreferenceFragmentCompat() {
+ override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
+ Log.d(TAG, "VehiclesPreferenceFragmentCompat --- onCreatePreferences ---")
+ setPreferencesFromResource(R.xml.operate_preference_details_vehicles, rootKey)
+ }
+ }
+
+ constructor(context: Context) : this(context, null)
+ constructor(context: Context, attrs: AttributeSet?) : this(context, attrs, 0)
+ constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
+ orientation = VERTICAL
+ Log.d(TAG, "--- init ----")
+ LayoutInflater.from(context).inflate(R.layout.layout_operate_panel, this, true)
+ background = ContextCompat.getDrawable(context, R.drawable.bg_operate_panel)
+ iv_operate_panel_close?.onClick {
+ CallerHmiManager.toggleOperatePanel(false)
+ }
+ }
+
+ override fun onAttachedToWindow() {
+ super.onAttachedToWindow()
+ Log.d(TAG, "--- onAttachedToWindow ---")
+ }
+
+ override fun onDetachedFromWindow() {
+ super.onDetachedFromWindow()
+ Log.d(TAG, "--- onDetachedFromWindow ---")
+ }
+}
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt
index 605fbe5b8d..4c49110a97 100644
--- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt
+++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/viewport/VisualAngleToggleView.kt
@@ -15,6 +15,7 @@ import com.mogo.eagle.core.function.angle.scenes.Default
import com.mogo.eagle.core.function.angle.scenes.LongSight
import com.mogo.eagle.core.function.api.map.angle.IMoGoVisualAngleChangeProvider
import com.mogo.eagle.core.function.api.map.angle.Scene
+import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
import com.mogo.eagle.core.function.call.map.CallerVisualAngleManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.utilcode.kotlin.scope
@@ -84,6 +85,8 @@ class VisualAngleToggleView : FrameLayout, IMoGoVisualAngleChangeProvider.OnMoGo
override fun onAnimationEnd(animation: Animator, isReverse: Boolean) {
super.onAnimationEnd(animation, isReverse)
iv_toggle_block?.isEnabled = true
+ //TODO renwj
+ CallerHmiManager.toggleOperatePanel(false)
}
})
animator.interpolator = AccelerateDecelerateInterpolator()
@@ -107,11 +110,12 @@ class VisualAngleToggleView : FrameLayout, IMoGoVisualAngleChangeProvider.OnMoGo
animator.addListener(object : AnimatorListenerAdapter() {
override fun onAnimationStart(animation: Animator, isReverse: Boolean) {
CallerVisualAngleManager.changeScene(LongSight())
-
}
override fun onAnimationEnd(animation: Animator, isReverse: Boolean) {
iv_toggle_block?.isEnabled = true
+ //TODO renwj
+ CallerHmiManager.toggleOperatePanel(true)
}
})
animator.interpolator = AccelerateDecelerateInterpolator()
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_operate_panel.webp b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_operate_panel.webp
new file mode 100644
index 0000000000..45b28c496d
Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/bg_operate_panel.webp differ
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_close.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_close.png
new file mode 100644
index 0000000000..3b50b82433
Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_close.png differ
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_rect_blue.png b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_rect_blue.png
new file mode 100644
index 0000000000..b99e3b03f5
Binary files /dev/null and b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable-xhdpi/icon_operate_panel_rect_blue.png differ
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_header.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_header.xml
new file mode 100644
index 0000000000..b6ab109307
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/drawable/bg_operate_panel_preference_header.xml
@@ -0,0 +1,10 @@
+
+
+ -
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel.xml
new file mode 100644
index 0000000000..0e11fe1a9f
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_category_title.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_category_title.xml
new file mode 100644
index 0000000000..dde2caa791
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_category_title.xml
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_checkbox_compat.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_checkbox_compat.xml
new file mode 100644
index 0000000000..18f7a152e0
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_checkbox_compat.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_header.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_header.xml
new file mode 100644
index 0000000000..a6ed4b8461
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_header.xml
@@ -0,0 +1,14 @@
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_mofang_connect.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_mofang_connect.xml
new file mode 100644
index 0000000000..18f7a152e0
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_mofang_connect.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat.xml
new file mode 100644
index 0000000000..18f7a152e0
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat_dependee.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat_dependee.xml
new file mode 100644
index 0000000000..1f8b878210
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_switch_compat_dependee.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_checkbox_compat.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_checkbox_compat.xml
new file mode 100644
index 0000000000..d1c37bea37
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_checkbox_compat.xml
@@ -0,0 +1,8 @@
+
+
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml
new file mode 100644
index 0000000000..6a19ddfa51
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_edit_with_button.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_mofang_connect.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_mofang_connect.xml
new file mode 100644
index 0000000000..6a19ddfa51
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_mofang_connect.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_radio_group_custom.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_radio_group_custom.xml
new file mode 100644
index 0000000000..6a19ddfa51
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_radio_group_custom.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_switch_compat.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_switch_compat.xml
new file mode 100644
index 0000000000..6a19ddfa51
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_widget_switch_compat.xml
@@ -0,0 +1,6 @@
+
+
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_with_title_above.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_with_title_above.xml
new file mode 100644
index 0000000000..c797f69669
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/layout/layout_operate_panel_preference_with_title_above.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_business.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_business.xml
new file mode 100644
index 0000000000..5434b6697f
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_business.xml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_demo.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_demo.xml
new file mode 100644
index 0000000000..18c28f8a88
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_demo.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_hdmap.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_hdmap.xml
new file mode 100644
index 0000000000..98ba610fb0
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_hdmap.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_mofang.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_mofang.xml
new file mode 100644
index 0000000000..0943fb476b
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_mofang.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_v2x.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_v2x.xml
new file mode 100644
index 0000000000..1bfe738a8d
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_v2x.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_vehicles.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_vehicles.xml
new file mode 100644
index 0000000000..555efa9964
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_details_vehicles.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_headers.xml b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_headers.xml
new file mode 100644
index 0000000000..409a516bdd
--- /dev/null
+++ b/core/function-impl/mogo-core-function-hmi/src/main/res/xml/operate_preference_headers.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt
index 8dadb96bc1..03a1386f87 100644
--- a/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt
+++ b/core/mogo-core-function-api/src/main/java/com/mogo/eagle/core/function/api/hmi/warning/IMoGoHmiProvider.kt
@@ -246,4 +246,9 @@ interface IMoGoHmiProvider :IProvider{
* 注册 工具箱 item点击事件监听 (默认样式item的点击事件监听,自定义样式的item的点击交给view自己处理)
*/
fun registerToolKitDefaultItemClickListener( tag: String, listener: IToolKitItemClickListener)
+
+ /**
+ * 显示/隐藏 运营面板
+ */
+ fun toggleOperatePanel(show: Boolean)
}
\ No newline at end of file
diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt
index bc06dbcb1e..31c48dbee4 100644
--- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt
+++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerHmiManager.kt
@@ -360,4 +360,11 @@ object CallerHmiManager {
fun registerToolKitDefaultItemClickListener(tag: String, listener: IToolKitItemClickListener) {
hmiProviderApi?.registerToolKitDefaultItemClickListener(tag, listener)
}
+
+ /**
+ * 显示/隐藏 运营面板
+ */
+ fun toggleOperatePanel(show: Boolean) {
+ hmiProviderApi?.toggleOperatePanel(show)
+ }
}
\ No newline at end of file
diff --git a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/floating/MoGoPopWindow.kt b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/floating/MoGoPopWindow.kt
index 9ae5092dc2..ee039b0543 100644
--- a/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/floating/MoGoPopWindow.kt
+++ b/core/mogo-core-utils/src/main/java/com/mogo/eagle/core/utilcode/floating/MoGoPopWindow.kt
@@ -4,6 +4,7 @@ import android.annotation.*
import android.app.Activity
import android.graphics.Rect
import android.graphics.drawable.ColorDrawable
+import android.transition.Transition
import android.util.Log
import android.view.Gravity
import android.view.LayoutInflater
@@ -50,6 +51,10 @@ class MoGoPopWindow private constructor(builder: Builder){
private val onViewAttachedToWindow: ((content: View) -> Unit)? = builder.onViewAttachedToWindow
+ private val enterTransition: Transition? = builder.enterTransition
+
+ private val exitTransition: Transition? = builder.exitTransition
+
@SuppressLint("ClickableViewAccessibility") fun show() {
if (isPendingShow.get() || pop.isShowing) {
return
@@ -58,12 +63,18 @@ class MoGoPopWindow private constructor(builder: Builder){
activity.lifeCycleScope.launchWhenResumed {
val parent = activity.findViewById(android.R.id.content) ?: throw AssertionError("附着的Activity上的ID为[android.R.id.content]的控件不存在.")
pop.contentView = content
- pop.isAttachedInDecor = true
+ pop.isAttachedInDecor = false
pop.setBackgroundDrawable(ColorDrawable())
content.doOnAttach {
onViewAttachedToWindow?.invoke(content)
onShowed?.invoke()
}
+ if (enterTransition != null) {
+ pop.enterTransition = enterTransition
+ }
+ if (exitTransition != null) {
+ pop.exitTransition = exitTransition
+ }
pop.setOnDismissListener {
onDismissed?.invoke()
}
@@ -113,17 +124,11 @@ class MoGoPopWindow private constructor(builder: Builder){
val oldX = params.x
val oldY = params.y
Logger.d(TAG, "oldX: $oldX, oldY: $oldY, dx: $dx, dy:$dy")
- var newX = oldX + dx
- var newY = oldY + dy
+ val newX = oldX + dx
+ val newY = oldY + dy
if (outer.contains(rawX.toInt(), rawY.toInt())) {
val width = activity.resources.displayMetrics.widthPixels
val height = activity.resources.displayMetrics.heightPixels
-// if (newX < 0) {
-// newX += newX
-// }
-// if (newY < 0) {
-// newY += height
-// }
Logger.d(TAG, "screen_width: $width, screen_height: $height, newX: $newX, newY: $newY, rawX: ${rawX.toInt()}, rawY: ${rawY.toInt()}, width: ${content.width}, height: ${content.height}")
pop.update(newX, newY, content.width, content.height)
}
@@ -244,6 +249,16 @@ class MoGoPopWindow private constructor(builder: Builder){
*/
internal var onViewAttachedToWindow: ((content: View) -> Unit)? = null
+ /**
+ * 进场动画
+ */
+ internal var enterTransition: Transition? = null
+
+ /**
+ * 出场动画
+ */
+ internal var exitTransition: Transition? = null
+
fun contentView(content: View) = apply {
this.content = content
}
@@ -296,6 +311,11 @@ class MoGoPopWindow private constructor(builder: Builder){
this.onDismissed = block
}
+ fun transition(enter: Transition?, exit: Transition?) = apply {
+ this.enterTransition = enter
+ this.exitTransition = exit
+ }
+
fun onViewAttachedToWindow(block: (content: View) -> Unit) = apply {
this.onViewAttachedToWindow = block
}