增加了红绿灯面板界面实现
This commit is contained in:
@@ -18,7 +18,7 @@ buildscript {
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.2'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0'
|
||||
classpath "com.alibaba:arouter-register:1.0.2"
|
||||
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
|
||||
// classpath ("com.tencent.matrix:matrix-gradle-plugin:0.6.6") { changing = true }
|
||||
|
||||
@@ -144,8 +144,8 @@ ext {
|
||||
eventbus : "org.greenrobot:eventbus:3.1.1",
|
||||
videoprocessor : "com.zhidao.video:video-processor:1.0.2.1",
|
||||
|
||||
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.1.1",
|
||||
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1",
|
||||
coroutinescore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3",
|
||||
coroutinesandroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3",
|
||||
|
||||
aspectj : "org.aspectj:aspectjrt:1.8.9",
|
||||
|
||||
|
||||
@@ -52,88 +52,88 @@ PASSWORD=xintai2018
|
||||
RELEASE=false
|
||||
# 模块版本
|
||||
## 工程内模块
|
||||
MOGO_COMMONS_VERSION=2.0.7
|
||||
MOGO_UTILS_VERSION=2.0.7
|
||||
MAP_AMAP_VERSION=2.0.7
|
||||
MAP_AUTONAVI_VERSION=2.0.7
|
||||
MOGO_MAP_VERSION=2.0.7
|
||||
MOGO_MAP_API_VERSION=2.0.7
|
||||
MOGO_SERVICE_VERSION=2.0.7
|
||||
MOGO_SERVICE_API_VERSION=2.0.8
|
||||
MOGO_CONNECTION_VERSION=2.0.7
|
||||
MOGO_MODULE_APPS_VERSION=2.0.7
|
||||
MOGO_MODULE_NAVI_VERSION=2.0.7
|
||||
MOGO_MODULE_SHARE_VERSION=2.0.7
|
||||
MOGO_MODULE_COMMON_VERSION=2.0.7
|
||||
MOGO_MODULE_MAIN_VERSION=2.0.7
|
||||
MOGO_MODULE_MAP_VERSION=2.0.7
|
||||
MOGO_MODULE_SERVICE_VERSION=2.0.7
|
||||
MOGO_MODULE_EXTENSIONS_VERSION=2.0.7
|
||||
MOGO_MODULE_SEARCH_VERSION=2.0.7
|
||||
MOGO_MODULE_BACK_VERSION=2.0.7
|
||||
MOGO_MODULE_GPS_SIMULATOR_VERSION=2.0.7
|
||||
MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=2.0.7
|
||||
MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=2.0.7
|
||||
MOGO_MODULE_AUTHORIZE_VERSION=2.0.7
|
||||
MOGO_MODULE_GUIDE_VERSION=2.0.7
|
||||
MOGO_MODULE_MEDIA_VERSION=2.0.7
|
||||
MOGO_MODULE_MAIN_LAUNCHER_VERSION=2.0.7
|
||||
MOGO_MODULE_MAIN_INDEPENDENT_VERSION=2.0.7
|
||||
MOGO_MODULE_V2X_VERSION=2.0.7
|
||||
MOGO_COMMONS_VERSION=2.0.12
|
||||
MOGO_UTILS_VERSION=2.0.12
|
||||
MAP_AMAP_VERSION=2.0.12
|
||||
MAP_AUTONAVI_VERSION=2.0.12
|
||||
MOGO_MAP_VERSION=2.0.12
|
||||
MOGO_MAP_API_VERSION=2.0.12
|
||||
MOGO_SERVICE_VERSION=2.0.12
|
||||
MOGO_SERVICE_API_VERSION=2.0.12
|
||||
MOGO_CONNECTION_VERSION=2.0.12
|
||||
MOGO_MODULE_APPS_VERSION=2.0.12
|
||||
MOGO_MODULE_NAVI_VERSION=2.0.12
|
||||
MOGO_MODULE_SHARE_VERSION=2.0.12
|
||||
MOGO_MODULE_COMMON_VERSION=2.0.12
|
||||
MOGO_MODULE_MAIN_VERSION=2.0.12
|
||||
MOGO_MODULE_MAP_VERSION=2.0.12
|
||||
MOGO_MODULE_SERVICE_VERSION=2.0.12
|
||||
MOGO_MODULE_EXTENSIONS_VERSION=2.0.12
|
||||
MOGO_MODULE_SEARCH_VERSION=2.0.12
|
||||
MOGO_MODULE_BACK_VERSION=2.0.12
|
||||
MOGO_MODULE_GPS_SIMULATOR_VERSION=2.0.12
|
||||
MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=2.0.12
|
||||
MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=2.0.12
|
||||
MOGO_MODULE_AUTHORIZE_VERSION=2.0.12
|
||||
MOGO_MODULE_GUIDE_VERSION=2.0.12
|
||||
MOGO_MODULE_MEDIA_VERSION=2.0.12
|
||||
MOGO_MODULE_MAIN_LAUNCHER_VERSION=2.0.12
|
||||
MOGO_MODULE_MAIN_INDEPENDENT_VERSION=2.0.12
|
||||
MOGO_MODULE_V2X_VERSION=2.0.12
|
||||
# 基础服务实现:passport、socket、location
|
||||
MOGO_BASE_WEBSOCKET_SDK_VERSION = 1.0.0
|
||||
MOGO_BASE_SERVICES_APK_VERSION=2.0.7
|
||||
MOGO_BASE_SERVICES_SDK_VERSION=2.0.7
|
||||
MOGO_BASE_WEBSOCKET_SDK_VERSION = 2.0.12
|
||||
MOGO_BASE_SERVICES_APK_VERSION=2.0.12
|
||||
MOGO_BASE_SERVICES_SDK_VERSION=2.0.12
|
||||
## 工程外部模块
|
||||
# 探路
|
||||
MOGO_MODULE_TANLU_VERSION=2.0.7
|
||||
MOGO_MODULE_TANLU_VERSION=2.0.12
|
||||
# 视频引导
|
||||
MOGO_MODULE_GUIDESHOW_VERSION=2.0.7
|
||||
MOGO_MODULE_GUIDESHOW_VERSION=2.0.12
|
||||
# 推送
|
||||
MOGO_MODULE_PUSH_VERSION=2.0.7
|
||||
MOGO_MODULE_PUSH_BASE_VERSION=2.0.7
|
||||
MOGO_MODULE_PUSH_NOOP_VERSION=2.0.7
|
||||
MOGO_MODULE_PUSH_VERSION=2.0.12
|
||||
MOGO_MODULE_PUSH_BASE_VERSION=2.0.12
|
||||
MOGO_MODULE_PUSH_NOOP_VERSION=2.0.12
|
||||
# 探路上报和分享模块
|
||||
TANLULIB_VERSION=2.0.7
|
||||
MOGO_TANLU_API_VERSION=2.0.7
|
||||
TANLULIB_VERSION=2.0.12
|
||||
MOGO_TANLU_API_VERSION=2.0.12
|
||||
#左侧面板模块
|
||||
MOGO_MODULE_LEFT_PANEL_VERSION=2.0.7
|
||||
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.0.7
|
||||
MOGO_MODULE_LEFT_PANEL_VERSION=2.0.12
|
||||
MOGO_MODULE_LEFT_PANEL_NOOP_VERSION=2.0.12
|
||||
# 小控件
|
||||
MOGO_MODULE_WIDGETS_VERSION=2.0.7
|
||||
MOGO_MODULE_WIDGETS_VERSION=2.0.12
|
||||
# obu
|
||||
MOGO_MODULE_OBU_VERSION=2.0.7
|
||||
MOGO_MODULE_OBU_VERSION=2.0.12
|
||||
# 皮肤
|
||||
MOGO_SKIN_SUPPORT_VERSION=2.0.7
|
||||
MOGO_SKIN_LIGHT_VERSION=2.0.7
|
||||
MOGO_SKIN_SUPPORT_IMPL_VERSION=2.0.7
|
||||
MOGO_SKIN_SUPPORT_NOOP_VERSION=2.0.7
|
||||
SKIN_SUPPORT_VERSION=2.0.7
|
||||
SKIN_SUPPORT_APPCOMPAT_VERSION=2.0.7
|
||||
SKIN_SUPPORT_CARDVIEW_VERSION=2.0.7
|
||||
SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.0.7
|
||||
SKIN_SUPPORT_DESIGN_VERSION=2.0.7
|
||||
MOGO_SKIN_SUPPORT_VERSION=2.0.12
|
||||
MOGO_SKIN_LIGHT_VERSION=2.0.12
|
||||
MOGO_SKIN_SUPPORT_IMPL_VERSION=2.0.12
|
||||
MOGO_SKIN_SUPPORT_NOOP_VERSION=2.0.12
|
||||
SKIN_SUPPORT_VERSION=2.0.12
|
||||
SKIN_SUPPORT_APPCOMPAT_VERSION=2.0.12
|
||||
SKIN_SUPPORT_CARDVIEW_VERSION=2.0.12
|
||||
SKIN_SUPPORT_CONSTRAINT_LAYOUT_VERSION=2.0.12
|
||||
SKIN_SUPPORT_DESIGN_VERSION=2.0.12
|
||||
# 闪屏页
|
||||
MOGO_MODULE_SPLASH_VERSION=2.0.7
|
||||
MOGO_MODULE_SPLASH_NOOP_VERSION=2.0.7
|
||||
MOGO_MODULE_SPLASH_VERSION=2.0.12
|
||||
MOGO_MODULE_SPLASH_NOOP_VERSION=2.0.12
|
||||
# monitor
|
||||
MOGO_MODULE_MONITOR_VERSION=2.0.7
|
||||
MOGO_MODULE_MONITOR_VERSION=2.0.12
|
||||
# bugly
|
||||
CRASHREPORT_VERSION=2.0.7
|
||||
CRASHREPORT_BUGLY_VERSION=2.0.7
|
||||
CRASHREPORT_NOOP_VERSION=2.0.7
|
||||
CRASHREPORT_VERSION=2.0.12
|
||||
CRASHREPORT_BUGLY_VERSION=2.0.12
|
||||
CRASHREPORT_NOOP_VERSION=2.0.12
|
||||
## tts
|
||||
TTS_BASE_VERSION=2.0.7
|
||||
TTS_DI_VERSION=2.0.7
|
||||
TTS_ZHI_VERSION=2.0.7
|
||||
TTS_NOOP_VERSION=2.0.7
|
||||
TTS_BASE_VERSION=2.0.12
|
||||
TTS_DI_VERSION=2.0.12
|
||||
TTS_ZHI_VERSION=2.0.12
|
||||
TTS_NOOP_VERSION=2.0.12
|
||||
# 自研地图
|
||||
MAP_CUSTOM_VERSION=1.2.1.9
|
||||
MOGO_MODULES_MVISION_VERSION=1.0.0
|
||||
MAP_CUSTOM_VERSION=2.0.12
|
||||
MOGO_MODULES_MVISION_VERSION=2.0.12
|
||||
# httpdns
|
||||
HTTPDNS_TENCENT_VERSION = 1.0.0
|
||||
HTTPDNS_BASE_VERSION = 1.0.0
|
||||
HTTPDNS_NOOP_VERSION = 1.0.0
|
||||
HTTPDNS_TENCENT_VERSION = 2.0.12
|
||||
HTTPDNS_BASE_VERSION = 2.0.12
|
||||
HTTPDNS_NOOP_VERSION = 2.0.12
|
||||
|
||||
######## 外部依赖引用
|
||||
# 车聊聊
|
||||
|
||||
@@ -39,7 +39,7 @@ dependencies {
|
||||
|
||||
implementation rootProject.ext.dependencies.androidxappcompat
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
|
||||
|
||||
// api rootProject.ext.dependencies.amapnavi3dmap
|
||||
// api rootProject.ext.dependencies.amapsearch
|
||||
|
||||
@@ -72,9 +72,9 @@ dependencies {
|
||||
kapt rootProject.ext.dependencies.aroutercompiler
|
||||
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
compileOnly rootProject.ext.dependencies.mogocommons
|
||||
compileOnly rootProject.ext.dependencies.mogomap
|
||||
compileOnly rootProject.ext.dependencies.mogoserviceapi
|
||||
implementation rootProject.ext.dependencies.mogocommons
|
||||
implementation rootProject.ext.dependencies.mogomap
|
||||
implementation rootProject.ext.dependencies.mogoserviceapi
|
||||
} else {
|
||||
implementation project(':modules:mogo-module-common')
|
||||
implementation project(':libraries:mogo-map')
|
||||
|
||||
12
modules.txt
12
modules.txt
@@ -2,12 +2,11 @@
|
||||
:skin:mogo-skin-support
|
||||
:tts:tts-base
|
||||
:tts:tts-zhi
|
||||
:tts:tts-di
|
||||
:tts:tts-noop
|
||||
:foudations:mogo-commons
|
||||
:foudations:httpdns-base
|
||||
:foudations:httpdns-noop
|
||||
:foudations:httpdns-tencent
|
||||
:foudations:mogo-commons
|
||||
:tts:tts-di
|
||||
:tts:tts-noop
|
||||
:libraries:mogo-map-api
|
||||
:skin:skin-support
|
||||
:skin:skin-support-appcompat
|
||||
@@ -17,8 +16,10 @@
|
||||
:services:mogo-service-api
|
||||
:libraries:map-amap
|
||||
:libraries:map-autonavi
|
||||
:libraries:map-custom
|
||||
:libraries:mogo-map
|
||||
:modules:mogo-module-common
|
||||
:foudations:httpdns-tencent
|
||||
:skin:mogo-skin-support-impl
|
||||
:skin:mogo-skin-support-noop
|
||||
:test:crashreport
|
||||
@@ -29,9 +30,6 @@
|
||||
:modules:mogo-module-obu
|
||||
:modules:mogo-module-map
|
||||
:modules:mogo-module-apps
|
||||
:modules:mogo-module-gps-simulator
|
||||
:modules:mogo-module-gps-simulator-debug
|
||||
:modules:mogo-module-gps-simulator-noop
|
||||
:modules:mogo-module-service
|
||||
:modules:mogo-module-authorize
|
||||
:modules:mogo-module-share
|
||||
|
||||
@@ -57,6 +57,7 @@ import com.mogo.module.extensions.utils.EntranceViewHolder;
|
||||
import com.mogo.module.extensions.utils.NoMapTopViewShaderHelper;
|
||||
import com.mogo.module.extensions.utils.TopViewAnimHelper;
|
||||
import com.mogo.module.extensions.utils.TopViewNoLinkageAnimHelper;
|
||||
import com.mogo.module.extensions.utils.TrafficLightPanelManager;
|
||||
import com.mogo.module.share.manager.ServiceApisManager;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
@@ -483,6 +484,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
TrafficLightPanelManager.getInstance().initPanel(mRootView);
|
||||
}
|
||||
|
||||
private EditText etTimes;
|
||||
@@ -494,6 +497,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mUploadRoadCondition.setVisibility(View.GONE);
|
||||
mWeatherContainer.setVisibility(View.GONE);
|
||||
mMsgContainer.setVisibility(View.GONE);
|
||||
mUserHeadImg.setVisibility(View.GONE);
|
||||
|
||||
tvExitVrMode.setVisibility(View.VISIBLE);
|
||||
TopViewAnimHelper.getInstance().enterVrMode();
|
||||
@@ -501,7 +505,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
showVrModeNaviView();
|
||||
mNaviInfo = new VrModeNavInfoView(mRootView);
|
||||
adasNoticeHelper.enterVrMode();
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().closeADAS();
|
||||
TrafficLightPanelManager.getInstance().showNavPanel();
|
||||
}
|
||||
|
||||
private void exitVrMode(){
|
||||
@@ -509,6 +513,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
tvEnterVrMode.setVisibility(View.VISIBLE);
|
||||
mMove2CurrentLocation.setVisibility(View.VISIBLE);
|
||||
mUploadRoadCondition.setVisibility(View.VISIBLE);
|
||||
mUserHeadImg.setVisibility(View.VISIBLE);
|
||||
// mWeatherContainer.setVisibility(View.VISIBLE);
|
||||
// mMsgContainer.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -518,8 +523,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
hideVrModeNaviView();
|
||||
mNaviInfo = new NaviInfoView(mRootView);
|
||||
adasNoticeHelper.exitVrMode();
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().showADAS();
|
||||
|
||||
TrafficLightPanelManager.getInstance().hideNavPanel();
|
||||
}
|
||||
|
||||
private void debugCrashWarn(){
|
||||
@@ -1220,6 +1224,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
}
|
||||
mApis.getSocketManagerApi(getContext()).unregisterOnMessageListener(SEEK_HELP_NOTICE_NUM_MSG_TYPE, seekHelpNoticeListener);
|
||||
}
|
||||
|
||||
TrafficLightPanelManager.getInstance().release();
|
||||
}
|
||||
|
||||
private void showVrModeNaviView(){
|
||||
|
||||
@@ -88,6 +88,8 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
Logger.d(TAG, "enterVrMode===" + isVrMode);
|
||||
if (!isVrMode) {
|
||||
isVrMode = true;
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().closeADAS();
|
||||
|
||||
IntentFilter filter = new IntentFilter("com.mogo.launcher.adas.app.biz");
|
||||
filter.addAction("com.mogo.launcher.adas");
|
||||
context.registerReceiver(adasReceiver, filter);
|
||||
@@ -104,6 +106,7 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
Logger.d(TAG, "退出vr模式===" + isVrMode);
|
||||
if (isVrMode) {
|
||||
isVrMode = false;
|
||||
MogoApisHandler.getInstance().getApis().getAdasControllerApi().showADAS();
|
||||
handler.removeMessages(MSG_REFRESH_CAR_STRATEGY);
|
||||
tvSelfSpeed.setVisibility(View.GONE);
|
||||
tvTrafficLight.setVisibility(View.GONE);
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.mogo.module.extensions.utils;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.view.VerticalTrafficLightView;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* 红绿灯面板管理类,控制各部分显示隐藏,同时控制限速、车速、红绿灯信息展示
|
||||
* <p>
|
||||
* 导航信息内容通过{@link com.mogo.module.extensions.navi.VrModeNavInfoView} 在{@link com.mogo.module.extensions.entrance.EntranceFragment}进行控制
|
||||
* 此处仅控制导航信息的显示与隐藏
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class TrafficLightPanelManager {
|
||||
private static final String TAG = "TrafficLightPanelManager";
|
||||
|
||||
private TrafficLightPanelManager() {
|
||||
}
|
||||
|
||||
private final static TrafficLightPanelManager INSTANCE = new TrafficLightPanelManager();
|
||||
|
||||
public static TrafficLightPanelManager getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private Group speedGroup, navGroup, extraGroup;
|
||||
private TextView tvLimitSpeed;
|
||||
private VerticalTrafficLightView turnAroundLight, turnLeftLight, straightLight, turnRightLight;
|
||||
|
||||
private boolean isInit = false;
|
||||
|
||||
public void initPanel(View root) {
|
||||
speedGroup = root.findViewById(R.id.module_ext_id_group_navi_in_vr_speed);
|
||||
navGroup = root.findViewById(R.id.module_ext_id_group_navi_in_vr_nav_info);
|
||||
extraGroup = root.findViewById(R.id.module_ext_id_group_traffic_light_panel_extra);
|
||||
tvLimitSpeed = root.findViewById(R.id.module_ext_id_tv_limit_speed);
|
||||
turnAroundLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_around);
|
||||
turnLeftLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_left);
|
||||
straightLight = root.findViewById(R.id.module_ext_id_traffic_light_straight);
|
||||
turnRightLight = root.findViewById(R.id.module_ext_id_traffic_light_turn_right);
|
||||
isInit = true;
|
||||
}
|
||||
|
||||
public void showNavPanel() {
|
||||
if (!isInit) {
|
||||
Logger.e(TAG, "nav panel 未初始化");
|
||||
return;
|
||||
}
|
||||
extraGroup.setVisibility(View.VISIBLE);
|
||||
speedGroup.setVisibility(View.VISIBLE);
|
||||
// navGroup.setVisibility(View.VISIBLE);
|
||||
tvLimitSpeed.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
public void hideNavPanel() {
|
||||
if (!isInit) {
|
||||
Logger.e(TAG, "nav panel 未初始化");
|
||||
return;
|
||||
}
|
||||
extraGroup.setVisibility(View.GONE);
|
||||
speedGroup.setVisibility(View.GONE);
|
||||
// navGroup.setVisibility(View.GONE);
|
||||
tvLimitSpeed.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public void release() {
|
||||
isInit = false;
|
||||
speedGroup = null;
|
||||
navGroup = null;
|
||||
extraGroup = null;
|
||||
tvLimitSpeed = null;
|
||||
turnAroundLight = null;
|
||||
turnLeftLight = null;
|
||||
straightLight = null;
|
||||
turnRightLight = null;
|
||||
}
|
||||
}
|
||||
@@ -54,7 +54,6 @@ public class VerticalTrafficLightView extends ConstraintLayout {
|
||||
public VerticalTrafficLightView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
LayoutInflater.from(context).inflate(R.layout.merge_vertical_traffic_light_in_vr, this);
|
||||
initView();
|
||||
TypedArray typedArray = context.getTheme().obtainStyledAttributes(attrs, R.styleable.VerticalTrafficLightView, 0, 0);
|
||||
int lightType = typedArray.getInt(R.styleable.VerticalTrafficLightView_iconRes, 0);
|
||||
typedArray.recycle();
|
||||
@@ -76,6 +75,7 @@ public class VerticalTrafficLightView extends ConstraintLayout {
|
||||
iconRes = TURN_AROUND_ICON_RES;
|
||||
break;
|
||||
}
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
@@ -84,6 +84,7 @@ public class VerticalTrafficLightView extends ConstraintLayout {
|
||||
tvLeftTime = findViewById(R.id.module_ext_id_traffic_light_left_time);
|
||||
tvLeftTimeUnit = findViewById(R.id.module_ext_id_traffic_light_left_time_unit);
|
||||
groupLeftTime = findViewById(R.id.module_ext_id_group_left_time);
|
||||
ivTrafficLight.setImageResource(iconRes[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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" />
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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"/>
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user