Merge branch 'qa_1.1' into dev
# Conflicts: # app/functions/eventpanel.gradle # modules/mogo-module-extensions/src/main/java/com/mogo/module/extensions/entrance/EntranceFragment.java # modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/scenario/scene/seek/V2XSeekHelpScenario.java
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
project.dependencies {
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
d8xxImplementation rootProject.ext.dependencies.moduleventpanel
|
||||
d8xxImplementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
|
||||
d82xImplementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
em1Implementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
@@ -12,7 +12,7 @@ project.dependencies {
|
||||
f8xxImplementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
em3Implementation rootProject.ext.dependencies.moduleventpanelnoop
|
||||
} else {
|
||||
d8xxImplementation project(':modules:mogo-module-event-panel')
|
||||
d8xxImplementation project(':modules:mogo-module-event-panel-noop')
|
||||
|
||||
d82xImplementation project(':modules:mogo-module-event-panel-noop')
|
||||
em1Implementation project(':modules:mogo-module-event-panel-noop')
|
||||
|
||||
@@ -4,9 +4,11 @@ import android.content.Context;
|
||||
|
||||
import com.amap.api.services.core.AMapException;
|
||||
import com.amap.api.services.geocoder.GeocodeAddress;
|
||||
import com.amap.api.services.geocoder.GeocodeQuery;
|
||||
import com.amap.api.services.geocoder.GeocodeResult;
|
||||
import com.amap.api.services.geocoder.GeocodeSearch;
|
||||
import com.amap.api.services.geocoder.RegeocodeAddress;
|
||||
import com.amap.api.services.geocoder.RegeocodeQuery;
|
||||
import com.amap.api.services.geocoder.RegeocodeResult;
|
||||
import com.mogo.map.exception.MogoMapException;
|
||||
import com.mogo.map.impl.amap.utils.ObjectUtils;
|
||||
@@ -16,6 +18,7 @@ import com.mogo.map.search.geo.MogoGeocodeAddress;
|
||||
import com.mogo.map.search.geo.MogoRegeocodeAddress;
|
||||
import com.mogo.map.search.geo.query.MogoGeocodeQuery;
|
||||
import com.mogo.map.search.geo.query.MogoRegeocodeQuery;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -28,6 +31,8 @@ import java.util.List;
|
||||
*/
|
||||
public class GeocodeSearchClient implements IMogoGeoSearch, GeocodeSearch.OnGeocodeSearchListener {
|
||||
|
||||
private static final String TAG = "GeocodeSearchClient";
|
||||
|
||||
private GeocodeSearch mClient;
|
||||
private IMogoGeoSearchListener mListener;
|
||||
|
||||
@@ -74,14 +79,32 @@ public class GeocodeSearchClient implements IMogoGeoSearch, GeocodeSearch.OnGeoc
|
||||
@Override
|
||||
public void getFromLocationAsyn( MogoRegeocodeQuery query ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.getFromLocationAsyn( ObjectUtils.fromMogo( query ) );
|
||||
if ( query == null ) {
|
||||
Logger.e( TAG, "query parameter is null." );
|
||||
return;
|
||||
}
|
||||
RegeocodeQuery origin = ObjectUtils.fromMogo( query );
|
||||
if ( origin == null || !query.check() ) {
|
||||
Logger.e( TAG, "query parameter is null or no point parameter." );
|
||||
return;
|
||||
}
|
||||
mClient.getFromLocationAsyn( origin );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getFromLocationNameAsyn( MogoGeocodeQuery query ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.getFromLocationNameAsyn( ObjectUtils.fromMogo( query ) );
|
||||
if ( query == null ) {
|
||||
Logger.e( TAG, "query parameter is null." );
|
||||
return;
|
||||
}
|
||||
GeocodeQuery origin = ObjectUtils.fromMogo( query );
|
||||
if ( origin == null || !query.check() ) {
|
||||
Logger.e( TAG, "query parameter is null or locationName is empty." );
|
||||
return;
|
||||
}
|
||||
mClient.getFromLocationNameAsyn( origin );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.map.search.geo.query;
|
||||
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.text.TextUtils;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -29,6 +30,12 @@ public class MogoGeocodeQuery implements Parcelable {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
public boolean check(){
|
||||
if ( TextUtils.isEmpty( locationName ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
|
||||
@@ -50,6 +50,18 @@ public class MogoRegeocodeQuery implements Parcelable {
|
||||
this.poiType = poiType;
|
||||
}
|
||||
|
||||
public boolean check() {
|
||||
if ( point == null ) {
|
||||
return false;
|
||||
}
|
||||
if ( point.lat < 1 && point.lon < 1 ) {
|
||||
return false;
|
||||
}
|
||||
if ( radius < 0 ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int describeContents() {
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.mogo.module.apps.model.AppEnum;
|
||||
import com.mogo.module.apps.model.AppInfo;
|
||||
import com.mogo.module.apps.model.NavigatorApps;
|
||||
import com.mogo.module.apps.view.OnAiAssistClickListener;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.utils.AppUtils;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
|
||||
@@ -33,7 +34,9 @@ import java.util.Map;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavigatorPresenter > implements AppNavigatorView {
|
||||
public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavigatorPresenter >
|
||||
implements AppNavigatorView,
|
||||
FragmentStackTransactionListener {
|
||||
|
||||
private static final String TAG = "AppNavigatorFragment";
|
||||
|
||||
@@ -74,14 +77,17 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
|
||||
mAIAssist.performClick();
|
||||
} );
|
||||
|
||||
AppServiceHandler.getApis().getFragmentManagerApi().addMainFragmentStackTransactionListener( size -> {
|
||||
// 主页 fragment 栈变化的时候,改变动画状态
|
||||
if ( size == 0 ) {
|
||||
mAnim.start();
|
||||
} else {
|
||||
mAnim.stop();
|
||||
}
|
||||
} );
|
||||
AppServiceHandler.getApis().getFragmentManagerApi().addMainFragmentStackTransactionListener( this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransaction( int size ) {
|
||||
// 主页 fragment 栈变化的时候,改变动画状态
|
||||
if ( size == 0 ) {
|
||||
mAnim.start();
|
||||
} else {
|
||||
mAnim.stop();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -151,5 +157,6 @@ public class AppNavigatorFragment extends MvpFragment< AppNavigatorView, AppNavi
|
||||
if ( mPresenter != null ) {
|
||||
mPresenter.onDestroy( getViewLifecycleOwner() );
|
||||
}
|
||||
AppServiceHandler.getApis().getFragmentManagerApi().removeMainFragmentStackTransactionListener( this );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,7 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
|
||||
@Override
|
||||
public void onDestroy( @NonNull LifecycleOwner owner ) {
|
||||
super.onDestroy( owner );
|
||||
AppServiceHandler.getApis().getRegisterCenterApi().unregisterMogoNaviListener( TAG );
|
||||
AppServiceHandler.getApis().getIntentManagerApi().unregisterIntentListener( AppsConst.COMMAND_OPERATION, this );
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,6 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
private IMogoServiceApis mApis;
|
||||
|
||||
private IMogoCardManager mCardManager;
|
||||
private IMogoStatusManager mMogoStatusManager;
|
||||
|
||||
public AppsPresenter( AppsView view ) {
|
||||
super( view );
|
||||
@@ -71,7 +70,6 @@ public class AppsPresenter extends Presenter< AppsView > {
|
||||
} );
|
||||
|
||||
mAnalytics = mApis.getAnalyticsApi();
|
||||
mMogoStatusManager = mApis.getStatusManagerApi();
|
||||
}
|
||||
|
||||
private void renderAppsList() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
@@ -44,6 +45,7 @@ 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;
|
||||
@@ -72,7 +74,8 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
IMogoNaviListener,
|
||||
IMogoMapListener,
|
||||
IMogoAimlessModeListener,
|
||||
IMogoStatusChangedListener {
|
||||
IMogoStatusChangedListener,
|
||||
IMogoIntentListener{
|
||||
|
||||
private static final String TAG = "EntranceFragment";
|
||||
|
||||
@@ -192,7 +195,6 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
UiThreadHandler.removeCallbacks(mLockCarRunnable);
|
||||
}
|
||||
mStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
MapCenterPointStrategy.restoreLastScene( mMApUIController );
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
});
|
||||
@@ -241,23 +243,12 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
}
|
||||
});
|
||||
|
||||
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 ) );
|
||||
|
||||
mApis.getIntentManagerApi().registerIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, this);
|
||||
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(),
|
||||
@@ -355,6 +346,22 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
TopViewAnimHelper.getInstance().removeAllView();
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
if (naviinfo == null) {
|
||||
@@ -374,7 +381,8 @@ 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()) {
|
||||
@@ -575,4 +583,23 @@ public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresente
|
||||
mCameraMode.setSelected(ui == EnumMapUI.NorthUP_2D);
|
||||
mCameraMode.setText(getString(ui == EnumMapUI.NorthUP_2D ? R.string.mode_car_up : R.string.mode_north_up));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
if ( mMogoRegisterCenter != null ) {
|
||||
mMogoRegisterCenter.unregisterMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE);
|
||||
mMogoRegisterCenter.unregisterMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE);
|
||||
mMogoRegisterCenter.unregisterMogoAimlessModeListener(TAG);
|
||||
}
|
||||
if ( mStatusManager != null ) {
|
||||
mStatusManager.unregisterStatusChangedListener(TAG, StatusDescriptor.UPLOADING, this);
|
||||
mStatusManager.unregisterStatusChangedListener(TAG, StatusDescriptor.DISPLAY_OVERVIEW, this);
|
||||
}
|
||||
if ( mApis != null ) {
|
||||
if ( mApis.getIntentManagerApi() != null ) {
|
||||
mApis.getIntentManagerApi().unregisterIntentListener(AUTONAVI_STANDARD_BROADCAST_RECV, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,6 +311,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoMapUIController = null;
|
||||
mMogoFragmentManager = null;
|
||||
mServiceApis.getAdasControllerApi().release();
|
||||
Logger.d( TAG, "destroy." );
|
||||
mServiceApis.getRefreshStrategyControllerApi().clearAllData();
|
||||
AIAssist.getInstance( this ).release();
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ import androidx.annotation.Nullable;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.commons.voice.VoicePreemptType;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.V2XConst;
|
||||
import com.mogo.module.v2x.V2XServiceManager;
|
||||
import com.mogo.module.common.entity.V2XMessageEntity;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.module.v2x.scenario.IV2XScenario;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XButton;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XMarker;
|
||||
import com.mogo.module.v2x.scenario.view.IV2XWindow;
|
||||
import com.mogo.module.v2x.manager.IMoGoV2XStatusManager;
|
||||
import com.mogo.module.v2x.utils.V2XUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
|
||||
@@ -53,13 +53,27 @@ public class V2XSeekHelpScenario extends AbsV2XScenario<List<V2XMarkerEntity>> i
|
||||
|
||||
@Override
|
||||
public void init(@Nullable V2XMessageEntity<List<V2XMarkerEntity>> v2XMessageEntity) {
|
||||
setV2XMessageEntity(v2XMessageEntity);
|
||||
|
||||
mV2XMessageEntity = v2XMessageEntity;
|
||||
if (V2XServiceManager.getMoGoStatusManager().isMainPageLaunched()) {
|
||||
if (mV2XMessageEntity != null) {
|
||||
mMarkerEntity = mV2XMessageEntity.getContent();
|
||||
}
|
||||
if (!isShown) {
|
||||
setV2XWindow(new V2XSeekHelpWindow());
|
||||
setV2XMarker(new V2XSeekHelpMarker());
|
||||
} else {
|
||||
countDownFaultHelpWindowCancel();
|
||||
closeWindow();
|
||||
clearPOI();
|
||||
}
|
||||
show();
|
||||
}
|
||||
AIAssist.getInstance(V2XUtils.getApp()).speakTTSVoice("发现其他车主的求助信息");
|
||||
// 广播给ADAS和Launcher卡片
|
||||
V2XRoadEventEntity eventEntity = new V2XRoadEventEntity();
|
||||
eventEntity.setPoiType(V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "");
|
||||
eventEntity.setExpireTime(30000);
|
||||
eventEntity.setTts("发现其他车主的求助信息");
|
||||
eventEntity.setAlarmContent("其他车主求助");
|
||||
ADASUtils.broadcastToADAS(V2XServiceManager.getContext(), eventEntity);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user