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