Merge branch 'feature/v2.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v2.0.0
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -3,9 +3,13 @@ package com.mogo.module.extensions.navi;
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
* 顶部view封装,用于处理手指滑动
|
||||
*/
|
||||
@@ -23,6 +27,7 @@ public class TopView extends FrameLayout {
|
||||
}
|
||||
|
||||
private OnTopViewSlideListener slideListener;
|
||||
private OnChildAddedListener childAddedListener;
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event) {
|
||||
@@ -55,10 +60,34 @@ public class TopView extends FrameLayout {
|
||||
this.slideListener = slideListener;
|
||||
}
|
||||
|
||||
public interface OnTopViewSlideListener{
|
||||
public void setChildAddedListener(OnChildAddedListener childAddedListener) {
|
||||
this.childAddedListener = childAddedListener;
|
||||
}
|
||||
|
||||
public interface OnTopViewSlideListener {
|
||||
/**
|
||||
* 监听到view上滑
|
||||
*/
|
||||
void onSlideUp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewAdded(View child) {
|
||||
super.onViewAdded(child);
|
||||
Logger.d("TopView", "onViewAdded==" + child);
|
||||
child.post(() -> {
|
||||
if (childAddedListener != null) {
|
||||
childAddedListener.onChildAdded(child);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface OnChildAddedListener {
|
||||
/**
|
||||
* 子view添加完成,但是并不确定已经绘制完成
|
||||
*
|
||||
* @param child
|
||||
*/
|
||||
void onChildAdded(View child);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.module.extensions.utils;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.os.Handler;
|
||||
import android.transition.AutoTransition;
|
||||
import android.transition.Transition;
|
||||
import android.transition.TransitionManager;
|
||||
@@ -53,6 +54,8 @@ public class TopViewAnimHelper {
|
||||
private Transition transition = new AutoTransition();
|
||||
private TextView cameraMode;
|
||||
|
||||
private Handler handler = new Handler();
|
||||
|
||||
private TopViewAnimHelper() {
|
||||
}
|
||||
|
||||
@@ -195,6 +198,7 @@ public class TopViewAnimHelper {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onAnimationRepeat(Animator animation) {
|
||||
|
||||
@@ -206,48 +210,54 @@ public class TopViewAnimHelper {
|
||||
viewCaches.add(view);
|
||||
topContainer.addView(view, params);
|
||||
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
remainDistanceGroup.setVisibility(View.GONE);
|
||||
remainTimeGroup.setVisibility(View.GONE);
|
||||
arriveTimeGroup.setVisibility(View.GONE);
|
||||
}
|
||||
topContainer.setChildAddedListener(child -> {
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
remainDistanceGroup.setVisibility(View.GONE);
|
||||
remainTimeGroup.setVisibility(View.GONE);
|
||||
arriveTimeGroup.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
constraintSet.clone(topMotionLayout);
|
||||
constraintSet.clone(topMotionLayout);
|
||||
|
||||
constraintSet.clear(R.id.module_entrance_id_top_container, ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(R.id.module_entrance_id_top_container, ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP);
|
||||
if (CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X) {
|
||||
constraintSet.clear(R.id.module_entrance_id_top_container, ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(R.id.module_entrance_id_top_container, ConstraintSet.TOP,
|
||||
R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP);
|
||||
// if (CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X) {
|
||||
TransitionManager.beginDelayedTransition(topMotionLayout, transition);
|
||||
}
|
||||
checkCameraModePosition(false);
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
// 约束设置需要在applyTo()方法之前执行,visiable设置需要在applyTo()
|
||||
// 方法之后执行才能生效,所以分开了两个判断,至于为什么这么做才能生效,不得而知
|
||||
constraintSet.connect(tvNextDistance.getId(), ConstraintSet.BOTTOM,
|
||||
ivTurnIcon.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BASELINE,
|
||||
tvNextDistance.getId(), ConstraintSet.BASELINE);
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
|
||||
R.id.module_map_id_navi_next_info_turn_info, ConstraintSet.RIGHT,
|
||||
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_46));
|
||||
}
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
ivTurnIcon.getLayoutParams().height =
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_height);
|
||||
ivTurnIcon.getLayoutParams().width =
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_width);
|
||||
naviBg.getLayoutParams().height =
|
||||
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.module_ext_navi_info_panel_small_height);
|
||||
int scene = 0;
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
scene = Scene.NAVI_WITH_ROAD_EVENT;
|
||||
} else {
|
||||
scene = Scene.AIMLESS_WITH_ROAD_EVENT;
|
||||
}
|
||||
Logger.d(TAG, "show top setMapCenterPointByScene: " + scene);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
|
||||
// }
|
||||
checkCameraModePosition(false);
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
// 约束设置需要在applyTo()方法之前执行,visiable设置需要在applyTo()
|
||||
// 方法之后执行才能生效,所以分开了两个判断,至于为什么这么做才能生效,不得而知
|
||||
constraintSet.connect(tvNextDistance.getId(), ConstraintSet.BOTTOM,
|
||||
ivTurnIcon.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.clear(tvNextRoad.getId(), ConstraintSet.BOTTOM);
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.BASELINE,
|
||||
tvNextDistance.getId(), ConstraintSet.BASELINE);
|
||||
constraintSet.connect(tvNextRoad.getId(), ConstraintSet.LEFT,
|
||||
R.id.module_map_id_navi_next_info_turn_info, ConstraintSet.RIGHT,
|
||||
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.dp_46));
|
||||
}
|
||||
constraintSet.applyTo(topMotionLayout);
|
||||
ivTurnIcon.getLayoutParams().height =
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_height);
|
||||
ivTurnIcon.getLayoutParams().width =
|
||||
(int) getDimen(R.dimen.module_ext_navi_info_panel_turn_icon_small_width);
|
||||
naviBg.getLayoutParams().height =
|
||||
(int) topMotionLayout.getContext().getResources().getDimension(R.dimen.module_ext_navi_info_panel_small_height);
|
||||
int scene = 0;
|
||||
if (naviBg.getVisibility() == View.VISIBLE) {
|
||||
scene = Scene.NAVI_WITH_ROAD_EVENT;
|
||||
} else {
|
||||
scene = Scene.AIMLESS_WITH_ROAD_EVENT;
|
||||
}
|
||||
Logger.d(TAG, "show top setMapCenterPointByScene: " + scene);
|
||||
MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene);
|
||||
});
|
||||
|
||||
// handler.post(() -> {
|
||||
//
|
||||
// });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user