merge branch

This commit is contained in:
tongchenfei
2021-01-07 19:33:30 +08:00
77 changed files with 1349 additions and 495 deletions

View File

@@ -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();
}
}
}

View File

@@ -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;
}

View File

@@ -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");

View File

@@ -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------------");

View File

@@ -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;
}
}
}