Merge branch 'feature/v1.0.3' of http://gitlab.zhidaoauto.com/ecos/yycp-service/Launcher into feature/v1.0.3
This commit is contained in:
@@ -83,6 +83,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
|
||||
// 自定义定位源的回调信息,前瞻线
|
||||
private LocationSource.OnLocationChangedListener mOnLocationChangedListener;
|
||||
private boolean mIsCarLockced = false;
|
||||
|
||||
public AMapNaviViewWrapper( AMapNaviView mapView ) {
|
||||
this.mMapView = mapView;
|
||||
@@ -334,6 +335,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
Logger.d( TAG, "lock status = %s", isLock );
|
||||
mIsCarLockced = isLock;
|
||||
Trace.beginSection( "timer.onCameraChangeFinish" );
|
||||
MogoMapListenerHandler.getInstance().onLockMap( isLock );
|
||||
Trace.endSection();
|
||||
@@ -799,4 +801,9 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
mOnLocationChangedListener.onLocationChanged( location );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized boolean isCarLocked() {
|
||||
return mIsCarLockced;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,9 +53,10 @@ public class BnHooker implements InvocationHandler {
|
||||
@Override
|
||||
public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable {
|
||||
if ( method.getName().equals( "setRenderFps" ) ) {
|
||||
Logger.d( TAG, "setRenderFps" );
|
||||
if ( !NaviClient.getInstance( mContext ).isNaviing() ) {
|
||||
return method.invoke( host, 10 );
|
||||
}
|
||||
return method.invoke( host, 10 );
|
||||
}
|
||||
if ( method.getName().equals( "drawFrame" ) ) {
|
||||
Logger.d( TAG, "drawFrame" );
|
||||
|
||||
@@ -241,4 +241,12 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
mClient.changeMyLocation( location );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCarLocked() {
|
||||
if ( mClient != null ) {
|
||||
return mClient.isCarLocked();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,4 +180,10 @@ public interface IMogoMapUIController {
|
||||
* @return
|
||||
*/
|
||||
EnumMapUI getCurrentUiMode();
|
||||
|
||||
/**
|
||||
* 锁车状态
|
||||
* @return
|
||||
*/
|
||||
boolean isCarLocked();
|
||||
}
|
||||
|
||||
@@ -234,4 +234,12 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
mDelegate.changeMyLocation( location );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCarLocked() {
|
||||
if ( mDelegate != null ) {
|
||||
return mDelegate.isCarLocked();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class AppNavigatorFragment extends MvpFragment<AppNavigatorView, AppNavig
|
||||
private IMogoAnalytics mMogoAnalytics;
|
||||
private DiscreteScrollView scroller;
|
||||
|
||||
private static final int CARD_SIZE = 6;
|
||||
private static int CARD_SIZE = 6;
|
||||
private AppIndicatorAdapter appIndicatorAdapter;
|
||||
|
||||
@Override
|
||||
@@ -84,6 +84,7 @@ public class AppNavigatorFragment extends MvpFragment<AppNavigatorView, AppNavig
|
||||
scroller.addScrollStateChangeListener(this);
|
||||
//scroller.setItemTransitionTimeMillis(DiscreteScrollViewOptions.getTransitionTime());
|
||||
apps = NavigatorApps.getApps();
|
||||
CARD_SIZE = apps.size();
|
||||
scroller.setItemTransformer(new CardScaleTransformer.Builder()
|
||||
.setMinScale(0.84f)
|
||||
.build());
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.mogo.module.apps.model;
|
||||
|
||||
import com.mogo.module.apps.R;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -14,13 +16,6 @@ import java.util.List;
|
||||
*/
|
||||
public class NavigatorApps {
|
||||
|
||||
//integers.add(R.drawable.module_apps_ic_online_car);
|
||||
//integers.add(R.drawable.module_apps_ic_interest);
|
||||
//integers.add(R.drawable.module_apps_ic_news);
|
||||
//integers.add(R.drawable.module_apps_ic_media_center);
|
||||
//integers.add(R.drawable.module_apps_ic_chat_icon);
|
||||
//integers.add(R.drawable.module_apps_ic_tanlu);
|
||||
|
||||
public static List< NavigatorApp > getApps() {
|
||||
List< NavigatorApp > apps = new ArrayList<>();
|
||||
apps.add( new NavigatorApp( R.drawable.module_apps_ic_online_car,R.drawable.module_apps_ic_online_car_unchecked, "在线车辆", ModuleNames.CARD_TYPE_USER_DATA ) );
|
||||
@@ -31,4 +26,38 @@ public class NavigatorApps {
|
||||
apps.add( new NavigatorApp( R.drawable.module_apps_ic_tanlu, R.drawable.module_apps_ic_tanlu_unchecked,"探路", ModuleNames.CARD_TYPE_ROAD_CONDITION ) );
|
||||
return apps;
|
||||
}
|
||||
|
||||
// public static List< NavigatorApp > getApps() {
|
||||
// List< NavigatorApp > apps = new ArrayList<>();
|
||||
// List< MogoModule > modules = MogoModulePaths.getModules();
|
||||
// for ( MogoModule module : modules ) {
|
||||
// NavigatorApp app = getApp( module );
|
||||
// if ( app == null ) {
|
||||
// continue;
|
||||
// }
|
||||
// apps.add( app );
|
||||
// }
|
||||
// return apps;
|
||||
// }
|
||||
//
|
||||
// private static NavigatorApp getApp( MogoModule module ) {
|
||||
// if ( module == null ) {
|
||||
// return null;
|
||||
// }
|
||||
// switch ( module.getName() ) {
|
||||
// case ModuleNames.CARD_TYPE_USER_DATA:
|
||||
// return new NavigatorApp( R.drawable.module_apps_ic_online_car, R.drawable.module_apps_ic_online_car_unchecked, "在线车辆", ModuleNames.CARD_TYPE_USER_DATA );
|
||||
// case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
// return new NavigatorApp( R.drawable.module_apps_ic_interest, R.drawable.module_apps_ic_interest_unchecked, "新鲜事", ModuleNames.CARD_TYPE_NOVELTY );
|
||||
// case ModuleNames.CARD_TYPE_BUSINESS_OPERATION:
|
||||
// return new NavigatorApp( R.drawable.module_apps_ic_news, R.drawable.module_apps_ic_news_unchecked, "首页", ModuleNames.CARD_TYPE_BUSINESS_OPERATION );
|
||||
// case ModuleNames.CARD_TYPE_SHARE_MUSIC:
|
||||
// return new NavigatorApp( R.drawable.module_apps_ic_media_center, R.drawable.module_apps_ic_media_center_checked, "媒体中心", ModuleNames.CARD_TYPE_SHARE_MUSIC );
|
||||
// case ModuleNames.CARD_TYPE_CARS_CHATTING:
|
||||
// return new NavigatorApp( R.drawable.module_apps_ic_chat_icon, R.drawable.module_apps_ic_chat_unchecked, "车聊聊", ModuleNames.CARD_TYPE_CARS_CHATTING );
|
||||
// case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
// return new NavigatorApp( R.drawable.module_apps_ic_tanlu, R.drawable.module_apps_ic_tanlu_unchecked, "探路", ModuleNames.CARD_TYPE_ROAD_CONDITION );
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.mogo.module.common.utils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-26
|
||||
* <p>
|
||||
* 车机类型
|
||||
*/
|
||||
public class CarSeries {
|
||||
|
||||
public static final int CAR_SERIES_C80X = 10;
|
||||
public static final int CAR_SERIES_D80X = 20;
|
||||
public static final int CAR_SERIES_D81X = 21;
|
||||
public static final int CAR_SERIES_D82X = 22;
|
||||
public static final int CAR_SERIES_D84X = 23;
|
||||
public static final int CAR_SERIES_F80X = 30;
|
||||
public static final int CAR_SERIES_G80X = 40;
|
||||
|
||||
public static int CAR_SERIES = 0;
|
||||
|
||||
public static int getSeries() {
|
||||
if ( CAR_SERIES != 0 ) {
|
||||
return CAR_SERIES;
|
||||
}
|
||||
synchronized ( CarSeries.class ) {
|
||||
if ( CAR_SERIES != 0 ) {
|
||||
return CAR_SERIES;
|
||||
}
|
||||
String device = get( "ro.fota.device" );
|
||||
if ( "FG166".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_C80X;
|
||||
} else if ( "D801-802".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_D80X;
|
||||
} else if ( "D811-812".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_D81X;
|
||||
} else if ( "D821-822".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_D82X;
|
||||
} else if ( "D841-842".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_D84X;
|
||||
} else if ( "G801-802".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_G80X;
|
||||
} else if ( "F801-802".equals( device ) ) {
|
||||
CAR_SERIES = CAR_SERIES_F80X;
|
||||
} else {
|
||||
CAR_SERIES = CAR_SERIES_F80X;
|
||||
}
|
||||
return CAR_SERIES;
|
||||
}
|
||||
}
|
||||
|
||||
private static String get( String key ) {
|
||||
String value = "";
|
||||
try {
|
||||
Class< ? > c = Class.forName( "android.os.SystemProperties" );
|
||||
Method get = c.getMethod( "get", new Class[]{String.class, String.class} );
|
||||
value = ( String ) get.invoke( c, new Object[]{key, "unknown"} );
|
||||
} catch ( Exception e ) {
|
||||
value = "";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mogo.module.extensions.anim;
|
||||
|
||||
import android.graphics.drawable.AnimationDrawable;
|
||||
import android.os.Build;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.mogo.module.common.utils.CarSeries;
|
||||
import com.mogo.module.extensions.R;
|
||||
import com.mogo.utils.ThreadPoolService;
|
||||
import com.mogo.utils.UiThreadHandler;
|
||||
@@ -27,7 +27,7 @@ public class AnimWrapper implements Anim {
|
||||
|
||||
public void initAnim( ImageView target ) {
|
||||
mTarget = target;
|
||||
if ( Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ) {
|
||||
if ( CarSeries.getSeries() == CarSeries.CAR_SERIES_F80X ) {
|
||||
ThreadPoolService.execute( () -> {
|
||||
final AnimationDrawable drawable = new AnimationDrawable();
|
||||
for ( int i = 0; i < AnimRes.sRes.length; i++ ) {
|
||||
|
||||
@@ -138,6 +138,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mSearch = findViewById( R.id.module_entrance_id_search );
|
||||
|
||||
mSearch.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
mSearchProvider = ( IMogoModuleProvider ) ARouter.getInstance()
|
||||
.build( MogoModulePaths.PATH_MODULE_SEARCH )
|
||||
.navigation();
|
||||
@@ -152,6 +153,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mHome = findViewById( R.id.module_entrance_id_home );
|
||||
mHome.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
mMogoAddressManager.goHome();
|
||||
mApis.getAdasControllerApi().closeADAS();
|
||||
|
||||
@@ -159,6 +161,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
mCompany = findViewById( R.id.module_entrance_id_company );
|
||||
mCompany.setOnClickListener( view -> {
|
||||
setMarkerStatus(true);
|
||||
mMogoAddressManager.goCompany();
|
||||
mApis.getAdasControllerApi().closeADAS();
|
||||
|
||||
@@ -239,6 +242,15 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
protected void setMarkerStatus(boolean show){
|
||||
mMogoStatusManager.setSearchUIShow(
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY, show
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private static final String AUTONAVI_STANDARD_BROADCAST_RECV =
|
||||
"AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
@NonNull
|
||||
|
||||
@@ -25,6 +25,8 @@ import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.module.common.MogoModule;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.main.assist.MapBroadCastHelper;
|
||||
import com.mogo.module.main.cards.CardIntroduceConfig;
|
||||
import com.mogo.module.main.cards.CardIntroduceConfigs;
|
||||
import com.mogo.module.main.cards.CardModulesAdapter;
|
||||
import com.mogo.module.main.cards.HorizentalStackTransformer;
|
||||
import com.mogo.module.main.cards.MogoModulesHandler;
|
||||
@@ -198,7 +200,8 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mCardCoverUpBottomLayout = findViewById( R.id.module_main_id_card_cover_up_bottom );
|
||||
|
||||
// 避免事件穿透导致地图被滑动
|
||||
mLeftShadowFrame.setOnClickListener( view -> {} );
|
||||
mLeftShadowFrame.setOnClickListener( view -> {
|
||||
} );
|
||||
WindowViewHandler.init( mFloatingLayout );
|
||||
}
|
||||
|
||||
@@ -378,6 +381,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
MapBroadCastHelper.getInstance( this ).mapBackground();
|
||||
super.onPause();
|
||||
mMogoStatusManager.setMainPageResumeStatus( TAG, false );
|
||||
CardIntroduceConfigs.flush( getApplicationContext() );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.mogo.module.main.cards;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-27
|
||||
* <p>
|
||||
* 卡片播报配置
|
||||
*/
|
||||
public class CardIntroduceConfig {
|
||||
|
||||
public String cardType;
|
||||
public String broadcastWords;
|
||||
public int broadcastAmount;
|
||||
|
||||
public CardIntroduceConfig( String cardType, String broadcastWords, int broadcastAmount ) {
|
||||
this.cardType = cardType;
|
||||
this.broadcastWords = broadcastWords;
|
||||
this.broadcastAmount = broadcastAmount;
|
||||
}
|
||||
|
||||
public CardIntroduceConfig() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
package com.mogo.module.main.cards;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.VoicePreemptType;
|
||||
import com.mogo.module.common.ModuleNames;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-03-27
|
||||
* <p>
|
||||
* 卡片播报配置
|
||||
*/
|
||||
public class CardIntroduceConfigs {
|
||||
|
||||
private static final String TAG = "CardIntroduceConfigs";
|
||||
|
||||
public static final String KEY_VOICE_BROADCAST_CONFIG = "voice_broadcast_";
|
||||
public static String sBroadcastConfigKey;
|
||||
|
||||
public static Map< String, CardIntroduceConfig > sConfigs = new HashMap<>();
|
||||
|
||||
static {
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_BUSINESS_OPERATION, new CardIntroduceConfig( ModuleNames.CARD_TYPE_BUSINESS_OPERATION, "", 3 ) );
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_SHARE_MUSIC, new CardIntroduceConfig( ModuleNames.CARD_TYPE_SHARE_MUSIC, "音乐新闻听书,海量资源随你选", 0 ) );
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_CARS_CHATTING, new CardIntroduceConfig( ModuleNames.CARD_TYPE_CARS_CHATTING, "开车无聊,就用车聊聊", 0 ) );
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_ROAD_CONDITION, new CardIntroduceConfig( ModuleNames.CARD_TYPE_ROAD_CONDITION, "随时查看路况,可以对我说某某地点堵不堵", 0 ) );
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_USER_DATA, new CardIntroduceConfig( ModuleNames.CARD_TYPE_USER_DATA, "在线车辆,邀你在地图上发现万千有趣的车友", 0 ) );
|
||||
sConfigs.put( ModuleNames.CARD_TYPE_NOVELTY, new CardIntroduceConfig( ModuleNames.CARD_TYPE_NOVELTY, "新鲜事,邀你给同城车友分享沿途封路、拥堵消息", 0 ) );
|
||||
}
|
||||
|
||||
public static void init( Context context ) {
|
||||
|
||||
WorkThreadHandler.getInstance().post( () -> {
|
||||
sBroadcastConfigKey = KEY_VOICE_BROADCAST_CONFIG + CommonUtils.getVersionCode( context );
|
||||
String configsStr = SharedPrefsMgr.getInstance( context ).getString( sBroadcastConfigKey );
|
||||
List< CardIntroduceConfig > configs = GsonUtil.arrayFromJson( configsStr, CardIntroduceConfig.class );
|
||||
if ( configs == null ) {
|
||||
return;
|
||||
}
|
||||
for ( CardIntroduceConfig config : configs ) {
|
||||
if ( config == null ) {
|
||||
return;
|
||||
}
|
||||
sConfigs.put( config.cardType, config );
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
public static void broadcast( Context context, String type ) {
|
||||
if ( sConfigs.get( type ) == null ) {
|
||||
Logger.d( TAG, "un support %s", type );
|
||||
return;
|
||||
}
|
||||
if ( sConfigs.get( type ).broadcastAmount >= 3 ) {
|
||||
Logger.d( TAG, "do not broadcast %s cast amount = %s", type, type );
|
||||
return;
|
||||
}
|
||||
|
||||
CardIntroduceConfig config = sConfigs.get( type );
|
||||
config.broadcastAmount++;
|
||||
|
||||
Logger.d( TAG, "speak card introduce: %s", config.broadcastWords );
|
||||
AIAssist.getInstance( context ).speakTTSVoice( config.broadcastWords, VoicePreemptType.PREEMPT_TYPE_IMMEADIATELY, null );
|
||||
}
|
||||
|
||||
public static void flush( Context context ) {
|
||||
if ( sBroadcastConfigKey == null || sConfigs.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
WorkThreadHandler.getInstance().post( () -> {
|
||||
synchronized ( sConfigs ) {
|
||||
ArrayList configs = new ArrayList( sConfigs.entrySet() );
|
||||
SharedPrefsMgr.getInstance( context ).putString( sBroadcastConfigKey, GsonUtil.jsonFromObject( configs ) );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ import com.mogo.module.main.MainActivity;
|
||||
import com.mogo.module.main.assist.MapBroadCastHelper;
|
||||
import com.mogo.module.main.registercenter.MogoRegisterCenterHandler;
|
||||
import com.mogo.module.service.receiver.MogoReceiver;
|
||||
import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
@@ -38,7 +39,9 @@ import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.module.IMogoModuleLifecycle;
|
||||
import com.mogo.service.module.IMogoModuleProvider;
|
||||
import com.mogo.service.module.ModuleType;
|
||||
import com.mogo.utils.CommonUtils;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.WorkThreadHandler;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
import com.mogo.utils.network.utils.GsonUtil;
|
||||
import com.mogo.utils.storage.SharedPrefsMgr;
|
||||
@@ -66,6 +69,9 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
|
||||
private static final String TAG = "MogoModulesManager";
|
||||
|
||||
|
||||
private String mBroadcastConfigKey;
|
||||
|
||||
private MainActivity mActivity;
|
||||
|
||||
private Map< MogoModule, IMogoModuleProvider > mModuleProviders = new HashMap<>();
|
||||
@@ -86,15 +92,12 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
throw new NullPointerException( "activity can't be null." );
|
||||
}
|
||||
this.mActivity = activity;
|
||||
mTrackManager = ( IMogoAnalytics ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_UTILS_ANALYTICS )
|
||||
.navigation();
|
||||
|
||||
mMogoIntentManager = ( IMogoIntentManager ) ARouter.getInstance()
|
||||
.build( MogoServicePaths.PATH_INTENT_MANAGER )
|
||||
.navigation();
|
||||
IMogoServiceApis apis = ( IMogoServiceApis ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICE_APIS ).navigation();
|
||||
mTrackManager = apis.getAnalyticsApi();
|
||||
mMogoIntentManager = apis.getIntentManagerApi();
|
||||
|
||||
registerReceiver();
|
||||
CardIntroduceConfigs.init( getContext() );
|
||||
}
|
||||
|
||||
private Context getContext() {
|
||||
@@ -279,6 +282,8 @@ public class MogoModulesManager implements MogoModulesHandler,
|
||||
mSortedCards.add( 0, mEnableModuleName );
|
||||
SharedPrefsMgr.getInstance( getContext() ).putString( KEY_SORTED_CARD_MODULES, GsonUtil.jsonFromObject( mSortedCards ) );
|
||||
Log.i( TAG, "enable & disable card cost " + ( System.currentTimeMillis() - start1 ) + "ms" );
|
||||
|
||||
CardIntroduceConfigs.broadcast( mActivity, mEnableModuleName );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,6 +23,7 @@ import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.module.IMogoSearchManager;
|
||||
import com.mogo.service.strategy.IMogoRefreshStrategyController;
|
||||
import com.mogo.service.voice.IMogoVoiceListener;
|
||||
import com.mogo.service.voice.IMogoVoiceManager;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
@@ -48,6 +49,7 @@ public class MapPresenter extends Presenter<MapView> implements
|
||||
private IMogoMapService mMogoMapService;
|
||||
private IMogoIntentManager mMogoIntentManager;
|
||||
private IMogoSearchManager mSearchManager;
|
||||
private IMogoRefreshStrategyController mRefreshStrategyController;
|
||||
|
||||
public MapPresenter(MapView view) {
|
||||
super(view);
|
||||
@@ -72,12 +74,19 @@ public class MapPresenter extends Presenter<MapView> implements
|
||||
if (type == 0) {
|
||||
mView.getUIController().setTrafficEnabled(opera_type == 0);
|
||||
} else if (type == 1) {
|
||||
boolean isLocked = mMogoMapService.getMapUIController().isCarLocked();
|
||||
mView.getUIController().changeZoom(opera_type == 0);
|
||||
UiThreadHandler.postDelayed( ()->{
|
||||
int lockZoomLevel = opera_type == 0 ? ( ( int ) mView.getUIController().getZoomLevel() ) : ( ( int ) (mView.getUIController().getZoomLevel() + 0.5 ));
|
||||
mView.getUIController().setLockZoom( lockZoomLevel );
|
||||
mMogoMapService.getMapUIController().recoverLockMode();//缩放地图会导致锁车发生改变,这里强制锁车
|
||||
}, 1_000 );
|
||||
if ( isLocked ) {
|
||||
// 保持锁车状态
|
||||
UiThreadHandler.postDelayed( ()->{
|
||||
int lockZoomLevel = opera_type == 0 ? ( ( int ) mView.getUIController().getZoomLevel() ) : ( ( int ) (mView.getUIController().getZoomLevel() + 0.5 ));
|
||||
mView.getUIController().setLockZoom( lockZoomLevel );
|
||||
mMogoMapService.getMapUIController().recoverLockMode();//缩放地图会导致锁车发生改变,这里强制锁车
|
||||
}, 1_000 );
|
||||
} else {
|
||||
// 30s后锁车刷新
|
||||
mRefreshStrategyController.restartAutoRefreshAtTime( 30 );
|
||||
}
|
||||
} else if (type == 2) {
|
||||
|
||||
mMogoIntentManager.invoke(AUTONAVI_STANDARD_BROADCAST_RECV,intent);
|
||||
@@ -163,6 +172,7 @@ public class MapPresenter extends Presenter<MapView> implements
|
||||
mMogoMapService = apis.getMapServiceApi();
|
||||
mMogoIntentManager = apis.getIntentManagerApi();
|
||||
mSearchManager = apis.getSearchManagerApi();
|
||||
mRefreshStrategyController = apis.getRefreshStrategyControllerApi();
|
||||
|
||||
IMogoNavi mogoNavi = mMogoMapService.getNavi(getContext());
|
||||
mogoNavi.setCalculatePathDisplayBounds(new Rect(
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -344,6 +344,7 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
}
|
||||
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
Logger.d( TAG, "draw marker" );
|
||||
|
||||
mLastDataResult = response.getResult();
|
||||
UiThreadHandler.post( () -> {
|
||||
|
||||
@@ -16,7 +16,4 @@ public interface IMogoRefreshStrategyController extends IProvider {
|
||||
* @param delay 单位(ms) 0 为则立即刷新,为负值则忽略
|
||||
*/
|
||||
void restartAutoRefreshAtTime( int delay );
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -47,6 +47,8 @@ public class MogoADASController implements IMogoADASController {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.d( TAG, "open adas" );
|
||||
|
||||
Intent intent = new Intent( ACTION );
|
||||
intent.putExtra( PARAM_COMMAND, VAL_COMMAND );
|
||||
JSONObject object = new JSONObject();
|
||||
@@ -67,6 +69,8 @@ public class MogoADASController implements IMogoADASController {
|
||||
return;
|
||||
}
|
||||
|
||||
Logger.d( TAG, "close adas" );
|
||||
|
||||
Intent intent = new Intent( ACTION );
|
||||
intent.putExtra( PARAM_COMMAND, VAL_COMMAND );
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
Reference in New Issue
Block a user