@@ -3,8 +3,14 @@ package com.mogo.eagle.core.function.hmi.ui.widget
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.widget.FrameLayout
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.module.common.constants.DataTypes
|
||||
import kotlinx.android.synthetic.main.view_perspective_switch.view.*
|
||||
|
||||
/**
|
||||
*@author xiaoyuzhou
|
||||
@@ -15,11 +21,29 @@ class PerspectiveSwitchView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0
|
||||
) : FrameLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
) : FrameLayout(context, attrs, defStyleAttr), View.OnClickListener {
|
||||
|
||||
init {
|
||||
LayoutInflater.from(context).inflate(R.layout.view_perspective_switch, this, true)
|
||||
setBackgroundResource(R.drawable.module_switch_map_bg)
|
||||
setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
//切换地图的远近视图
|
||||
if (MogoApisHandler.getInstance().apis.mapServiceApi.mapUIController.currentMapVisualAngle.isLongSight) {
|
||||
MogoApisHandler.getInstance().apis.mapServiceApi.getMarkerManager(AbsMogoApplication.getApp())
|
||||
.visibleAllMarkers()
|
||||
MogoApisHandler.getInstance().apis.mapServiceApi
|
||||
.mapUIController.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_normal)
|
||||
} else if (MogoApisHandler.getInstance().apis.mapServiceApi.mapUIController.currentMapVisualAngle.isMediumSight) {
|
||||
MogoApisHandler.getInstance().apis.mapServiceApi.getMarkerManager(AbsMogoApplication.getApp())
|
||||
.inVisibleWithoutMarkers(DataTypes.TYPE_MARKER_ADAS)
|
||||
MogoApisHandler.getInstance().apis.mapServiceApi
|
||||
.mapUIController.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null)
|
||||
textSwitch.setText(R.string.module_map_model_faster)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -61,12 +61,23 @@
|
||||
app:layout_goneMarginTop="40px"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CheckStatusView
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.PerspectiveSwitchView
|
||||
android:id="@+id/viewPerspectiveSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/module_hmi_check_left"
|
||||
android:layout_marginBottom="@dimen/dp_38"
|
||||
android:layout_marginLeft="35dp"
|
||||
android:layout_marginBottom="27dp"
|
||||
android:elevation="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<com.mogo.eagle.core.function.hmi.ui.widget.CheckStatusView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="31dp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/viewPerspectiveSwitch"
|
||||
app:layout_constraintStart_toEndOf="@+id/viewPerspectiveSwitch"
|
||||
app:layout_constraintTop_toTopOf="@+id/viewPerspectiveSwitch" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -2,20 +2,17 @@
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/module_switch_model_layout"
|
||||
android:layout_width="@dimen/module_switch_map"
|
||||
android:layout_height="@dimen/module_switch_map_height"
|
||||
android:background="@drawable/module_switch_map_bg"
|
||||
android:elevation="@dimen/dp_10"
|
||||
android:padding="@dimen/dp_20">
|
||||
android:layout_height="@dimen/module_switch_map_height">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_switch_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/module_switch_model_icon"
|
||||
android:id="@+id/iconSwitch"
|
||||
android:layout_width="@dimen/module_switch_image"
|
||||
android:layout_height="@dimen/module_switch_image"
|
||||
android:layout_gravity="left|center_vertical"
|
||||
@@ -23,7 +20,7 @@
|
||||
android:src="@drawable/module_switch_map_angle" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_switch_model_text"
|
||||
android:id="@+id/textSwitch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="right|center"
|
||||
|
||||
Reference in New Issue
Block a user