merge branch
This commit is contained in:
@@ -839,11 +839,16 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
handler.post(() -> seekHelpGroup.setVisibility(View.GONE));
|
||||
}
|
||||
} else if (descriptor == StatusDescriptor.VR_MODE) {
|
||||
if (isTrue) {
|
||||
enterVrMode();
|
||||
} else {
|
||||
exitVrMode();
|
||||
try {
|
||||
if (isTrue) {
|
||||
enterVrMode();
|
||||
} else {
|
||||
exitVrMode();
|
||||
}
|
||||
} catch( Exception e ){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.module.extensions.view.VerticalTrafficLightView;
|
||||
|
||||
import static com.mogo.module.common.constants.TrafficLightConst.TRAFFIC_LIGHT_COLOR_GRAY;
|
||||
|
||||
/**
|
||||
* vr模式下导航信息封装
|
||||
*
|
||||
@@ -28,14 +30,14 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
private final VerticalTrafficLightView turnAroundLight, turnLeftLight, straightLight, turnRightLight;
|
||||
|
||||
private final ImageView ivTurnIcon;
|
||||
private final TextView tvDistance,tvDistanceUnit, tvNextRoad;
|
||||
private final TextView tvDistance, tvDistanceUnit, tvNextRoad;
|
||||
|
||||
private final TextView tvCurrentSpeed;
|
||||
|
||||
private final Handler handler = new Handler(this);
|
||||
|
||||
public VrModeNavInfoView(Context context) {
|
||||
this(context,null);
|
||||
this(context, null);
|
||||
}
|
||||
|
||||
public VrModeNavInfoView(Context context, AttributeSet attrs) {
|
||||
@@ -72,7 +74,7 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
}
|
||||
|
||||
public void refreshLimitSpeed(int limitSpeed) {
|
||||
if(getVisibility() != View.VISIBLE){
|
||||
if (getVisibility() != View.VISIBLE) {
|
||||
return;
|
||||
}
|
||||
handler.removeMessages(MSG_HIDE_LIMIT_SPEED);
|
||||
@@ -91,6 +93,14 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
private int[] lightArray = new int[4];
|
||||
private String[] surplusTimeArray = new String[4];
|
||||
|
||||
/**
|
||||
* 将红绿灯状态全部置灰,相当于隐藏红绿灯状态
|
||||
*/
|
||||
public void hideTrafficLightStatus() {
|
||||
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT);
|
||||
refreshTrafficLightStatus(new int[]{TRAFFIC_LIGHT_COLOR_GRAY, TRAFFIC_LIGHT_COLOR_GRAY, TRAFFIC_LIGHT_COLOR_GRAY, TRAFFIC_LIGHT_COLOR_GRAY}, new String[]{"", "", "", ""});
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新红绿灯显示状态
|
||||
*
|
||||
@@ -107,12 +117,15 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
turnRightLight.setTrafficLightStatus(laneLight[3], surplusTime[3]);
|
||||
// todo 再根据当前所在车道,置灰不需关注的灯
|
||||
|
||||
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT);
|
||||
handler.sendEmptyMessageDelayed(MSG_HIDE_TRAFFIC_LIGHT, HIDE_TRAFFIC_LIGHT_DELAY);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据所在车道,控制红绿灯展示
|
||||
*/
|
||||
public void refreshLaneStatus(){
|
||||
public void refreshLaneStatus() {
|
||||
|
||||
}
|
||||
|
||||
@@ -136,16 +149,24 @@ public class VrModeNavInfoView extends BaseNaviInfoView implements Handler.Callb
|
||||
public boolean isVisible() {
|
||||
return navGroup.getVisibility() == View.VISIBLE;
|
||||
}
|
||||
|
||||
private static final int MSG_HIDE_LIMIT_SPEED = 1001;
|
||||
private static final long HIDE_LIMIT_SPEED_DELAY = 5000;
|
||||
|
||||
private static final int MSG_HIDE_TRAFFIC_LIGHT = 1002;
|
||||
private static final long HIDE_TRAFFIC_LIGHT_DELAY = 1000;
|
||||
|
||||
@Override
|
||||
public boolean handleMessage(Message msg) {
|
||||
if (!isAttachedToWindow()||getVisibility() != View.VISIBLE) {
|
||||
if (!isAttachedToWindow() || getVisibility() != View.VISIBLE) {
|
||||
return false;
|
||||
}
|
||||
if (msg.what == MSG_HIDE_LIMIT_SPEED) {
|
||||
tvLimitSpeed.setVisibility(View.GONE);
|
||||
return true;
|
||||
} else if (msg.what == MSG_HIDE_TRAFFIC_LIGHT) {
|
||||
hideTrafficLightStatus();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -158,8 +158,9 @@ public class AdasNoticeHelper implements IMogoAdasWarnMessageCallback, IMogoLoca
|
||||
String obuLightAction = intent.getStringExtra("action");
|
||||
if ("1".equals(obuLightAction)) {
|
||||
// 隐藏红绿灯
|
||||
handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
|
||||
handler.sendEmptyMessage(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
|
||||
vrModeNavInfoView.hideTrafficLightStatus();
|
||||
// handler.removeMessages(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
|
||||
// handler.sendEmptyMessage(MSG_HIDE_TRAFFIC_LIGHT_BY_OBU);
|
||||
} else {
|
||||
// 红绿灯处理
|
||||
String data = intent.getStringExtra("data");
|
||||
|
||||
@@ -100,7 +100,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
* @param roadData
|
||||
*/
|
||||
private void addVrCameraMarker(CloudRoadData roadData) {
|
||||
Log.d(TAG, "addVrCameraMarker --lat = " + roadData.getLat() + "--lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
Log.e(TAG, "addVrCameraMarker --lat = " + roadData.getLat() + "--lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
if (!TextUtils.isEmpty(roadData.getRtmpUrl())) {
|
||||
removeCameraMarker();
|
||||
MogoMarkerOptions options = new MogoMarkerOptions()
|
||||
@@ -127,7 +127,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
* @param roadData
|
||||
*/
|
||||
private void addNormalCameraMarker(CloudRoadData roadData) {
|
||||
Log.d(TAG, "addNormalCameraMarker --lat = " + roadData.getLat() + " --lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
Log.e(TAG, "addNormalCameraMarker --lat = " + roadData.getLat() + " --lon =" + roadData.getLon() + "--uuid = " + roadData.getUuid() + "---rtmpUrl =" + roadData.getRtmpUrl());
|
||||
if (!TextUtils.isEmpty(roadData.getRtmpUrl())) {
|
||||
removeCameraMarker();
|
||||
if (mMogoMarker != null) {
|
||||
@@ -178,7 +178,7 @@ public class CameraLiveNoticeHelper implements IMogoOnWebSocketMessageListener<M
|
||||
if (TextUtils.equals(mCurrentUuid, mCloudRoadData.getUuid())) {
|
||||
if (isVrMode == isVrModeMarker) {
|
||||
// do nothing.
|
||||
Log.e(TAG, "-------------1------------");
|
||||
Log.d(TAG, "-------------1------------");
|
||||
} else {
|
||||
if (isVrMode) {
|
||||
Log.d(TAG, "-------------2------------");
|
||||
|
||||
@@ -199,6 +199,16 @@ public class TopViewAnimHelper {
|
||||
if (params == null) {
|
||||
throw new IllegalArgumentException("method addTopView params LayoutParams is null");
|
||||
}
|
||||
|
||||
if (isOuting) {
|
||||
if (motionViewCache != null) {
|
||||
motionViewCache.statusListener.beforeViewRemoveAnim(motionViewCache.view);
|
||||
motionViewCache.statusListener.onViewRemoved(motionViewCache.view);
|
||||
}
|
||||
motionViewCache = new MotionViewCache(view, params, statusListener);
|
||||
// return;
|
||||
}
|
||||
|
||||
if (!viewCaches.contains(view)) {
|
||||
// 判断此view是否已经增加到了顶部view,如果增加过就不增加了
|
||||
currentAnimatingView = view;
|
||||
@@ -278,6 +288,9 @@ public class TopViewAnimHelper {
|
||||
// 顶部view还没有内容,需要整体下移
|
||||
viewCaches.add(view);
|
||||
topContainer.addView(view, params);
|
||||
LayoutParams p = topContainer.getLayoutParams();
|
||||
p.height = params.height;
|
||||
topContainer.setLayoutParams(p);
|
||||
Logger.d(TAG, "整体进入==== view.visibility: " + view.getVisibility() + " view" +
|
||||
".position: (" + view.getX() + ", " + view.getY() + ") params.width: " + params.width + " params.height: " + params.height);
|
||||
if (statusListenerMap.get(view) != null) {
|
||||
@@ -333,6 +346,7 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
Logger.d("TopViewAnimHelper", "startTopOutAnim=====");
|
||||
if (!isTopViewOut && viewCaches.contains(view)) {
|
||||
isOuting = true;
|
||||
// 顶部view仅剩一个view,需要整体上移
|
||||
if (statusListenerMap.get(view) != null) {
|
||||
statusListenerMap.get(view).beforeViewRemoveAnim(view);
|
||||
@@ -341,7 +355,7 @@ public class TopViewAnimHelper {
|
||||
|
||||
NoMapTopViewShaderHelper.getInstance().hideShader();
|
||||
|
||||
topContainer.animate().translationY(-topContainer.getTranslationY()).setListener(mainAnimListener).start();
|
||||
topContainer.animate().translationY(0).setListener(mainAnimListener).start();
|
||||
|
||||
checkCameraModePosition(false);
|
||||
|
||||
@@ -389,6 +403,7 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
|
||||
Logger.d("TopViewAnimHelper", "hideNaviView=====");
|
||||
animNavInfoView.setTranslationY(0);
|
||||
animNavInfoView.setVisibility(View.GONE);
|
||||
vrModeNavInfoView.stopNav();
|
||||
int scene = 0;
|
||||
@@ -441,6 +456,7 @@ public class TopViewAnimHelper {
|
||||
listener.onViewRemoved(child);
|
||||
}
|
||||
}
|
||||
topContainer.setTranslationY(0);
|
||||
topContainer.removeAllViews();
|
||||
hideNaviView();
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, Scene.AIMLESS);
|
||||
@@ -496,6 +512,11 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
topContainer.removeAllViews();
|
||||
currentAnimatingView = null;
|
||||
isOuting = false;
|
||||
// if (motionViewCache != null) {
|
||||
// startTopInAnim(motionViewCache.view, motionViewCache.params, motionViewCache.statusListener);
|
||||
// motionViewCache = null;
|
||||
// }
|
||||
} else {
|
||||
listener = statusListenerMap.get(currentAnimatingView);
|
||||
if (listener != null) {
|
||||
@@ -516,4 +537,21 @@ public class TopViewAnimHelper {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private MotionViewCache motionViewCache = null;
|
||||
private boolean isOuting = false;
|
||||
|
||||
private static class MotionViewCache {
|
||||
private final View view;
|
||||
private final LayoutParams params;
|
||||
private final IMogoTopViewStatusListener statusListener;
|
||||
|
||||
public MotionViewCache(View view, LayoutParams params, IMogoTopViewStatusListener statusListener) {
|
||||
this.view = view;
|
||||
this.params = params;
|
||||
this.statusListener = statusListener;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
android:id="@+id/module_ext_id_tv_speed"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/module_ext_navi_in_vr_nav_common_margin_top"
|
||||
android:layout_marginStart="@dimen/module_ext_navi_in_vr_speed_margin_start"
|
||||
android:text="--"
|
||||
android:textColor="#fff"
|
||||
@@ -53,6 +54,8 @@
|
||||
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:layout_marginTop="@dimen/module_ext_navi_in_vr_nav_common_margin_top"
|
||||
android:layout_marginStart="@dimen/module_ext_navi_in_vr_limit_speed_margin_start"
|
||||
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_traffic_bg"
|
||||
@@ -65,6 +68,7 @@
|
||||
android:text="200"
|
||||
android:textColor="#f1f1f1"
|
||||
android:textSize="@dimen/module_ext_navi_in_vr_next_info_txt_size"
|
||||
app:layout_constraintBottom_toTopOf="@id/module_map_id_navi_next_info_road_in_vr_mode"
|
||||
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" />
|
||||
|
||||
@@ -85,6 +89,7 @@
|
||||
android:text="北三环东路辅路"
|
||||
android:textColor="#f1f1f1"
|
||||
android:textSize="@dimen/module_ext_navi_in_vr_next_info_road_txt_size"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/module_map_id_navi_next_info_road_turn_icon_in_vr_mode"
|
||||
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" />
|
||||
|
||||
@@ -94,6 +99,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/module_ext_navi_in_vr_limit_speed_margin_end"
|
||||
android:layout_marginTop="@dimen/module_ext_navi_in_vr_limit_speed_margin_top"
|
||||
android:background="@drawable/module_ext_vr_mode_limit_speed_bg"
|
||||
android:gravity="center"
|
||||
android:text="80"
|
||||
@@ -148,14 +154,14 @@
|
||||
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="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"
|
||||
tools:visibility="visible"
|
||||
tools: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,需要单独控制它的显示隐藏 -->
|
||||
|
||||
@@ -23,12 +23,13 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="12"
|
||||
android:layout_marginTop="@dimen/module_ext_navi_in_vr_traffic_light_left_time_margin_top"
|
||||
android:textColor="#fff"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
android:textSize="@dimen/module_ext_navi_in_vr_traffic_light_left_time_txt_size"
|
||||
app:layout_constraintLeft_toLeftOf="@id/module_ext_id_traffic_light_icon"
|
||||
app:layout_constraintRight_toLeftOf="@id/module_ext_id_traffic_light_left_time_unit"
|
||||
app:layout_constraintTop_toBottomOf="@id/module_ext_id_traffic_light_icon" />
|
||||
app:layout_constraintTop_toTopOf="@id/module_ext_id_traffic_light_icon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_traffic_light_left_time_unit"
|
||||
|
||||
@@ -226,18 +226,21 @@
|
||||
<dimen name="module_ext_navi_in_vr_traffic_bg_margin_bottom">60px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_text_size">100px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_unit_size">30px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_unit_margin_start">30px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_unit_margin_start">15px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_margin_start">70px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_speed_margin_top">22px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_size">78px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_margin_end">66px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_margin_top">43px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_nav_common_margin_top">23px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_margin_top">30px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_margin_start">20px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_limit_speed_text_size">40px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_bg_corner">20px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_margin_top">17px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_txt_size">36px</dimen>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_left_time_margin_top">60px</dimen>
|
||||
<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>
|
||||
<dimen name="module_ext_navi_in_vr_traffic_light_no_time_margin_top">11px</dimen>
|
||||
<dimen name="module_video_window_width_content">400px</dimen>
|
||||
<dimen name="module_video_window_height_content">300px</dimen>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user