增加了红绿灯面板界面实现

This commit is contained in:
tongchenfei
2020-12-10 17:59:08 +08:00
parent 089ea76a40
commit 9f7cd7eb6b
15 changed files with 277 additions and 116 deletions

View File

@@ -8,7 +8,8 @@
<gradient
android:startColor="#9C4F77D1"
android:centerColor="#68203784"
android:endColor="#68203784" />
android:endColor="#68203784"
android:angle="270"/>
<corners android:radius="@dimen/module_ext_navi_in_vr_bg_corner" />

View File

@@ -1,77 +1,112 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<View
android:id="@+id/module_ext_id_navi_in_vr_bg"
android:layout_width="@dimen/module_ext_navi_in_vr_width"
android:layout_height="@dimen/module_ext_navi_in_vr_height"
android:id="@+id/module_ext_id_navi_in_vr_bg"
android:background="@drawable/module_ext_navi_in_vr_bg"/>
android:background="@drawable/module_ext_navi_in_vr_bg" />
<View
android:id="@+id/module_ext_id_navi_in_vr_speed_bg"
android:layout_width="@dimen/module_ext_navi_in_vr_speed_bg_width"
android:layout_height="@dimen/module_ext_navi_in_vr_speed_bg_height"
android:background="@drawable/module_ext_navi_in_vr_speed_bg"
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintBottom_toBottomOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg"/>
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg" />
<View
android:id="@+id/module_ext_id_navi_in_vr_traffic_bg"
android:layout_width="@dimen/module_ext_navi_in_vr_speed_bg_width"
android:layout_height="@dimen/module_ext_navi_in_vr_traffic_bg_height"
android:layout_marginBottom="@dimen/module_ext_navi_in_vr_traffic_bg_margin_bottom"
android:background="@drawable/module_ext_navi_in_vr_traffic_bg"
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintBottom_toBottomOf="@id/module_ext_id_navi_in_vr_bg"
android:layout_marginBottom="@dimen/module_ext_navi_in_vr_traffic_bg_margin_bottom" />
<androidx.constraintlayout.widget.Group
android:id="@+id/module_ext_id_group_navi_in_vr_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="module_ext_id_tv_speed,module_ext_id_tv_speed_unit"/>
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg" />
<TextView
android:id="@+id/module_ext_id_tv_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="78"
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintBottom_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg"
android:layout_marginStart="@dimen/module_ext_navi_in_vr_speed_margin_start"
android:text="78"
android:textColor="#fff"
android:textSize="@dimen/module_ext_navi_in_vr_speed_text_size"
android:textColor="#fff" />
app:layout_constraintBottom_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg"
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg" />
<TextView
android:id="@+id/module_ext_id_tv_speed_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/module_ext_navi_in_vr_speed_unit_margin_start"
android:text="km/h"
android:textSize="@dimen/module_ext_navi_in_vr_speed_unit_size"
android:textColor="#fff"
app:layout_constraintLeft_toRightOf="@id/module_ext_id_tv_speed"
android:textSize="@dimen/module_ext_navi_in_vr_speed_unit_size"
app:layout_constraintBaseline_toBaselineOf="@id/module_ext_id_tv_speed"
android:layout_marginStart="@dimen/module_ext_navi_in_vr_speed_unit_margin_start" />
app:layout_constraintLeft_toRightOf="@id/module_ext_id_tv_speed" />
<ImageView
android:id="@+id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode"
android:layout_width="@dimen/module_ext_navi_in_vr_navi_icon_size"
android:layout_height="@dimen/module_ext_navi_in_vr_navi_icon_size"
android:src="@drawable/tc_11"
app:layout_constraintBottom_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg"
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg" />
<TextView
android:id="@+id/module_map_id_navi_next_info_distance_in_vr_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="200"
android:textColor="#f1f1f1"
android:textSize="@dimen/module_ext_navi_in_vr_next_info_txt_size"
app:layout_constraintLeft_toRightOf="@id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode"
app:layout_constraintTop_toTopOf="@id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode" />
<TextView
android:id="@+id/module_map_id_navi_next_info_distance_unit_in_vr_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="米"
android:textColor="#f1f1f1"
android:textSize="@dimen/module_ext_navi_in_vr_next_info_unit_size"
app:layout_constraintBaseline_toBaselineOf="@id/module_map_id_navi_next_info_distance_in_vr_mode"
app:layout_constraintLeft_toRightOf="@id/module_map_id_navi_next_info_distance_in_vr_mode" />
<TextView
android:id="@+id/module_map_id_navi_next_info_road_in_vr_mode"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="北三环东路辅路"
android:textColor="#f1f1f1"
android:textSize="@dimen/module_ext_navi_in_vr_next_info_road_txt_size"
app:layout_constraintLeft_toLeftOf="@id/module_map_id_navi_next_info_distance_in_vr_mode"
app:layout_constraintTop_toBottomOf="@id/module_map_id_navi_next_info_distance_in_vr_mode" />
<TextView
android:id="@+id/module_ext_id_tv_limit_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/module_ext_navi_in_vr_limit_speed_margin_end"
android:background="@drawable/module_ext_vr_mode_limit_speed_bg"
android:gravity="center"
android:text="80"
android:textColor="#FF9CA8D8"
android:gravity="center"
android:textSize="@dimen/module_ext_navi_in_vr_limit_speed_text_size"
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintBottom_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg"
android:layout_marginEnd="@dimen/module_ext_navi_in_vr_limit_speed_margin_end" />
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_bg" />
<com.mogo.module.extensions.view.VerticalTrafficLightView
android:id="@+id/module_ext_id_traffic_light_turn_around"
@@ -80,8 +115,8 @@
android:layout_marginTop="@dimen/module_ext_navi_in_vr_traffic_light_margin_top"
app:iconRes="turnAround"
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_navi_in_vr_traffic_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg"
app:layout_constraintRight_toLeftOf="@id/module_ext_id_traffic_light_turn_left"/>
app:layout_constraintRight_toLeftOf="@id/module_ext_id_traffic_light_turn_left"
app:layout_constraintTop_toTopOf="@id/module_ext_id_navi_in_vr_traffic_bg" />
<com.mogo.module.extensions.view.VerticalTrafficLightView
android:id="@+id/module_ext_id_traffic_light_turn_left"
@@ -107,10 +142,32 @@
android:layout_height="wrap_content"
app:iconRes="turnRight"
app:layout_constraintLeft_toRightOf="@id/module_ext_id_traffic_light_straight"
app:layout_constraintTop_toTopOf="@id/module_ext_id_traffic_light_straight"
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_traffic_bg" />
app:layout_constraintRight_toRightOf="@id/module_ext_id_navi_in_vr_traffic_bg"
app:layout_constraintTop_toTopOf="@id/module_ext_id_traffic_light_straight" />
<androidx.constraintlayout.widget.Group
android:id="@+id/module_ext_id_group_navi_in_vr_speed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="module_ext_id_tv_speed,module_ext_id_tv_speed_unit"
android:visibility="gone"
tools:visibility="visible" />
<androidx.constraintlayout.widget.Group
android:id="@+id/module_ext_id_group_navi_in_vr_nav_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="module_map_id_navi_next_info_road_turn_icon_in_vr_mode,module_map_id_navi_next_info_distance_in_vr_mode,module_map_id_navi_next_info_distance_unit_in_vr_mode,module_map_id_navi_next_info_road_in_vr_mode" />
<!-- 除了上面两个group以外的其他view的group方便整体控制显示隐藏不包含limitSpeed需要单独控制它的显示隐藏 -->
<androidx.constraintlayout.widget.Group
android:id="@+id/module_ext_id_group_traffic_light_panel_extra"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:constraint_referenced_ids="module_ext_id_navi_in_vr_bg,module_ext_id_navi_in_vr_speed_bg,module_ext_id_navi_in_vr_traffic_bg,module_ext_id_traffic_light_turn_left,module_ext_id_traffic_light_turn_around,module_ext_id_traffic_light_straight,module_ext_id_traffic_light_turn_right"
tools:visibility="visible" />
</merge>

