This commit is contained in:
wangcongtao
2020-01-13 21:40:48 +08:00
16 changed files with 318 additions and 112 deletions

View File

@@ -67,6 +67,11 @@ dependencies {
implementation rootProject.ext.dependencies.carcallprovider
implementation rootProject.ext.dependencies.carcall
implementation rootProject.ext.dependencies.modulemedia
implementation rootProject.ext.dependencies.modulepush,{
exclude group:'com.mogo.module',module:'module-common'
}
implementation rootProject.ext.dependencies.moduleonlinecar
if (Boolean.valueOf(RELEASE)) {

View File

@@ -12,6 +12,7 @@ import com.mogo.module.common.MogoModule;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.media.MediaConstants;
import com.mogo.module.onlinecar.OnLineCarConstants;
import com.mogo.module.push.PushUIConstants;
import com.mogo.module.tanlu.constant.TanluConstants;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.connection.IMogoSocketManager;
@@ -29,23 +30,24 @@ public class MogoApplication extends AbsMogoApplication {
super.onCreate();
// MogoModulePaths.addModule( new MogoModule( DemoConstants.TAG, "CARD_DEMO" ) );
// MogoModulePaths.addModule( new MogoModule( Demo2Constants.TAG, "CARD_DEMO2" ) );
DebugConfig.setNetMode( DebugConfig.NET_MODE_QA );
MogoModulePaths.addModule( new MogoModule( OnLineCarConstants.TAG, OnLineCarConstants.MODULE_NAME ) );
MogoModulePaths.addModule( new MogoModule( TanluConstants.TAG, "CARD_TYPE_ROAD_CONDITION" ) );
MogoModulePaths.addModule( new MogoModule( CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME ) );
MogoModulePaths.addModule( new MogoModule( MediaConstants.TAG, MediaConstants.MODULE_TYPE ) );
DebugConfig.setNetMode(DebugConfig.NET_MODE_QA);
MogoModulePaths.addModule(new MogoModule(OnLineCarConstants.TAG, OnLineCarConstants.MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(TanluConstants.TAG, "CARD_TYPE_ROAD_CONDITION"));
MogoModulePaths.addModule(new MogoModule(CallChatConstant.PROVIDER, CallChatConstant.MODULE_NAME));
MogoModulePaths.addModule(new MogoModule(MediaConstants.TAG, MediaConstants.MODULE_TYPE));
MogoModulePaths.addModule(new MogoModule(PushUIConstants.TAG, PushUIConstants.TAG));
}
@Override
protected void init() {
super.init();
IMogoSocketManager mMogoSocketManager = ( IMogoSocketManager ) ARouter.getInstance().build( MogoServicePaths.PATH_SOCKET_MANAGER ).navigation();
mMogoSocketManager.init( getApplicationContext(), BuildConfig.APPLICATION_ID );
IMogoSocketManager mMogoSocketManager = (IMogoSocketManager) ARouter.getInstance().build(MogoServicePaths.PATH_SOCKET_MANAGER).navigation();
mMogoSocketManager.init(getApplicationContext(), BuildConfig.APPLICATION_ID);
}
@Override
protected void attachBaseContext( Context base ) {
super.attachBaseContext( base );
MultiDex.install( base );
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
}
}

View File

@@ -112,5 +112,8 @@ ext {
// 统一登录
accountsdk : "com.zhidao.accountservice:account-sdk:1.0.4",
modulepush : "com.mogo.module:module-push:${MOGO_MODULE_PUSH_VERSION}",
]
}

View File

@@ -55,9 +55,9 @@ public class AbsMogoApplication extends Application {
// 初始化埋点
Analytics.getInstance().start( sApp );
Analytics.getInstance().setAppKey( "6bbe7e0e1ecd8e2f8dc336e1678a2791" );
// 0 - debug 近实时上报积累一条埋点上报或者积累3秒上报一次。
// 2 - 本地缓存聚合上报积累30条埋点上报或者积累60秒上报一次。
Analytics.getInstance().start( sApp );
AnalyticsConfig.getInstance( sApp ).setMode( DebugConfig.isDebug() ? 0 : 2 );
AnalyticsConfig.getInstance( sApp ).shouldLog( DebugConfig.isDebug() );

View File

@@ -49,4 +49,6 @@ CARCHATTING_VERSION=1.0.0-SNAPSHOT
CARCHATTINGPROVIDER_VERSION=1.0.0-SNAPSHOT
MOGO_MODULE_ONLINECAR_VERSION=1.0.0-SNAPSHOT
MOGO_MODULE_MEDIA_VERSION=1.0.0-SNAPSHOT
MOGO_MODULE_PUSH_VERSION=1.0.0-SNAPSHOT

View File

@@ -147,9 +147,9 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
public void handleClickedPolyline( Polyline polyline ) {
if ( mNaviOverlayHelper != null ) {
mNaviOverlayHelper.handleClickedPolyline( polyline, isNaviing() );
mAMapNavi.selectRouteId( mNaviOverlayHelper.getSelectedPathId() );
if ( isNaviing() ) {
mAMapNavi.stopNavi();
mAMapNavi.selectRouteId( mNaviOverlayHelper.getSelectedPathId() );
mAMapNavi.startNavi( mClient.isRealNavi() ? NaviType.GPS : NaviType.EMULATOR );
}
}

View File

@@ -0,0 +1,43 @@
package com.mogo.module.apps;
import androidx.annotation.NonNull;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.Observer;
/**
* @author congtaowang
* @since 2020-01-13
* <p>
* 描述
*/
public class AppsListChangedLiveData extends MutableLiveData {
private Observer mObserver;
private AppsListChangedLiveData(){
// private constructor
}
private static final class InstanceHolder{
private static final AppsListChangedLiveData INSTANCE = new AppsListChangedLiveData();
}
public static AppsListChangedLiveData getInstance(){
return InstanceHolder.INSTANCE;
}
private Object readResolve(){
// 阻止反序列化,必须实现 Serializable 接口
return InstanceHolder.INSTANCE;
}
@Override
public void observeForever( @NonNull Observer observer ) {
super.observeForever( observer );
mObserver = observer;
}
public void release(){
removeObserver( mObserver );
}
}

View File

@@ -30,6 +30,11 @@ public class AppsPresenter extends Presenter< AppsView > {
public void onCreate( @NonNull LifecycleOwner owner ) {
super.onCreate( owner );
renderAppsList();
AppsListChangedLiveData.getInstance().observeForever( bool -> {
if ( mView != null ) {
renderAppsList();
}
} );
}
private void renderAppsList() {
@@ -62,6 +67,7 @@ public class AppsPresenter extends Presenter< AppsView > {
@Override
public void onDestroy( @NonNull LifecycleOwner owner ) {
super.onDestroy( owner );
AppsListChangedLiveData.getInstance().release();
mView = null;
}
}

View File

@@ -9,6 +9,7 @@ import android.text.TextUtils;
import com.mogo.module.apps.AppFilter;
import com.mogo.module.apps.AppFilterImpl;
import com.mogo.module.apps.AppsConst;
import com.mogo.module.apps.AppsListChangedLiveData;
import java.util.ArrayList;
import java.util.HashMap;
@@ -112,6 +113,7 @@ public class AppsModel {
}
mPagedApps.get( pageIndex ).add( appInfo );
}
AppsListChangedLiveData.getInstance().postValue( true );
} catch ( PackageManager.NameNotFoundException e ) {
e.printStackTrace();
}
@@ -153,32 +155,29 @@ public class AppsModel {
return;
}
try {
final PackageManager packageManager = mContext.getPackageManager();
PackageInfo packageInfo = packageManager.getPackageInfo( packageName, 0 );
if ( !mAppFilter.filter( packageInfo ) ) {
int pageIndex = getPageIndex( packageName, false );
if ( pageIndex == -1 ) {
return;
}
int totalPages = mPagedApps.size();
List< AppInfo > dynamicAppsList = new ArrayList<>();
for ( int i = pageIndex; i < totalPages; i++ ) {
dynamicAppsList.addAll( mPagedApps.remove( i ) );
}
int counter = 0;
for ( int i = 0; i < dynamicAppsList.size(); i++ ) {
AppInfo appInfo = dynamicAppsList.get( i );
if ( TextUtils.equals( appInfo.getPackageName(), packageName ) ) {
continue;
}
int page = counter++ / AppsConst.TOTAL_SIZE_EACH_PAGE + pageIndex;
if ( !mPagedApps.containsKey( page ) ) {
mPagedApps.put( page, new ArrayList<>() );
}
mPagedApps.get( page ).add( appInfo );
}
int pageIndex = getPageIndex( packageName, false );
if ( pageIndex == -1 ) {
return;
}
} catch ( PackageManager.NameNotFoundException e ) {
int totalPages = mPagedApps.size();
List< AppInfo > dynamicAppsList = new ArrayList<>();
for ( int i = pageIndex; i < totalPages; i++ ) {
dynamicAppsList.addAll( mPagedApps.remove( i ) );
}
int counter = 0;
for ( int i = 0; i < dynamicAppsList.size(); i++ ) {
AppInfo appInfo = dynamicAppsList.get( i );
if ( TextUtils.equals( appInfo.getPackageName(), packageName ) ) {
continue;
}
int page = counter++ / AppsConst.TOTAL_SIZE_EACH_PAGE + pageIndex;
if ( !mPagedApps.containsKey( page ) ) {
mPagedApps.put( page, new ArrayList<>() );
}
mPagedApps.get( page ).add( appInfo );
}
AppsListChangedLiveData.getInstance().postValue( true );
} catch ( Exception e ) {
e.printStackTrace();
}
}

View File

@@ -9,6 +9,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.commons.mvp.MvpFragment;
import com.mogo.module.extensions.anim.AnimRes;
import com.mogo.module.extensions.anim.JSurfaceView;
@@ -45,18 +46,9 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
mVoiceIcon = findViewById( R.id.module_ext_id_voice );
mVoiceMsg = findViewById( R.id.module_ext_id_voice_msg );
mVoiceIcon.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick( View v ) {
mVoiceMsg.performClick();
}
} );
mVoiceMsg.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick( View v ) {
}
mVoiceIcon.setOnClickListener( view -> {
} );
mVoiceMsg.setOnClickListener( view -> {} );
mTime = findViewById( R.id.module_ext_id_time );
mDate = findViewById( R.id.module_ext_id_date );
@@ -67,6 +59,9 @@ public class ExtensionsFragment extends MvpFragment< ExtensionsView, ExtensionsP
mWeatherDesc = findViewById( R.id.module_ext_id_weather_desc );
mMsgContainer = findViewById( R.id.module_ext_id_msg );
mMsgContainer.setOnClickListener( view -> {
ARouter.getInstance().build( "/push/ui/message" ).navigation( getContext() );
} );
mMsgCounter = findViewById( R.id.module_ext_id_msg_counter );
mVoiceIcon.setFrames( AnimRes.sRes );

View File

@@ -15,6 +15,7 @@ import com.mogo.map.navi.IMogoNavi;
import com.mogo.map.uicontroller.EnumMapUI;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.map.IMogoMapService;
import com.mogo.service.module.IMogoSearchManager;
import com.mogo.service.voice.IMogoVoiceListener;
import com.mogo.service.voice.IMogoVoiceManager;
import com.mogo.utils.ResourcesHelper;
@@ -29,49 +30,60 @@ import java.util.Map;
* <p>
* 描述
*/
public class MapPresenter extends Presenter< MapView > implements IMogoVoiceListener, IMogoVoiceCmdCallBack {
public class MapPresenter extends Presenter<MapView>
implements IMogoVoiceListener, IMogoVoiceCmdCallBack {
private static final String TAG = "MapPresenter";
private IMogoMapService mMogoMapService;
private IMogoVoiceManager mMogoVoiceManager;
private IMogoSearchManager mSearchManager;
public MapPresenter( MapView view ) {
super( view );
public MapPresenter(MapView view) {
super(view);
}
@Override
public void onCreate( @NonNull LifecycleOwner owner ) {
super.onCreate( owner );
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
mMogoVoiceManager = ( IMogoVoiceManager ) ARouter.getInstance().build( MogoServicePaths.PATH_VOICE_MANAGER ).navigation( getContext() );
public void onCreate(@NonNull LifecycleOwner owner) {
super.onCreate(owner);
mMogoMapService = (IMogoMapService) ARouter.getInstance()
.build(MogoServicePaths.PATH_SERVICES_MAP)
.navigation(getContext());
mMogoVoiceManager = (IMogoVoiceManager) ARouter.getInstance()
.build(MogoServicePaths.PATH_VOICE_MANAGER)
.navigation(getContext());
mSearchManager = (IMogoSearchManager) ARouter.getInstance()
.build(MogoServicePaths.PATH_SEARCH_MANAGER)
.navigation(getContext());
registerVoiceCmd();
IMogoNavi mogoNavi = mMogoMapService.getNavi( getContext() );
mogoNavi.setCalculatePathDisplayBounds( new Rect(
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.dp_730 ) + WindowUtils.dip2px( getContext(), 80 ),
ResourcesHelper.getDimensionPixelSize( getContext(), R.dimen.dp_120 ) + WindowUtils.dip2px( getContext(), 80 ),
WindowUtils.dip2px( getContext(), 80 ),
WindowUtils.dip2px( getContext(), 80 )
) );
IMogoNavi mogoNavi = mMogoMapService.getNavi(getContext());
mogoNavi.setCalculatePathDisplayBounds(new Rect(
ResourcesHelper.getDimensionPixelSize(getContext(), R.dimen.dp_730)
+ WindowUtils.dip2px(getContext(), 80),
ResourcesHelper.getDimensionPixelSize(getContext(), R.dimen.dp_120)
+ WindowUtils.dip2px(getContext(), 80),
WindowUtils.dip2px(getContext(), 80),
WindowUtils.dip2px(getContext(), 80)
));
}
@Override
public void onResume( @NonNull LifecycleOwner owner ) {
super.onResume( owner );
public void onResume(@NonNull LifecycleOwner owner) {
super.onResume(owner);
registerVoiceCmd();
}
@Override
public void onPause( @NonNull LifecycleOwner owner ) {
super.onPause( owner );
public void onPause(@NonNull LifecycleOwner owner) {
super.onPause(owner);
unregisterVoiceCmd();
}
private void registerVoiceCmd() {
if ( VoiceConstants.sVoiceCmds.isEmpty() ) {
Logger.w( TAG, "no unwakeup words" );
if (VoiceConstants.sVoiceCmds.isEmpty()) {
Logger.w(TAG, "no unwakeup words");
return;
}
@@ -82,8 +94,8 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
}
private void unregisterVoiceCmd() {
if ( VoiceConstants.sVoiceCmds.isEmpty() ) {
Logger.w( TAG, "no unwakeup words" );
if (VoiceConstants.sVoiceCmds.isEmpty()) {
Logger.w(TAG, "no unwakeup words");
return;
}
@@ -94,23 +106,25 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
}
@Override
public void onIntentReceived( String command, Intent intent ) {
if ( TextUtils.isEmpty( command ) ) {
public void onIntentReceived(String command, Intent intent) {
if (TextUtils.isEmpty(command)) {
return;
}
onCmdSelected( command );
onCmdSelected(command);
}
@Override
public void onCmdSelected( String cmd ) {
switch ( cmd ) {
public void onCmdSelected(String cmd) {
switch (cmd) {
case VoiceConstants.CMD_MAP_TRAFFIC_MODE:
mView.getUIController().setTrafficEnabled( true );
AIAssist.getInstance( getContext() ).speakTTSVoice( "已打开", null );
mView.getUIController().setTrafficEnabled(true);
mSearchManager.showSearch();
AIAssist.getInstance(getContext()).speakTTSVoice("已打开", null);
break;
case VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE:
mView.getUIController().setTrafficEnabled( false );
AIAssist.getInstance( getContext() ).speakTTSVoice( "已关闭", null );
mView.getUIController().setTrafficEnabled(false);
mSearchManager.showMain();
AIAssist.getInstance(getContext()).speakTTSVoice("已关闭", null);
break;
case VoiceConstants.CMD_MAP_ZOOM_IN:
mView.getUIController().changeZoom( true );
@@ -122,57 +136,76 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
break;
case VoiceConstants.CMD_MAP_2D:
case VoiceConstants.CMD_MAP_NORTH_UP_MODE:
mView.getUIController().changeMapMode( EnumMapUI.NorthUP_2D );
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
mView.getUIController().changeMapMode(EnumMapUI.NorthUP_2D);
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
break;
case VoiceConstants.CMD_MAP_3D:
mView.getUIController().changeMapMode( EnumMapUI.CarUp_3D );
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
mView.getUIController().changeMapMode(EnumMapUI.CarUp_3D);
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
break;
case VoiceConstants.CMD_MAP_DAY_TIME_MODE:
mView.getUIController().changeMapMode( EnumMapUI.Type_Light );
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
mView.getUIController().changeMapMode(EnumMapUI.Type_Light);
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
break;
case VoiceConstants.CMD_MAP_GO_COMPANY:
mSearchManager.goCompany();
break;
case VoiceConstants.CMD_MAP_GO_HOME:
mSearchManager.goHome();
break;
case VoiceConstants.CMD_MAP_HISTORY:
mSearchManager.showSearch();
break;
case VoiceConstants.CMD_MAP_STOP_NAVI_MODE:
mSearchManager.showMain();
break;
case VoiceConstants.CMD_MAP_NIGHT_MODE:
mView.getUIController().changeMapMode( EnumMapUI.Type_Night );
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
mView.getUIController().changeMapMode(EnumMapUI.Type_Night);
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
break;
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE:
mView.getUIController().changeMapMode( EnumMapUI.Type_AUTO_LIGHT_Night );
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
mView.getUIController().changeMapMode(EnumMapUI.Type_AUTO_LIGHT_Night);
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
break;
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE:
mView.getUIController().displayOverview();
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
break;
case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE:
mView.getUIController().recoverLockMode();
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
break;
case VoiceConstants.CMD_MAP_CAR_UP_MODE:
mView.getUIController().changeMapMode( EnumMapUI.CarUp_2D );
AIAssist.getInstance( getContext() ).speakTTSVoice( "已切换", null );
mView.getUIController().changeMapMode(EnumMapUI.CarUp_2D);
AIAssist.getInstance(getContext()).speakTTSVoice("已切换", null);
break;
default:
break;
}
}
@Override
public void onCmdAction( String speakText ) {
public void onCmdAction(String speakText) {
}
@Override
public void onCmdCancel( String speakText ) {
public void onCmdCancel(String speakText) {
}
@Override
public void onSpeakEnd( String speakText ) {
public void onSpeakEnd(String speakText) {
}
@Override
public void onSpeakSelectTimeOut( String speakText ) {
public void onSpeakSelectTimeOut(String speakText) {
}
}

View File

@@ -16,94 +16,144 @@ public class VoiceConstants {
* 放大地图
*/
public static final String CMD_MAP_ZOOM_IN = "com.ileja.navi.map.enlarge";
public static final String CMD_MAP_ZOOM_IN_UN_WAKEUP = "CMD_MAP_ZOOM_IN_UN_WAKEUP";
public static final String[] CMD_MAP_ZOOM_IN_TRIGGER_WORDS = {"放大地图"};
/**
* 回家
*/
public static final String CMD_MAP_GO_HOME = "com.ileja.navi.map.go.home";
public static final String CMD_MAP_GO_HOME_UN_WAKEUP = "CMD_MAP_GO_HOME_UN_WAKEUP";
public static final String[] CMD_MAP_ZOOM_IN_GO_HOME = {"我要回家","导航回家","带我回家"};
/**
* 去公司
*/
public static final String CMD_MAP_GO_COMPANY = "com.ileja.navi.map.go.company";
public static final String CMD_MAP_GO_COMPANY_UN_WAKEUP = "CMD_MAP_GO_COMPANY_UN_WAKEUP";
public static final String[] CMD_MAP_ZOOM_IN_GO_COMPANY = {"我要去公司","导航去公司","带我去公司"};
/**
* 导航历史记录
*/
public static final String CMD_MAP_HISTORY = "com.ileja.navi.map.history";
public static final String CMD_MAP_HISTORY_UN_WAKEUP = "CMD_MAP_HISTORY_UN_WAKEUP";
public static final String[] CMD_MAP_HISTORY_TRIGGER_WORDS = {"查询导航历史记录"};
/**
* 缩小地图
*/
public static final String CMD_MAP_ZOOM_OUT = "com.ileja.navi.map.reduce";
public static final String CMD_MAP_ZOOM_OUT_UN_WAKEUP = "CMD_MAP_ZOOM_OUT_UN_WAKEUP";
public static final String[] CMD_MAP_ZOOM_OUT_TRIGGER_WORDS = {"缩小地图"};
/**
* 2D模式
*/
public static final String CMD_MAP_2D = "com.ileja.navi.mode.2d";
public static final String CMD_MAP_2D_UN_WAKEUP = "CMD_MAP_2D_UN_WAKEUP";
public static final String[] CMD_MAP_2D_TRIGGER_WORDS = {"二地模式"};
/**
* 3D模式
*/
public static final String CMD_MAP_3D = "com.ileja.navi.mode.3d";
public static final String CMD_MAP_3D_UN_WAKEUP = "CMD_MAP_3D_UN_WAKEUP";
public static final String[] CMD_MAP_3D_TRIGGER_WORDS = {"三地模式"};
/**
* 白天模式
*/
public static final String CMD_MAP_DAY_TIME_MODE = "com.ileja.navi.mode.daytime";
public static final String CMD_MAP_DAY_TIME_MODE_UN_WAKEUP = "CMD_MAP_DAY_TIME_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS = {"白天模式"};
/**
* 黑夜模式
*/
public static final String CMD_MAP_NIGHT_MODE = "com.ileja.navi.mode.night";
public static final String CMD_MAP_NIGHT_MODE_UN_WAKEUP = "CMD_MAP_NIGHT_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_NIGHT_MODE_TRIGGER_WORDS = {"夜间模式"};
/**
* 自动模式
*/
public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE = "com.ileja.navi.mode.autodaynight";
public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP = "CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS = {"自动模式"};
/**
* 查看路况
*/
public static final String CMD_MAP_TRAFFIC_MODE = "com.ileja.navi.traffic.open";
public static final String CMD_MAP_TRAFFIC_MODE_UN_WAKEUP = "CMD_MAP_TRAFFIC_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS = {"打开路况", "打开实况"};
/**
* 关闭路况
*/
public static final String CMD_MAP_UN_TRAFFIC_MODE = "com.ileja.navi.traffic.close";
public static final String CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP = "CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS = {"关闭路况", "关闭实况"};
/**
* 导航全览
*/
public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE = "com.ileja.navi.map.full";
public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE_UN_WAKEUP = "CMD_MAP_DISPLAY_OVERVIEW_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_DISPLAY_OVERVIEW_MODE_TRIGGER_WORDS = {"进入全览", "查看全程"};
/**
* 继续导航
*/
public static final String CMD_MAP_CONTINUE_NAVI_MODE = "com.ileja.navi.route.continue";
public static final String CMD_MAP_CONTINUE_NAVI_MODE_UN_WAKEUP = "CMD_MAP_CONTINUE_NAVI_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_CONTINUE_NAVI_MODE_MODE_TRIGGER_WORDS = {"继续导航"};
/**
* 停止导航
*/
public static final String CMD_MAP_STOP_NAVI_MODE = "com.ileja.navi.route.stop";
public static final String CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP = "CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS = {"停止导航/结束导航/取消导航/放弃导航/退出导航/关闭导航"};
/**
* 车头朝上
*/
public static final String CMD_MAP_CAR_UP_MODE = "com.ileja.navi.mode.car_up";
public static final String CMD_MAP_CAR_UP_MODE_UN_WAKEUP = "CMD_MAP_CAR_UP_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS = {"车头朝上"};
/**
* 北朝上
*/
public static final String CMD_MAP_NORTH_UP_MODE = "com.ileja.navi.mode.north_up";
public static final String CMD_MAP_NORTH_UP_MODE_UN_WAKEUP = "CMD_MAP_NORTH_UP_MODE_UN_WAKEUP";
public static final String[] CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS = {"北朝上"};
public static final Map< String, String[] > sVoiceCmds = new HashMap<>();
static {
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN, VoiceConstants.CMD_MAP_ZOOM_IN_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_2D, VoiceConstants.CMD_MAP_2D_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_3D, VoiceConstants.CMD_MAP_3D_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE, VoiceConstants.CMD_MAP_NIGHT_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE, VoiceConstants.CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE, VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE, VoiceConstants.CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE, VoiceConstants.CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_OUT_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_2D_UN_WAKEUP, VoiceConstants.CMD_MAP_2D_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_3D_UN_WAKEUP, VoiceConstants.CMD_MAP_3D_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_DAY_TIME_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NIGHT_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_CAR_UP_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_GO_HOME_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_GO_HOME );
sVoiceCmds.put( VoiceConstants.CMD_MAP_GO_COMPANY_UN_WAKEUP, VoiceConstants.CMD_MAP_ZOOM_IN_GO_COMPANY );
sVoiceCmds.put( VoiceConstants.CMD_MAP_HISTORY_UN_WAKEUP, VoiceConstants.CMD_MAP_HISTORY_TRIGGER_WORDS );
sVoiceCmds.put( VoiceConstants.CMD_MAP_STOP_NAVI_MODE_UN_WAKEUP, VoiceConstants.CMD_MAP_STOP_NAVI_MODE_TRIGGER_WORDS );
}
}

View File

@@ -0,0 +1,43 @@
package com.mogo.module.navi.manager;
import android.content.Context;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.mogo.module.common.MogoModulePaths;
import com.mogo.module.navi.constants.SearchServiceHolder;
import com.mogo.module.navi.ui.search.SearchFragment;
import com.mogo.service.MogoServicePaths;
import com.mogo.service.fragmentmanager.FragmentDescriptor;
import com.mogo.service.module.IMogoSearchManager;
/**
* @author zyz
* 2020-01-13.
*/
@Route(path = MogoServicePaths.PATH_SEARCH_MANAGER)
public class MogoSearchManager implements IMogoSearchManager {
@Override public void goHome() {
AddressManager.INSTANCE.goHome();
}
@Override public void goCompany() {
AddressManager.INSTANCE.goCompany();
}
@Override public void showSearch() {
SearchFragment searchFragment = new SearchFragment();
SearchServiceHolder.INSTANCE.getFragmentManager()
.push(new FragmentDescriptor.Builder().fragment(searchFragment)
.tag(MogoModulePaths.PATH_FRAGMENT_SEARCH)
.notifyMainModule(true)
.build());
}
@Override public void showMain() {
SearchServiceHolder.INSTANCE.getFragmentManager()
.clearAll();
}
@Override public void init(Context context) {
}
}

View File

@@ -187,7 +187,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
getViewLifecycleOwner().getLifecycle().addObserver(mPresenter);
EventBus.getDefault().register(this);
initInterface();
mTanluModelData = new TanluModelData(getContext());
initModelData();
handleRoadLineMessage();
initMap();
initStrings();
@@ -196,6 +196,11 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
// iMogoCardManager.switch2(TanluConstants.MODEL_NAME);
}
private void initModelData() {
if (mTanluModelData == null) {
mTanluModelData = new TanluModelData(getContext());
}
}
/**
* 初始化导航 TODO
@@ -219,7 +224,8 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override
public void onStartNavi() {
getNavigationLineData();
// initModelData();
// getNavigationLineData();
}
@Override

View File

@@ -86,6 +86,10 @@ public class MogoServicePaths {
*/
public static final String PATH_ADDRESS_MANAGER = "/addressmanager/api";
/**
* 导航搜索模块管理
*/
public static final String PATH_SEARCH_MANAGER = "/searchmanager/api";
/**
* 基础设置参数管理

View File

@@ -0,0 +1,15 @@
package com.mogo.service.module;
import com.alibaba.android.arouter.facade.template.IProvider;
/**
* @author zyz
* 2020-01-12.
*/
public interface IMogoSearchManager extends IProvider {
void goHome();
void goCompany();
void showSearch();
void showMain();
}