diff --git a/libraries/map-autonavi/src/main/java/com/mogo/map/impl/automap/navi/AutoNaviClient.java b/libraries/map-autonavi/src/main/java/com/mogo/map/impl/automap/navi/AutoNaviClient.java index 9a8e553254..39bd15bb19 100644 --- a/libraries/map-autonavi/src/main/java/com/mogo/map/impl/automap/navi/AutoNaviClient.java +++ b/libraries/map-autonavi/src/main/java/com/mogo/map/impl/automap/navi/AutoNaviClient.java @@ -56,7 +56,7 @@ public class AutoNaviClient implements IMogoNavi { private final Context mContext; private AutoNaviClient( Context context ) { - mContext = context; + mContext = context.getApplicationContext(); } public static AutoNaviClient getInstance( Context context ) { diff --git a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppFilterImpl.java b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppFilterImpl.java index 424749795d..7029ae106b 100644 --- a/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppFilterImpl.java +++ b/modules/mogo-module-apps/src/main/java/com/mogo/module/apps/AppFilterImpl.java @@ -5,7 +5,7 @@ import android.content.pm.PackageInfo; import android.text.TextUtils; import com.mogo.commons.AbsMogoApplication; -import com.mogo.module.common.utils.CarSeries; +import com.mogo.commons.debug.DebugConfig; import java.io.BufferedReader; import java.io.File; @@ -29,7 +29,7 @@ public class AppFilterImpl { private static List< String > sExternalConfigPackages = new ArrayList<>(); static { - if ( CarSeries.getSeries() != CarSeries.CAR_SERIES_F80X ) { + if ( !DebugConfig.getProductFlavor().startsWith( "f8" ) ) { final String[] values = AbsMogoApplication.getApp().getResources().getStringArray( R.array.module_apps_array_filter_packages ); if ( values != null ) { mFilterPackages = new ArrayList( Arrays.asList( values ) ); diff --git a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java index 56f72c9746..a70c9bfc85 100644 --- a/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java +++ b/modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java @@ -50,6 +50,7 @@ import com.mogo.module.extensions.navi.NaviInfoView; import com.mogo.module.extensions.userinfo.UserInfo; import com.mogo.module.extensions.utils.EntranceViewHolder; import com.mogo.module.extensions.utils.TopViewAnimHelper; +import com.mogo.module.extensions.utils.TopViewNoLinkageAnimHelper; import com.mogo.module.share.manager.ServiceApisManager; import com.mogo.service.IMogoServiceApis; import com.mogo.service.analytics.IMogoAnalytics; @@ -265,6 +266,7 @@ public class EntranceFragment extends MvpFragment viewCaches = new ArrayList<>(); + private Map statusListenerMap = new ArrayMap<>(); + + private View currentAnimatingView = null; + + public void addSubView(View subView, LayoutParams params, + IMogoTopViewStatusListener statusListener) { + if (isTopViewOut || topContainerNoLinkage.getChildCount() == 0) { + throw new IllegalStateException("no base view in top view"); + } + if (subView == null) { + throw new IllegalArgumentException("method addTopView params view is null"); + } + if (params == null) { + throw new IllegalArgumentException("method addTopView params LayoutParams is null"); + } + + // 是在已经添加过view之后,才能添加sub view,所以直接走增加小view的逻辑就行 + if (!viewCaches.contains(subView)) { + viewCaches.add(subView); + statusListenerMap.put(subView, statusListener); + subView.setTranslationY(0); + subView.setTranslationY(-(params.height)); + topContainerNoLinkage.addView(subView, params); + Logger.d(TAG, "添加subView: " + subView.getTranslationY() + " height:" + + " " + subView.getHeight() + " paramsHeight: " + params.height); + if (statusListenerMap.get(subView) != null) { + statusListenerMap.get(subView).beforeViewAddAnim(subView); + } + subView.animate().translationY(0).setDuration(500).setListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + + } + + @Override + public void onAnimationEnd(Animator animation) { + IMogoTopViewStatusListener listener = statusListenerMap.get(subView); + if (listener != null) { + listener.onViewAdded(subView); + } + } + + @Override + public void onAnimationCancel(Animator animation) { + + } + + + @Override + public void onAnimationRepeat(Animator animation) { + + } + }).start(); + } + + } + + public void removeSubView(View subView) { + if (topContainerNoLinkage.getChildCount() < 2) { + throw new IllegalStateException("view count not enough"); + } + Logger.d(TAG, + "小view退出: " + subView.getTranslationY() + " height: " + subView.getHeight()); + if (statusListenerMap.get(subView) != null) { + statusListenerMap.get(subView).beforeViewRemoveAnim(subView); + } + subView.animate().translationY(-(subView.getHeight())).setDuration(500).setListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + + } + + @Override + public void onAnimationEnd(Animator animation) { + Logger.d(TAG, "onAnimationEnd: " + subView); + viewCaches.remove(subView); + topContainerNoLinkage.removeView(subView); + IMogoTopViewStatusListener listener = statusListenerMap.remove(subView); + if (listener != null) { + listener.onViewRemoved(subView); + } else { + Logger.d(TAG, "listener is null"); + } + } + + @Override + public void onAnimationCancel(Animator animation) { + viewCaches.remove(subView); + topContainerNoLinkage.removeView(subView); + } + + @Override + public void onAnimationRepeat(Animator animation) { + + } + }).start(); + } + + public void startTopInAnim(View view, LayoutParams params, + IMogoTopViewStatusListener statusListener) { + + if (topMotionLayout == null) { + return; + } + + Logger.d(TAG, "startTopInAnim=====" + isTopViewOut); + if (view == null) { + throw new IllegalArgumentException("method addTopView params view is null"); + } + if (params == null) { + throw new IllegalArgumentException("method addTopView params LayoutParams is null"); + } + if (!viewCaches.contains(view)) { + // 判断此view是否已经增加到了顶部view,如果增加过就不增加了 + view.setTranslationY(0); + statusListenerMap.put(view, statusListener); + Logger.d(TAG, "开始执行"); + isTopViewOut = false; + if (topContainerNoLinkage.getChildCount() > 0) { + // 顶部view已经有了内容,新增内容无需整体布局变化,只是新增布局加个动画 + viewCaches.add(view); + + // 生硬的删掉之前的view + int lastCount = topContainerNoLinkage.getChildCount(); + Logger.d(TAG, "进入动画,lastCount: " + lastCount); + for (int i = 0; i < lastCount; i++) { + View lastView = topContainerNoLinkage.getChildAt(i); + if (statusListenerMap.get(lastView) != null) { + statusListenerMap.get(lastView).beforeViewRemoveAnim(lastView); + } + viewCaches.remove(lastView); + if (statusListenerMap.get(lastView) != null) { + statusListenerMap.remove(lastView).onViewRemoved(lastView); + } + } + Logger.d(TAG, "生硬的删掉了之前的view: " + viewCaches.size()); + topContainerNoLinkage.removeAllViews(); + // 同时设置一下隐藏状态 + MogoApisHandler.getInstance().getApis().getStatusManagerApi().setTopViewShow(ExtensionsModuleConst.TYPE_ENTRANCE, false); + + // 如果高度变化,生硬的变化一下高度 + Logger.d(TAG, "container.height: " + topContainerNoLinkage.getHeight()); + if (topContainerNoLinkage.getHeight() != params.height) { + constraintSet.clone(topMotionLayout); + LayoutParams p = topContainerNoLinkage.getLayoutParams(); + p.height = params.height; + topContainerNoLinkage.setLayoutParams(p); + constraintSet.connect(naviBg.getId(), ConstraintSet.TOP, + R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP, + computeNaviMarginTop(params.height)); + constraintSet.applyTo(topMotionLayout); + Logger.d(TAG, "改变container的高度==="); + } + + view.setTranslationY(-(params.height)); + topContainerNoLinkage.addView(view, params); + Logger.d(TAG, "顶部view已经有布局了,增加新增view滑入动画: " + view.getTranslationY() + " height:" + + " " + view.getHeight() + " paramsHeight: " + params.height); + if (statusListenerMap.get(view) != null) { + statusListenerMap.get(view).beforeViewAddAnim(view); + } + view.animate().translationY(0).setDuration(500).setListener(new Animator.AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + + } + + @Override + public void onAnimationEnd(Animator animation) { + IMogoTopViewStatusListener listener = statusListenerMap.get(view); + if (listener != null) { + listener.onViewAdded(view); + } + } + + @Override + public void onAnimationCancel(Animator animation) { + + } + + + @Override + public void onAnimationRepeat(Animator animation) { + + } + }).start(); + } else { + // 顶部view还没有内容,需要整体下移 + currentAnimatingView = view; + viewCaches.add(view); + topContainerNoLinkage.addView(view, params); + 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) { + statusListenerMap.get(view).beforeViewAddAnim(view); + } + topContainerNoLinkage.setChildAddedListener(child -> { + topContainerNoLinkage.setChildAddedListener(null); + constraintSet.clone(topMotionLayout); + + constraintSet.clear(R.id.module_entrance_id_top_container_no_linkage, + ConstraintSet.BOTTOM); + constraintSet.connect(R.id.module_entrance_id_top_container_no_linkage, ConstraintSet.TOP, + R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP); + TransitionManager.beginDelayedTransition(topMotionLayout, transition); + checkCameraModePosition(false); + + constraintSet.applyTo(topMotionLayout); + + int scene = Scene.AIMLESS_WITH_ROAD_EVENT; + Logger.d(TAG, "show top setMapCenterPointByScene: " + scene); + MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene); + }); + } + } + + MogoApisHandler.getInstance().getApis().getStatusManagerApi().setTopViewShow(ExtensionsModuleConst.TYPE_ENTRANCE, true); + } + + /** + * 退出最新的(也就是最上面的)view + */ + private void startLatestTopOutAnim() { + if (topContainerNoLinkage.getChildCount() > 1) { + removeSubView(topContainerNoLinkage.getChildAt(topContainerNoLinkage.getChildCount() - 1)); + } else if (topContainerNoLinkage.getChildCount() > 0) { + startTopOutAnim(topContainerNoLinkage.getChildAt(topContainerNoLinkage.getChildCount() - 1)); + } + } + + public void startTopOutAnim(View view) { + if (topMotionLayout == null) { + return; + } + Logger.d(TAG, "startTopOutAnim====="); + if (!isTopViewOut && viewCaches.contains(view)) { + // 顶部view仅剩一个view,需要整体上移 + if (statusListenerMap.get(view) != null) { + statusListenerMap.get(view).beforeViewRemoveAnim(view); + } + isTopViewOut = true; + constraintSet.clone(topMotionLayout); + + constraintSet.clear(R.id.module_entrance_id_top_container_no_linkage, ConstraintSet.TOP); + constraintSet.connect(R.id.module_entrance_id_top_container_no_linkage, ConstraintSet.BOTTOM, + R.id.module_entrance_id_top_motion_layout, ConstraintSet.TOP); + TransitionManager.beginDelayedTransition(topMotionLayout, transition); + checkCameraModePosition(false); + + constraintSet.applyTo(topMotionLayout); + + int scene = Scene.AIMLESS; + Logger.d(TAG, "hide top setMapCenterPointByScene: " + scene); + MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene); + MogoApisHandler.getInstance().getApis().getStatusManagerApi().setTopViewShow(ExtensionsModuleConst.TYPE_ENTRANCE, false); + } + } + + public void hideNaviView() { + if (topMotionLayout == null) { + return; + } + + Logger.d(TAG, "hideNaviView====="); + setNaviVisibility(View.GONE); + remainDistanceGroup.setVisibility(View.GONE); + remainTimeGroup.setVisibility(View.GONE); + arriveTimeGroup.setVisibility(View.GONE); + int scene = 0; + if (isTopViewOut) { + scene = Scene.AIMLESS; + } else { + scene = Scene.AIMLESS_WITH_ROAD_EVENT; + } + Logger.d(TAG, "hide navi setMapCenterPointByScene: " + scene); + MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, scene); + checkCameraModePosition(true); + } + + private void checkCameraModePosition(boolean isNeedClone) { + if (isNeedClone) { + constraintSet.clone(topMotionLayout); + } + if (naviBg.getVisibility() == View.VISIBLE) { + constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP, naviBg.getId(), + ConstraintSet.BOTTOM, (int) getDimen(R.dimen.dp_30)); + } else { + if (isTopViewOut) { + constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP, naviBg.getId(), + ConstraintSet.BOTTOM, + (int) getDimen(R.dimen.module_ext_north_goneMarginTop)); + } else { + constraintSet.connect(cameraMode.getId(), ConstraintSet.TOP, + R.id.module_entrance_id_top_container_no_linkage, + ConstraintSet.BOTTOM, + (int) getDimen(R.dimen.dp_30)); + } + } + if (isNeedClone) { + constraintSet.applyTo(topMotionLayout); + } + } + + private float getDimen(int resId) { + return (int) topMotionLayout.getContext().getResources().getDimensionPixelSize(resId); + } + + private int computeNaviMarginTop(int height) { + int result = (int) (height - (getDimen(R.dimen.module_ext_top_over_navi_height)) - getDimen(R.dimen.module_common_shadow_width_pos)); + Logger.d(TAG, "computeNaviMarginTop: " + height + " result: " + result); + return result; + } + + interface OnTopViewAnimSimpleListener { + void onAnimStart(); + + void onAnimEnd(); + } + + public boolean isViewAdded(View view) { + return viewCaches.contains(view); + } + + private void setNaviVisibility(int visibility) { + ivTurnIcon.setVisibility(visibility); + tvNextRoad.setVisibility(visibility); + tvNextDistance.setVisibility(visibility); + remainTimeGroup.setVisibility(visibility); + remainDistanceGroup.setVisibility(visibility); + arriveTimeGroup.setVisibility(visibility); + naviBg.setVisibility(visibility); + tvNextDistanceUnit.setVisibility(visibility); + tvTurnInfo.setVisibility(visibility); + } + + public void removeAllView() { + Logger.d(TAG, "remove all view"); + isTopViewOut = true; + int lastCount = topContainerNoLinkage.getChildCount(); + for (int i = 0; i < lastCount; i++) { + View child = topContainerNoLinkage.getChildAt(i); + viewCaches.remove(child); + IMogoTopViewStatusListener listener = statusListenerMap.remove(child); + if (listener != null) { + listener.beforeViewRemoveAnim(child); + listener.onViewRemoved(child); + } + } + topContainerNoLinkage.removeAllViews(); + hideNaviView(); + MapCenterPointStrategy.setMapCenterPointByScene(mogoMapUIController, Scene.AIMLESS); + } + + public void clear() { + topMotionLayout = null; + remainTimeGroup = null; + remainDistanceGroup = null; + arriveTimeGroup = null; + naviBg = null; + ivTurnIcon = null; + tvNextDistance = null; + tvNextRoad = null; + tvNextDistanceUnit = null; + tvTurnInfo = null; + topContainerNoLinkage = null; + cameraMode = null; + transition = null; + } +} diff --git a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml index 5e92507d0d..97b5c3903e 100644 --- a/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml +++ b/modules/mogo-module-extensions/src/main/res/layout/module_ext_layout_entrance.xml @@ -64,6 +64,8 @@ app:layout_goneMarginTop="@dimen/module_ext_north_goneMarginTop" tools:visibility="visible" /> + + + + + @Override public void init(@Nullable V2XMessageEntity v2XMessageEntity) { - boolean isWindowShow = V2XServiceManager.getMoGoV2XStatusManager().isLeftLiveVideoShow(); - if (isWindowShow) { - close(); - } - setV2XMessageEntity(v2XMessageEntity); - if (v2XMessageEntity != null && - (v2XMessageEntity.getContent().getVideoSn() != null || - !TextUtils.isEmpty(v2XMessageEntity.getContent().getVideoUrl()))) { - show(); + if (!isSameScenario(v2XMessageEntity) + && V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) { + boolean isWindowShow = V2XServiceManager.getMoGoV2XStatusManager().isLeftLiveVideoShow(); + if (isWindowShow) { + close(); + } + setV2XMessageEntity(v2XMessageEntity); + if (v2XMessageEntity != null && + (v2XMessageEntity.getContent().getVideoSn() != null || + !TextUtils.isEmpty(v2XMessageEntity.getContent().getVideoUrl()))) { + show(); + } else { + TipToast.shortTip("附近没有可直播车机"); + Logger.e(V2XConst.MODULE_NAME, "直播地址为null"); + } } else { - TipToast.shortTip("附近没有可直播车机"); - Logger.e(V2XConst.MODULE_NAME, "直播地址为null"); + setV2XMessageEntity(v2XMessageEntity); + Logger.w(V2XConst.MODULE_NAME, "要处理的场景已经存在,丢弃这次初始化"); } -// if (!isSameScenario(v2XMessageEntity) -// && V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) { -// } else { -// setV2XMessageEntity(v2XMessageEntity); -// Logger.w(V2XConst.MODULE_NAME, "要处理的场景已经存在,丢弃这次初始化"); -// } } @Override @@ -77,21 +77,16 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario @Override public void showWindow() { if (getV2XWindow() != null) { -// ViewGroup.LayoutParams layoutParams = -// new ViewGroup.LayoutParams( -// ViewGroup.LayoutParams.MATCH_PARENT, -// (int) V2XUtils.getApp().getResources().getDimension(R.dimen.module_v2x_event_window_height)); -// V2XServiceManager -// .getMogoTopViewManager() -// .addView(getV2XWindow().getView(), layoutParams, this); -// getV2XWindow().show(getV2XMessageEntity().getContent()); -// V2XServiceManager.getMoGoV2XStatusManager().setLiveCarWindowShow(TAG, true); - + ViewGroup.LayoutParams layoutParams = + new ViewGroup.LayoutParams( + ViewGroup.LayoutParams.MATCH_PARENT, + (int) V2XUtils.getApp().getResources() + .getDimension(R.dimen.v2x_video_window_height)); V2XServiceManager - .getIMogoWindowManager() - .addView(getV2XWindow().getView(), 0, 0, false); + .getMogoTopViewManager() + .addViewNoLinkage(getV2XWindow().getView(), layoutParams, this); getV2XWindow().show(getV2XMessageEntity().getContent()); - V2XServiceManager.getMoGoV2XStatusManager().setV2XAnimationWindowShow(TAG, true); + V2XServiceManager.getMoGoV2XStatusManager().setLiveCarWindowShow(TAG, true); } } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarWindow.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarWindow.java index 0b31e6ca8c..5943f0d32a 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarWindow.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/livecar/V2XPushLiveCarWindow.java @@ -70,8 +70,8 @@ public class V2XPushLiveCarWindow extends RelativeLayout implements IV2XWindow { //移除窗体 V2XServiceManager - .getIMogoWindowManager() - .removeView(this); + .getMogoTopViewManager() + .removeViewNoLinkage(this); }); } @@ -144,8 +144,8 @@ public class V2XPushLiveCarWindow extends RelativeLayout implements IV2XWindow v2XRoadEventEntity = v2XMessageEntity.getContent(); if (v2XRoadEventEntity != null) { - if (!isSameScenario(v2XMessageEntity) - && V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) { + if (v2XMessageEntity.isShowState()) { mV2XRoadLiveCarScenario.setV2XWindow(new V2XRoadLiveCarWindow()); setV2XMessageEntity(v2XMessageEntity); show(); } else { - setV2XMessageEntity(v2XMessageEntity); - Logger.w(V2XConst.MODULE_NAME, "要处理的场景已经存在,丢弃这次初始化"); + close(); } - - } else { - close(); - } } catch (Exception e) { e.printStackTrace(); @@ -78,11 +73,16 @@ public class V2XRoadLiveCarScenario extends AbsV2XScenario + android:layout_height="wrap_content" + android:background="@drawable/v2x_alert_window_bg" + android:clipToPadding="false"> + app:layout_constraintTop_toTopOf="parent" + app:roundLayoutRadius="@dimen/dp_30" /> + + android:layout_height="@dimen/v2x_video_window_height_content" + android:clipToPadding="false"> 460px + 464px 474px - + diff --git a/modules/mogo-module-v2x/src/main/res/values-mdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-mdpi/dimens.xml index f3a326f52a..33f9e7b3ae 100644 --- a/modules/mogo-module-v2x/src/main/res/values-mdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-mdpi/dimens.xml @@ -106,6 +106,7 @@ 460px + 464px 474px diff --git a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml index f3f01b22e6..8968abfbcb 100644 --- a/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml +++ b/modules/mogo-module-v2x/src/main/res/values-xhdpi/dimens.xml @@ -103,6 +103,7 @@ 830px + 664px 674px diff --git a/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoTopViewManager.java b/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoTopViewManager.java index 81e7550c91..f76f75b384 100644 --- a/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoTopViewManager.java +++ b/services/mogo-service-api/src/main/java/com/mogo/service/windowview/IMogoTopViewManager.java @@ -42,6 +42,40 @@ public interface IMogoTopViewManager extends IProvider { void addView(View view, ViewGroup.LayoutParams params, IMogoTopViewStatusListener statusListener); + + /** + * 在1/2屏添加一个view,如果没显示,会有动画 + * 给了一个默认的LayoutParams(MatchParent,dp_350) + * + * @param view 增加的view + */ + void addViewNoLinkage(View view); + + /** + * 在1/2屏添加一个view,如果没显示,会有动画,可通过设置监听,来监听增加的view的状态 + * 给了一个默认的LayoutParams(MatchParent,dp_350) + * + * @param statusListener 状态监听 + * @param view 增加的view + */ + void addViewNoLinkage(View view, IMogoTopViewStatusListener statusListener); + + /** + * 在1/2屏添加一个view,如果没显示,会有动画 + * @param view 增加的view + * @param params 相关参数 + */ + void addViewNoLinkage(View view, ViewGroup.LayoutParams params); + + /** + * 在1/2屏添加一个view,如果没显示,会有动画,可通过设置监听,来监听增加的view的状态,与其他控件没有联动 + * @param view 增加的view + * @param params 相关参数 + * @param statusListener 状态监听 + */ + void addViewNoLinkage(View view, ViewGroup.LayoutParams params, + IMogoTopViewStatusListener statusListener); + /** * 在1/2屏添加一个sub view,叠加在主view上面显示 * 给了一个默认的LayoutParams(MatchParent,dp_350) @@ -65,6 +99,12 @@ public interface IMogoTopViewManager extends IProvider { */ void removeView(View view); + /** + * 移除view,如果是最后一个view,会有移除动画 + * @param view 待移除的 view + */ + void removeViewNoLinkage(View view); + /** * 移除sub view * @param view 待移除的sub view @@ -77,4 +117,11 @@ public interface IMogoTopViewManager extends IProvider { * @return true-已经添加 false-未添加 */ boolean isViewAdded(View view); + + /** + * 这个view是否已经被添加进了顶部布局 + * @param view 待查询的view + * @return true-已经添加 false-未添加 + */ + boolean isViewNoLinkageAdded(View view); }