View File

@@ -7,6 +7,8 @@
<androidx.constraintlayout.widget.Group
android:id="@+id/module_ext_id_group_left_time"
app:constraint_referenced_ids="module_ext_id_traffic_light_left_time,module_ext_id_traffic_light_left_time_unit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible"/>

View File

@@ -16,6 +16,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<include
layout="@layout/include_navi_in_vr"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<ImageButton
android:id="@+id/module_entrance_id_move2_current_location"
android:layout_width="@dimen/module_ext_operation_panel_width"

View File

@@ -214,6 +214,10 @@
<!-- 仅在vr模式下有此内容仅增加了xhdpi对应的大小 -->
<dimen name="module_ext_navi_in_vr_width">464px</dimen>
<dimen name="module_ext_navi_in_vr_height">304px</dimen>
<dimen name="module_ext_navi_in_vr_navi_icon_size">100px</dimen>
<dimen name="module_ext_navi_in_vr_next_info_txt_size">60px</dimen>
<dimen name="module_ext_navi_in_vr_next_info_unit_size">48px</dimen>
<dimen name="module_ext_navi_in_vr_next_info_road_txt_size">26px</dimen>
<dimen name="module_ext_navi_in_vr_speed_bg_width">458px</dimen>
<dimen name="module_ext_navi_in_vr_speed_bg_height">298px</dimen>
<dimen name="module_ext_navi_in_vr_traffic_bg_height">140px</dimen>
@@ -233,4 +237,5 @@
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_unit_size">21px</dimen>
<dimen name="module_ext_navi_in_vr_traffic_light_no_time_margin_top">21px</dimen>
</resources>