修改 MAIN_PAGE_CREATED 状态值及其相关逻辑

This commit is contained in:
wangcongtao
2020-11-24 10:22:47 +08:00
parent 56bb283d86
commit 54a04f2bae
10 changed files with 14 additions and 12 deletions

View File

@@ -277,7 +277,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void onResume() {
super.onResume();
mMogoStatusManager.setMainPageResumeStatus( TAG, true );
mMogoStatusManager.setMainPageLaunchedStatus( TAG, true );
mMogoStatusManager.setMainPageIsBackgroundStatus( TAG, false );
if ( mCoverUpLayout.getVisibility() != View.VISIBLE ) {
mServiceApis.getAdasControllerApi().showADAS();
@@ -291,7 +290,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
protected void onPause() {
super.onPause();
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
mMogoStatusManager.setMainPageLaunchedStatus( TAG, false );
mServiceApis.getAuthManagerApi().dismiss();
if ( shouldCloseADASPanelWhenPause() ) {
mServiceApis.getAdasControllerApi().closeADAS();

View File

@@ -755,6 +755,10 @@ public class MogoServices implements IMogoMapListener,
return;
}
if (!mStatusManager.isMainPageOnResume()) {
return;
}
if (mStatusManager.isV2XShow()) {
return;
}

View File

@@ -41,7 +41,7 @@ public class V2XAnimationScenario extends AbsV2XScenario<V2XPushMessageEntity> {
@Override
public void init(@Nullable V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity) {
if (!isSameScenario(v2XMessageEntity)
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
boolean isV2XAnimationShow = V2XServiceManager.getMoGoV2XStatusManager().isV2XAnimationShow();
if (isV2XAnimationShow) {
close();

View File

@@ -59,7 +59,7 @@ public class V2XFatigueDrivingScenario extends AbsV2XScenario<V2XPushMessageEnti
.registerWakeCmd(V2XVoiceConstants.COMMAND_ZHIDAO_V2X_NAVI, mNaviCb)
.registerUnWakeVoice(V2XVoiceConstants.COMMAND_V2X_TO_NAVI_UN_WAKEUP, mNaviCb);
if (v2XMessageEntity.isShowState()
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
show();
}
}

View File

@@ -49,7 +49,7 @@ public class V2XPushLiveCarScenario extends AbsV2XScenario<V2XPushMessageEntity>
@Override
public void init(@Nullable V2XMessageEntity<V2XPushMessageEntity> v2XMessageEntity) {
if (!isSameScenario(v2XMessageEntity)
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
boolean isWindowShow = V2XServiceManager.getMoGoV2XStatusManager().isLeftLiveVideoShow();
if (isWindowShow) {
close();

View File

@@ -51,7 +51,7 @@ public class V2XIllegalParkScenario extends AbsV2XScenario<List<MarkerExploreWay
@Override
public void show() {
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
drawPOI();
}
showWindow();
@@ -75,7 +75,7 @@ public class V2XIllegalParkScenario extends AbsV2XScenario<List<MarkerExploreWay
v2XRoadEventEntity.setAlarmContent("违章停车");
v2XRoadEventEntity.setExpireTime(20000);
v2XRoadEventEntity.setPoiType(V2XPoiTypeEnum.ALERT_ILLEGAL_PARK);
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
v2XRoadEventEntity.setTts(markerExploreWay.getAddr() + "可能被罚违章停车,您可以说,有用或没用来帮助其它车友。");
((V2XIllegalParkWindow) getV2XWindow()).show(markerExploreWay, true);
TrackUtils.trackV2xRoadShow(markerExploreWay.getInfoId(), V2XPoiTypeEnum.ALERT_ILLEGAL_PARK, "1");

View File

@@ -51,7 +51,7 @@ public class V2XPushEventScenario extends AbsV2XScenario<V2XPushMessageEntity> i
Logger.w(MODULE_NAME, "处理推送场景:" + GsonUtil.jsonFromObject(v2XMessageEntity));
if (!isSameScenario(v2XMessageEntity)
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
setV2XMessageEntity(v2XMessageEntity);
show();
} else {

View File

@@ -96,7 +96,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_ROAD_WARNING,
getV2XMessageEntity().getContent().getNoveltyInfo());
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
showWindow();
}
@@ -197,7 +197,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario<V2XRoadEventEntity> imp
@Override
public void onViewAdded(View view) {
Logger.d(MODULE_NAME, "展示 Window 动画结束");
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
if (getV2XMessageEntity() != null && getV2XMessageEntity().isNeedAddLine() == true) {
drawPOI();
}

View File

@@ -81,7 +81,7 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
saveLocalStory(V2XMessageEntity.V2XTypeEnum.ALERT_SEEK_WARNING, mV2XPushMessageEntity);
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
if (V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
if (getV2XMessageEntity() != null &&
!V2XServiceManager.getMoGoV2XStatusManager().isOtherSeekHelpWindowShow()) {
show();

View File

@@ -51,7 +51,7 @@ public class V2XEventUgcScenario extends AbsV2XScenario<V2XRoadEventEntity> impl
setV2XMessageEntity(v2XMessageEntity);
if (v2XMessageEntity != null) {
if (v2XMessageEntity.isShowState()
&& V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
&& V2XServiceManager.getMoGoStatusManager().isMainPageOnResume()) {
show();
}
}