解决高德地图因为10021广播关闭程序,导致桌面导航信息栏无法消失的问题。

This commit is contained in:
wangcongtao
2020-07-29 19:21:05 +08:00
2 changed files with 22 additions and 37 deletions

View File

@@ -1,6 +1,5 @@
package com.mogo.module.extensions.entrance;
import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
import android.text.TextUtils;
@@ -45,7 +44,6 @@ import com.mogo.service.MogoServicePaths;
import com.mogo.service.analytics.IMogoAnalytics;
import com.mogo.service.entrance.ButtonIndex;
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
import com.mogo.service.intent.IMogoIntentListener;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoRegisterCenter;
import com.mogo.service.statusmanager.IMogoStatusChangedListener;
@@ -240,34 +238,25 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
} else {
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
}
// mCameraMode.setSelected(!mCameraMode.isSelected());
// mCameraMode.setText(getString(mCameraMode.isSelected() ? R.string.mode_car_up :
// R.string.mode_north_up));
});
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV,
new IMogoIntentListener() {
@Override
public void onIntentReceived(String intentStr, Intent intent) {
int key_type = intent.getIntExtra("KEY_TYPE", 0);
int type = intent.getIntExtra("EXTRA_TYPE", -1);
int opera_type = intent.getIntExtra("EXTRA_OPERA", -1);
if (key_type == 10027) {
if (opera_type == 0) {
mCameraMode.setSelected(false);
} else if (opera_type == 1) {
mCameraMode.setSelected(true);
}
mCameraMode.setText(getString(mCameraMode.isSelected() ?
R.string.mode_car_up : R.string.mode_north_up));
}
}
});
MogoEntranceButtons.save(ButtonIndex.BUTTON1,
findViewById(R.id.module_entrance_id_button1));
MogoEntranceButtons.save(ButtonIndex.BUTTON2,
findViewById(R.id.module_entrance_id_button2));
mApis.getIntentManagerApi().registerIntentListener( AUTONAVI_STANDARD_BROADCAST_RECV, (( intentStr, intent ) -> {
int key_type = intent.getIntExtra( "KEY_TYPE", 0 );
int type = intent.getIntExtra( "EXTRA_TYPE", -1 );
int opera_type = intent.getIntExtra( "EXTRA_OPERA", -1 );
if ( key_type == 10027 ) {
if ( opera_type == 0 ) {
mCameraMode.setSelected( false );
} else if ( opera_type == 1 ) {
mCameraMode.setSelected( true );
}
mCameraMode.setText( getString( mCameraMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up ) );
} else if( key_type == 10021 ){
onStopNavi();
}
}) );
MogoEntranceButtons.save( ButtonIndex.BUTTON1, findViewById( R.id.module_entrance_id_button1 ) );
MogoEntranceButtons.save( ButtonIndex.BUTTON2, findViewById( R.id.module_entrance_id_button2 ) );
mDisplayOverviewBounds = new Rect(
ResourcesHelper.getDimensionPixelSize(getContext(),
@@ -312,8 +301,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
// 埋点
final Map<String, Object> properties = new HashMap<>();
properties.put("type", 3);
ServiceApisManager.serviceApis.getAnalyticsApi().track("Launcher_APP_Icon",
properties);
ServiceApisManager.serviceApis.getAnalyticsApi().track("Launcher_APP_Icon", properties);
} catch (Exception e) {
Logger.e(TAG, e, "打开个人中心Exception");
}
@@ -321,8 +309,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
mUserHeadImg.setVisibility(DebugConfig.isLauncher() ? View.VISIBLE : View.GONE);
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload,
mStatusManager);
mUploadButtonAnimatorController = new UploadButtonAnimatorController(mUploading, mUpload, mStatusManager);
debugTopView();
}
@@ -333,8 +320,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
traceData("1");
}
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
"AUTONAVI_STANDARD_BROADCAST_RECV";
private static final String AUTONAVI_STANDARD_BROADCAST_RECV = "AUTONAVI_STANDARD_BROADCAST_RECV";
@NonNull
@Override
@@ -389,8 +375,7 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
TopViewAnimHelper.getInstance().showNaviView();
mMApUIController.changeMapMode(mCameraMode.isSelected() ? EnumMapUI.NorthUP_2D :
EnumMapUI.CarUp_2D);
MapCenterPointStrategy.setMapCenterPointBySceneAndDelay(mMApUIController, Scene.NAVI, 500
, () -> {
MapCenterPointStrategy.setMapCenterPointBySceneAndDelay(mMApUIController, Scene.NAVI, 500, () -> {
return !mMogoNavi.isNaviing();
});
if (CustomNaviInterrupter.getInstance().interrupt()) {

View File

@@ -112,7 +112,6 @@ public class MapPresenter extends Presenter< MapView > implements
} else if ( type == 1 ) {
zoomMap( opera_type == 0 );
} else if ( type == 2 ) {
// mMogoIntentManager.invoke( AUTONAVI_STANDARD_BROADCAST_RECV, intent );
onChangeCameraMode( opera_type );
}
} else if ( key_type == 10048 ) {
@@ -183,6 +182,7 @@ public class MapPresenter extends Presenter< MapView > implements
mMogoMapService.getNavi( getContext() ).reCalculateRoute( config );
}
mMogoIntentManager.invoke( AUTONAVI_STANDARD_BROADCAST_RECV, intent );
}
};