opt
@@ -45,6 +45,7 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
// 设置高德 marker 的object对象为 IMogoMarker 实例。!!!!
|
||||
marker.setObject( this );
|
||||
}
|
||||
setObject( mogoMarkerOptions.getObject() );
|
||||
this.mMogoMarkerOptions = mogoMarkerOptions;
|
||||
mMogoMarkerOptions.addObserver( this );
|
||||
}
|
||||
@@ -153,6 +154,9 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer {
|
||||
}
|
||||
if ( mMarker != null ) {
|
||||
mMarker.setMarkerOptions( options );
|
||||
if ( mMarker.getObject() instanceof IMogoMarker ) {
|
||||
( ( IMogoMarker ) mMarker.getObject() ).setObject( opt.getObject() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 8.7 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 8.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 6.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 9.5 KiB |
@@ -60,6 +60,8 @@ public class MogoMarkerOptions extends Observable {
|
||||
// marker 归属模块
|
||||
private String mOwner;
|
||||
|
||||
private Object mObject;
|
||||
|
||||
public MogoMarkerOptions latitude( double latitude ) {
|
||||
this.latitude = latitude;
|
||||
return this;
|
||||
@@ -156,6 +158,11 @@ public class MogoMarkerOptions extends Observable {
|
||||
return this;
|
||||
}
|
||||
|
||||
public MogoMarkerOptions object( Object object ) {
|
||||
this.mObject = object;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义marker图层样式,优先使用 icon {@link #icon(Bitmap)}作为marker资源
|
||||
*
|
||||
@@ -255,4 +262,8 @@ public class MogoMarkerOptions extends Observable {
|
||||
public String getOwner() {
|
||||
return mOwner;
|
||||
}
|
||||
|
||||
public Object getObject() {
|
||||
return mObject;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 24 KiB |
BIN
libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_start.png
Executable file → Normal file
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.9 KiB |
BIN
libraries/mogo-map-api/src/main/res/drawable-xhdpi/ic_navi_target.png
Executable file → Normal file
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 4.9 KiB |
@@ -22,10 +22,22 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
|
||||
@Override
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume( @NonNull LifecycleOwner owner ) {
|
||||
super.onResume( owner );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL, AppsConst.CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS, this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL, AppsConst.CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS, this );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause( @NonNull LifecycleOwner owner ) {
|
||||
super.onPause( owner );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdSelected( String cmd ) {
|
||||
if ( mView == null ) {
|
||||
@@ -64,7 +76,5 @@ public class AppNavigatorPresenter extends Presenter< AppNavigatorView > impleme
|
||||
@Override
|
||||
public void onDestroy( @NonNull LifecycleOwner owner ) {
|
||||
super.onDestroy( owner );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_OPEN_APPS_PANEL );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( AppsConst.CMD_CLOSE_APPS_PANEL );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ public class AppsConst {
|
||||
public static final int TOTAL_SIZE_EACH_PAGE = 12;
|
||||
|
||||
public static final String CMD_OPEN_APPS_PANEL = "CMD_OPEN_APPS_PANEL";
|
||||
public static final String[] CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS = {"第一个"};
|
||||
public static final String[] CMD_OPEN_APPS_PANEL_UN_WAKEUP_WORDS = {"打开全部应用"};
|
||||
|
||||
public static final String CMD_CLOSE_APPS_PANEL = "CMD_CLOSE_APPS_PANEL";
|
||||
public static final String[] CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS = {"第二个"};
|
||||
public static final String[] CMD_CLOSE_APPS_PANEL_UN_WAKEUP_WORDS = {"关闭全部应用"};
|
||||
}
|
||||
|
||||
@@ -18,11 +18,6 @@ public class MogoModule {
|
||||
*/
|
||||
private String mName;
|
||||
|
||||
/**
|
||||
* 语音指令通过广播传递数据 action.
|
||||
*/
|
||||
private String mVoiceAction;
|
||||
|
||||
/**
|
||||
* @param path 模块加载路径
|
||||
* @param name 模块名称
|
||||
@@ -50,13 +45,4 @@ public class MogoModule {
|
||||
this.mName = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getVoiceAction() {
|
||||
return mVoiceAction;
|
||||
}
|
||||
|
||||
public MogoModule setVoiceAction( String voiceAction ) {
|
||||
this.mVoiceAction = voiceAction;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
super.onCreate( savedInstanceState );
|
||||
|
||||
MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MODULE_APPS, MogoModulePaths.PATH_MODULE_APPS ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MODULE_MAP, MogoModulePaths.PATH_MODULE_MAP ).setVoiceAction( VoiceConstants.ACTION_GAODE_SDK_NAVI_RECV ) );
|
||||
MogoModulePaths.addModule( new MogoModule( MogoModulePaths.PATH_MODULE_MAP, MogoModulePaths.PATH_MODULE_MAP ) );
|
||||
MogoModulePaths.addModule( new MogoModule( ServiceConst.PATH_REFRESH_STRATEGY, ServiceConst.PATH_REFRESH_STRATEGY ) );
|
||||
MogoModulePaths.addModule( new MogoModule( ExtensionsModuleConst.PATH_EXTENSION, ExtensionsModuleConst.TYPE ) );
|
||||
MogoModulePaths.addModule( new MogoModule( ExtensionsModuleConst.PATH_ENTRANCE, ExtensionsModuleConst.TYPE_ENTRANCE ) );
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.mogo.module.main.windowview;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
@@ -21,6 +22,11 @@ public class MogoWindowManager implements IMogoWindowManager {
|
||||
WindowViewHandler.addView( view, priority, x, y, movable );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addView( int priority, View view, FrameLayout.LayoutParams params, boolean movable ) {
|
||||
WindowViewHandler.addView( view, priority, params, movable );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeView( View view ) {
|
||||
WindowViewHandler.removeView( view );
|
||||
|
||||
@@ -28,6 +28,7 @@ public class WindowViewHandler {
|
||||
private static View sView = null;
|
||||
|
||||
private static int sX, sY;
|
||||
private static FrameLayout.LayoutParams sParams;
|
||||
|
||||
/**
|
||||
* 是否可手指拖动
|
||||
@@ -55,26 +56,48 @@ public class WindowViewHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( sView == null ) {
|
||||
sView = view;
|
||||
sMovable = movable;
|
||||
sPriority = priority;
|
||||
sX = x;
|
||||
sY = y;
|
||||
addView();
|
||||
} else {
|
||||
if ( sView != null ) {
|
||||
if ( priority < sPriority ) {
|
||||
Logger.w( TAG, "过滤低优先级布局" );
|
||||
return;
|
||||
}
|
||||
sFloatingLayout.removeView( sView );
|
||||
sView = view;
|
||||
sX = x;
|
||||
sY = y;
|
||||
sPriority = priority;
|
||||
sMovable = movable;
|
||||
addView();
|
||||
}
|
||||
sView = view;
|
||||
sMovable = movable;
|
||||
sPriority = priority;
|
||||
sX = x;
|
||||
sY = y;
|
||||
addView();
|
||||
}
|
||||
|
||||
public static void addView( View view, int priority, FrameLayout.LayoutParams params, boolean movable ) {
|
||||
if ( view == null ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( sFloatingLayout == null ) {
|
||||
Logger.e( TAG, "no floating frame. " );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( sView == view ) {
|
||||
Logger.w( TAG, "改布局已添加且没有移除,不操作" );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( sView != null ) {
|
||||
if ( priority < sPriority ) {
|
||||
Logger.w( TAG, "过滤低优先级布局" );
|
||||
return;
|
||||
}
|
||||
sFloatingLayout.removeView( sView );
|
||||
}
|
||||
sView = view;
|
||||
sMovable = movable;
|
||||
sPriority = priority;
|
||||
sParams = params;
|
||||
addView();
|
||||
}
|
||||
|
||||
public static void removeView( View view ) {
|
||||
@@ -92,6 +115,7 @@ public class WindowViewHandler {
|
||||
sView = null;
|
||||
sPriority = Integer.MIN_VALUE;
|
||||
sMovable = false;
|
||||
sParams = null;
|
||||
DispatchTouchEventWrapper.getInstance().release();
|
||||
}
|
||||
|
||||
@@ -100,9 +124,12 @@ public class WindowViewHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT );
|
||||
params.leftMargin = sX;
|
||||
params.topMargin = sY;
|
||||
FrameLayout.LayoutParams params = sParams;
|
||||
if ( params == null ) {
|
||||
params = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT );
|
||||
params.leftMargin = sX;
|
||||
params.topMargin = sY;
|
||||
}
|
||||
sFloatingLayout.addView( sView, params );
|
||||
}
|
||||
|
||||
|
||||
@@ -5,14 +5,11 @@ import android.os.Bundle;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.MvpFragment;
|
||||
import com.mogo.map.IMogoMap;
|
||||
import com.mogo.map.IMogoUiSettings;
|
||||
import com.mogo.map.MogoMapView;
|
||||
import com.mogo.map.uicontroller.IMogoMapUIController;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.voice.IMogoVoiceManager;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -27,8 +24,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
private MogoMapView mMogoMapView;
|
||||
private IMogoMap mMogoMap;
|
||||
|
||||
private IMogoVoiceManager mMogoVoiceManager;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.module_map_fragment_map;
|
||||
@@ -54,8 +49,6 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
mMogoMapView.onCreate( savedInstanceState );
|
||||
}
|
||||
initMapView();
|
||||
mMogoVoiceManager = ( IMogoVoiceManager ) ARouter.getInstance().build( MogoServicePaths.PATH_VOICE_MANAGER ).navigation( getContext() );
|
||||
mMogoVoiceManager.registerIntentListener( VoiceConstants.ACTION_GAODE_SDK_NAVI_RECV, mPresenter );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -121,8 +114,5 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onDestroy();
|
||||
}
|
||||
if ( mMogoVoiceManager != null ) {
|
||||
mMogoVoiceManager.unregisterIntentListener( VoiceConstants.ACTION_GAODE_SDK_NAVI_RECV );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.module.map;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -17,6 +16,7 @@ import com.mogo.map.uicontroller.EnumMapUI;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.map.IMogoMapService;
|
||||
import com.mogo.service.voice.IMogoVoiceListener;
|
||||
import com.mogo.service.voice.IMogoVoiceManager;
|
||||
import com.mogo.utils.ResourcesHelper;
|
||||
import com.mogo.utils.WindowUtils;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
@@ -34,6 +34,7 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
private static final String TAG = "MapPresenter";
|
||||
|
||||
private IMogoMapService mMogoMapService;
|
||||
private IMogoVoiceManager mMogoVoiceManager;
|
||||
|
||||
public MapPresenter( MapView view ) {
|
||||
super( view );
|
||||
@@ -43,7 +44,9 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
public void onCreate( @NonNull LifecycleOwner owner ) {
|
||||
super.onCreate( owner );
|
||||
mMogoMapService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
|
||||
registerUnWakeupCmd();
|
||||
mMogoVoiceManager = ( IMogoVoiceManager ) ARouter.getInstance().build( MogoServicePaths.PATH_VOICE_MANAGER ).navigation( getContext() );
|
||||
|
||||
registerVoiceCmd();
|
||||
|
||||
IMogoNavi mogoNavi = mMogoMapService.getNavi( getContext() );
|
||||
mogoNavi.setCalculatePathDisplayBounds( new Rect(
|
||||
@@ -54,168 +57,89 @@ public class MapPresenter extends Presenter< MapView > implements IMogoVoiceList
|
||||
) );
|
||||
}
|
||||
|
||||
private void registerUnWakeupCmd() {
|
||||
if ( VoiceConstants.sUnWakeupCmds.isEmpty() ) {
|
||||
@Override
|
||||
public void onResume( @NonNull LifecycleOwner owner ) {
|
||||
super.onResume( owner );
|
||||
registerVoiceCmd();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause( @NonNull LifecycleOwner owner ) {
|
||||
super.onPause( owner );
|
||||
unregisterVoiceCmd();
|
||||
}
|
||||
|
||||
private void registerVoiceCmd() {
|
||||
if ( VoiceConstants.sVoiceCmds.isEmpty() ) {
|
||||
Logger.w( TAG, "no unwakeup words" );
|
||||
return;
|
||||
}
|
||||
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sUnWakeupCmds.entrySet() ) {
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) {
|
||||
mMogoVoiceManager.registerIntentListener( entry.getKey(), this );
|
||||
AIAssist.getInstance( getContext() ).registerUnWakeupCommand( entry.getKey(), entry.getValue(), this );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIntentReceived( String action, Intent intent ) {
|
||||
if ( !TextUtils.equals( action, VoiceConstants.ACTION_GAODE_SDK_NAVI_RECV ) ) {
|
||||
private void unregisterVoiceCmd() {
|
||||
if ( VoiceConstants.sVoiceCmds.isEmpty() ) {
|
||||
Logger.w( TAG, "no unwakeup words" );
|
||||
return;
|
||||
}
|
||||
int type = intent.getExtras().getInt( VoiceConstants.EXTRA_KEY_TYPE );
|
||||
Bundle data = intent.getExtras();
|
||||
switch ( type ) {
|
||||
case VoiceConstants.TYPE_START_NAVI:
|
||||
// actions.onStartNavi();
|
||||
break;
|
||||
case VoiceConstants.TYPE_STOP_NAVI:
|
||||
// actions.onStopNavi();
|
||||
break;
|
||||
case VoiceConstants.TYPE_NAVI_GUIDE_INFO:
|
||||
// actions.onSpeakNaviGuideInfo();
|
||||
break;
|
||||
case VoiceConstants.TYPE_MAP_UI_SETTING:
|
||||
final int actionType = data.getInt( VoiceConstants.EXTRA_TYPE, 0 );
|
||||
final int operateAction = data.getInt( VoiceConstants.EXTRA_OPERA, 0 );
|
||||
onMapUISetting( actionType, operateAction );
|
||||
break;
|
||||
case VoiceConstants.TYPE_NAVI_STRATEGY:
|
||||
// actions.onNaviStrategySetting( data.getInt( VoiceConstants.EXTRA_M, 1 ) );
|
||||
break;
|
||||
case VoiceConstants.TYPE_NAVI_OVERVIEW:
|
||||
final int overview = data.getInt( VoiceConstants.EXTRA_IS_SHOW, -1 );
|
||||
// if ( overview == 0 ) {
|
||||
// actions.onNaviOverview();
|
||||
// } else {
|
||||
// actions.onNaviContinue();
|
||||
// }
|
||||
break;
|
||||
case VoiceConstants.TYPE_NAVI_SPEAK:
|
||||
// actions.onNaviSpeak( data.getInt( VoiceConstants.EXTRA_MUTE, 0 ) );
|
||||
break;
|
||||
case VoiceConstants.TYPE_COMMON_ADDRESS_SETTING:
|
||||
// actions.onAddressSetting();
|
||||
break;
|
||||
case VoiceConstants.TYPE_COMMON_ADDRESS_CHANGED:
|
||||
// actions.onAddressUpdate();
|
||||
break;
|
||||
case VoiceConstants.TYPE_NAVI_ADD_POINT:
|
||||
// final int updateType = intent.getIntExtra( "TYPE", -1 );
|
||||
// final String name = intent.getStringExtra( "POINAME" );
|
||||
// final String address = intent.getStringExtra( "ADDRESS" );
|
||||
// final double lat = intent.getDoubleExtra( "LAT", 0.0 );
|
||||
// final double lng = intent.getDoubleExtra( "LON", 0.0 );
|
||||
// actions.onUpdateNaviPoint( updateType, name, address, lat, lng );
|
||||
break;
|
||||
case VoiceConstants.TYPE_SPEAK_NAVI_INFO:
|
||||
// actions.onSpeakPathRetainDistanceInfo();
|
||||
break;
|
||||
case VoiceConstants.TYPE_SPEAK_SPEED_LIMIT_INFO:
|
||||
// actions.onSpeakSpeedLimitInfo();
|
||||
break;
|
||||
|
||||
for ( Map.Entry< String, String[] > entry : VoiceConstants.sVoiceCmds.entrySet() ) {
|
||||
mMogoVoiceManager.unregisterIntentListener( entry.getKey() );
|
||||
AIAssist.getInstance( getContext() ).unregisterUnWakeupCommand( entry.getKey(), this );
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param actionType 0 - 实时路况
|
||||
* 1 - 地图缩放
|
||||
* 2 - 视图模式
|
||||
* 3 - 夜间模式
|
||||
* @param action actionType = 0 -> 0 - 开、1 - 关
|
||||
* actionType = 1 -> 0 - 放大地图、1 - 缩小地图
|
||||
* actionType = 2 -> 0 - 切换到2D车头朝上、1 - 切换2D正北模式、2 - 切换3D车头朝上
|
||||
* actionType = 3 -> 0 - 黑夜、1 - 正常、2 - 自动
|
||||
*/
|
||||
public void onMapUISetting( int actionType, int action ) {
|
||||
switch ( actionType ) {
|
||||
case 0:
|
||||
if ( action == 0 ) {
|
||||
mView.getUIController().setTrafficEnabled( true );
|
||||
} else if ( action == 1 ) {
|
||||
mView.getUIController().setTrafficEnabled( false );
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if ( action == 0 ) {
|
||||
mView.getUIController().changeZoom( true );
|
||||
} else if ( action == 1 ) {
|
||||
mView.getUIController().changeZoom( false );
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if ( action == 0 ) {
|
||||
// 车头朝上,2D
|
||||
mView.getUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
} else if ( action == 1 ) {
|
||||
// 北朝上,2D
|
||||
mView.getUIController().changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
} else if ( action == 2 ) {
|
||||
// 车头朝上,3D
|
||||
mView.getUIController().changeMapMode( EnumMapUI.CarUp_3D );
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if ( action == 0 ) {
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Night );
|
||||
} else if ( action == 1 ) {
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Light );
|
||||
} else if ( action == 2 ) {
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_AUTO_LIGHT_Night );
|
||||
}
|
||||
break;
|
||||
@Override
|
||||
public void onIntentReceived( String command, Intent intent ) {
|
||||
if ( TextUtils.isEmpty( command ) ) {
|
||||
return;
|
||||
}
|
||||
onCmdSelected( command );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCmdSelected( String cmd ) {
|
||||
switch ( cmd ) {
|
||||
case VoiceConstants.CMD_MAP_TRAFFIC_MODE:
|
||||
onMapUISetting( 0, 0 );
|
||||
mView.getUIController().setTrafficEnabled( true );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE:
|
||||
onMapUISetting( 0, 1 );
|
||||
mView.getUIController().setTrafficEnabled( false );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_ZOOM_IN:
|
||||
onMapUISetting( 1, 0 );
|
||||
mView.getUIController().changeZoom( true );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_ZOOM_OUT:
|
||||
onMapUISetting( 1, 1 );
|
||||
mView.getUIController().changeZoom( false );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_2D:
|
||||
onMapUISetting( 2, 1 );
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_3D:
|
||||
onMapUISetting( 2, 2 );
|
||||
mView.getUIController().changeMapMode( EnumMapUI.CarUp_3D );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_LIGHT_MODE:
|
||||
onMapUISetting( 3, 1 );
|
||||
case VoiceConstants.CMD_MAP_DAY_TIME_MODE:
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Light );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_NIGHT_MODE:
|
||||
onMapUISetting( 3, 0 );
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_Night );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE:
|
||||
onMapUISetting( 3, 2 );
|
||||
mView.getUIController().changeMapMode( EnumMapUI.Type_AUTO_LIGHT_Night );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE:
|
||||
mMogoMapService.getMapUIController().displayOverview();
|
||||
mView.getUIController().displayOverview();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE:
|
||||
mMogoMapService.getMapUIController().recoverLockMode();
|
||||
mView.getUIController().recoverLockMode();
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_CAR_UP_MODE:
|
||||
mMogoMapService.getMapUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
break;
|
||||
case VoiceConstants.CMD_MAP_NORTH_UP_MODE:
|
||||
mMogoMapService.getMapUIController().changeMapMode( EnumMapUI.NorthUP_2D );
|
||||
mView.getUIController().changeMapMode( EnumMapUI.CarUp_2D );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,176 +11,99 @@ import java.util.Map;
|
||||
*/
|
||||
public class VoiceConstants {
|
||||
|
||||
// 同行者Adapter接受action
|
||||
public static final String ACTION_GAODE_SDK_NAVI_RECV = "ACTION_GAODE_SDK_NAVI_RECV";
|
||||
// 同行者Adapter发送action
|
||||
public static final String ACTION_GAODE_SDK_NAVI_SEND = "ACTION_GAODE_SDK_NAVI_SEND";
|
||||
|
||||
public static final String EXTRA_KEY_TYPE = "KEY_TYPE";
|
||||
public static final String EXTRA_TYPE = "EXTRA_TYPE";//操作地图
|
||||
public static final String EXTRA_OPERA = "EXTRA_OPERA";//操作地图
|
||||
public static final String EXTRA_MUTE = "EXTRA_MUTE";
|
||||
public static final String EXTRA_IS_SHOW = "EXTRA_IS_SHOW";//预览全路径还是继续导航
|
||||
public static final String EXTRA_M = "EXTRA_M";// 导航策略:1(避免收费) 3(不走高速) 4(躲避拥堵) 20 (高速优先)
|
||||
|
||||
/**
|
||||
* 直接导航
|
||||
*/
|
||||
public static final int TYPE_START_NAVI = 110009;
|
||||
|
||||
/**
|
||||
* 导航预览or继续导航
|
||||
*/
|
||||
public static final int TYPE_NAVI_OVERVIEW = 110006;
|
||||
|
||||
/**
|
||||
* 地图控制:缩放、路况、车头、2/3D
|
||||
*/
|
||||
public static final int TYPE_MAP_UI_SETTING = 110027;
|
||||
|
||||
/**
|
||||
* 重新计算导航策略
|
||||
*/
|
||||
public static final int TYPE_NAVI_STRATEGY = 110032;
|
||||
|
||||
/**
|
||||
* 提箱前方路线方案
|
||||
* <p>
|
||||
* 未实现
|
||||
*/
|
||||
public static final int TYPE_NAVI_GUIDE_INFO = 120004;
|
||||
|
||||
/**
|
||||
* 播放当前剩余里程和时间
|
||||
* <p>
|
||||
* 未实现
|
||||
*/
|
||||
public static final int TYPE_SPEAK_NAVI_INFO = 120001;
|
||||
|
||||
/**
|
||||
* 播放当前限速信息
|
||||
* <p>
|
||||
* 未实现
|
||||
*/
|
||||
public static final int TYPE_SPEAK_SPEED_LIMIT_INFO = 120002;
|
||||
|
||||
/**
|
||||
* 停止导航,但是不退出地图
|
||||
*/
|
||||
public static final int TYPE_STOP_NAVI = 110010;
|
||||
|
||||
/**
|
||||
* 退出地图应用
|
||||
*/
|
||||
@Deprecated
|
||||
public static final int TYPE_EXIT_NAVI = 120003;
|
||||
|
||||
/**
|
||||
* 插入途经点
|
||||
*/
|
||||
public static final int TYPE_NAVI_ADD_POINT = 210009;
|
||||
|
||||
public static final int TYPE_NAVI_SPEAK = 10011;
|
||||
public static final int TYPE_COMMON_ADDRESS_SETTING = 10007;
|
||||
public static final int TYPE_COMMON_ADDRESS_CHANGED = 10008;
|
||||
public static final int TYPE_NAVI_TO = 110027;
|
||||
|
||||
// 地图免唤醒语音注册
|
||||
/**
|
||||
* 放大地图
|
||||
*/
|
||||
public static final String CMD_MAP_ZOOM_IN = "CMD_MAP_ZOOM_IN";
|
||||
public static final String[] CMD_MAP_ZOOM_IN_WAKE_UP_WORDS = {"放大地图"};
|
||||
public static final String CMD_MAP_ZOOM_IN = "com.ileja.navi.map.enlarge";
|
||||
public static final String[] CMD_MAP_ZOOM_IN_TRIGGER_WORDS = {"放大地图"};
|
||||
|
||||
/**
|
||||
* 缩小地图
|
||||
*/
|
||||
public static final String CMD_MAP_ZOOM_OUT = "CMD_MAP_ZOOM_OUT";
|
||||
public static final String[] CMD_MAP_ZOOM_OUT_WAKE_UP_WORDS = {"缩小地图"};
|
||||
public static final String CMD_MAP_ZOOM_OUT = "com.ileja.navi.map.reduce";
|
||||
public static final String[] CMD_MAP_ZOOM_OUT_TRIGGER_WORDS = {"缩小地图"};
|
||||
|
||||
/**
|
||||
* 2D模式
|
||||
*/
|
||||
public static final String CMD_MAP_2D = "CMD_MAP_2D";
|
||||
public static final String[] CMD_MAP_2D_WAKE_UP_WORDS = {"二地模式"};
|
||||
public static final String CMD_MAP_2D = "com.ileja.navi.mode.2d";
|
||||
public static final String[] CMD_MAP_2D_TRIGGER_WORDS = {"二地模式"};
|
||||
|
||||
/**
|
||||
* 3D模式
|
||||
*/
|
||||
public static final String CMD_MAP_3D = "CMD_MAP_3D";
|
||||
public static final String[] CMD_MAP_3D_WAKE_UP_WORDS = {"三地模式"};
|
||||
public static final String CMD_MAP_3D = "com.ileja.navi.mode.3d";
|
||||
public static final String[] CMD_MAP_3D_TRIGGER_WORDS = {"三地模式"};
|
||||
|
||||
/**
|
||||
* 白天模式
|
||||
*/
|
||||
public static final String CMD_MAP_LIGHT_MODE = "CMD_MAP_LIGHT_MODE";
|
||||
public static final String[] CMD_MAP_LIGHT_MODE_WAKE_UP_WORDS = {"白天模式"};
|
||||
public static final String CMD_MAP_DAY_TIME_MODE = "com.ileja.navi.mode.daytime";
|
||||
public static final String[] CMD_MAP_DAY_TIME_MODE_TRIGGER_WORDS = {"白天模式"};
|
||||
|
||||
/**
|
||||
* 黑夜模式
|
||||
*/
|
||||
public static final String CMD_MAP_NIGHT_MODE = "CMD_MAP_NIGHT_MODE";
|
||||
public static final String[] CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS = {"夜间模式"};
|
||||
public static final String CMD_MAP_NIGHT_MODE = "com.ileja.navi.mode.night";
|
||||
public static final String[] CMD_MAP_NIGHT_MODE_TRIGGER_WORDS = {"夜间模式"};
|
||||
|
||||
/**
|
||||
* 自动模式
|
||||
*/
|
||||
public static final String CMD_MAP_AUTO_LIGHT_NIGHT_MODE = "CMD_MAP_AUTO_LIGHT_NIGHT_MODE";
|
||||
public static final String[] CMD_MAP_AUTO_LIGHT_NIGHT_MODE_WAKE_UP_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_TRIGGER_WORDS = {"自动模式"};
|
||||
|
||||
/**
|
||||
* 查看路况
|
||||
*/
|
||||
public static final String CMD_MAP_TRAFFIC_MODE = "CMD_MAP_TRAFFIC_MODE";
|
||||
public static final String[] CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS = {"打开路况", "打开实况"};
|
||||
public static final String CMD_MAP_TRAFFIC_MODE = "com.ileja.navi.traffic.open";
|
||||
public static final String[] CMD_MAP_TRAFFIC_MODE_TRIGGER_WORDS = {"打开路况", "打开实况"};
|
||||
/**
|
||||
* 关闭路况
|
||||
*/
|
||||
public static final String CMD_MAP_UN_TRAFFIC_MODE = "CMD_MAP_UN_TRAFFIC_MODE";
|
||||
public static final String[] CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS = {"关闭路况","关闭实况"};
|
||||
public static final String CMD_MAP_UN_TRAFFIC_MODE = "com.ileja.navi.traffic.close";
|
||||
public static final String[] CMD_MAP_UN_TRAFFIC_MODE_TRIGGER_WORDS = {"关闭路况", "关闭实况"};
|
||||
|
||||
/**
|
||||
* 导航全览
|
||||
*/
|
||||
public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE = "CMD_MAP_DISPLAY_OVERVIEW_MODE";
|
||||
public static final String[] CMD_MAP_DISPLAY_OVERVIEW_MODE_WAKE_UP_WORDS = {"进入全览", "查看全程"};
|
||||
public static final String CMD_MAP_DISPLAY_OVERVIEW_MODE = "com.ileja.navi.map.full";
|
||||
public static final String[] CMD_MAP_DISPLAY_OVERVIEW_MODE_TRIGGER_WORDS = {"进入全览", "查看全程"};
|
||||
|
||||
/**
|
||||
* 继续导航
|
||||
*/
|
||||
public static final String CMD_MAP_CONTINUE_NAVI_MODE = "CMD_MAP_CONTINUE_NAVI_MODE";
|
||||
public static final String[] CMD_MAP_CONTINUE_NAVI_MODE_MODE_WAKE_UP_WORDS = {"继续导航"};
|
||||
public static final String CMD_MAP_CONTINUE_NAVI_MODE = "com.ileja.navi.route.continue";
|
||||
public static final String[] CMD_MAP_CONTINUE_NAVI_MODE_MODE_TRIGGER_WORDS = {"继续导航"};
|
||||
|
||||
/**
|
||||
* 车头朝上
|
||||
*/
|
||||
public static final String CMD_MAP_CAR_UP_MODE = "CMD_MAP_CAR_UP_MODE";
|
||||
public static final String[] CMD_MAP_CAR_UP_MODE_WAKE_UP_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_TRIGGER_WORDS = {"车头朝上"};
|
||||
|
||||
/**
|
||||
* 北朝上
|
||||
*/
|
||||
public static final String CMD_MAP_NORTH_UP_MODE = "CMD_MAP_NORTH_UP_MODE";
|
||||
public static final String[] CMD_MAP_NORTH_UP_MODE_WAKE_UP_WORDS = {"北朝上"};
|
||||
|
||||
public static final Map< String, String[] > sUnWakeupCmds = new HashMap<>();
|
||||
public static final String CMD_MAP_NORTH_UP_MODE = "com.ileja.navi.mode.north_up";
|
||||
public static final String[] CMD_MAP_NORTH_UP_MODE_TRIGGER_WORDS = {"北朝上"};
|
||||
|
||||
public static final Map< String, String[] > sVoiceCmds = new HashMap<>();
|
||||
|
||||
static {
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_ZOOM_IN, VoiceConstants.CMD_MAP_ZOOM_IN_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_ZOOM_OUT, VoiceConstants.CMD_MAP_ZOOM_OUT_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_2D, VoiceConstants.CMD_MAP_2D_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_3D, VoiceConstants.CMD_MAP_3D_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_LIGHT_MODE, VoiceConstants.CMD_MAP_LIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_NIGHT_MODE, VoiceConstants.CMD_MAP_NIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_TRAFFIC_MODE, VoiceConstants.CMD_MAP_TRAFFIC_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE, VoiceConstants.CMD_MAP_UN_TRAFFIC_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE, VoiceConstants.CMD_MAP_AUTO_LIGHT_NIGHT_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE, VoiceConstants.CMD_MAP_DISPLAY_OVERVIEW_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE, VoiceConstants.CMD_MAP_CONTINUE_NAVI_MODE_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_CAR_UP_MODE, VoiceConstants.CMD_MAP_CAR_UP_MODE_WAKE_UP_WORDS );
|
||||
sUnWakeupCmds.put( VoiceConstants.CMD_MAP_NORTH_UP_MODE, VoiceConstants.CMD_MAP_NORTH_UP_MODE_WAKE_UP_WORDS );
|
||||
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 );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -242,12 +242,7 @@ public class MogoServiceProvider implements IMogoModuleProvider,
|
||||
}
|
||||
mAIAssistReceiver = new AIAssistReceiver( context );
|
||||
IntentFilter filter = new IntentFilter();
|
||||
for ( MogoModule module : modules ) {
|
||||
String action = module.getVoiceAction();
|
||||
if ( !TextUtils.isEmpty( action ) ) {
|
||||
filter.addAction( action );
|
||||
}
|
||||
}
|
||||
filter.addAction( AIAssistReceiver.ACTION );
|
||||
try {
|
||||
context.getApplicationContext().registerReceiver( mAIAssistReceiver, filter );
|
||||
Logger.i( TAG, "register voice receiver." );
|
||||
|
||||
@@ -22,6 +22,5 @@ public interface RefreshApiService {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST( "/yycp-launcherSnapshot/launcherSnapshot/querySnapshotAsync" )
|
||||
Observable< BaseData > refreshData(
|
||||
@FieldMap Map< String, Object > parameters );
|
||||
Observable< BaseData > refreshData( @FieldMap Map< String, Object > parameters );
|
||||
}
|
||||
|
||||
@@ -56,14 +56,12 @@ public class RefreshModel {
|
||||
public void refreshData( MogoLatLng latLng, int radius, final RefreshCallback callback ) {
|
||||
if ( mRefreshApiService != null ) {
|
||||
final Map< String, Object > query = new ParamsProvider.Builder( mContext ).build();
|
||||
final Map< String, Object > field = new HashMap<>();
|
||||
field.put( "sn", query.get( "sn" ) );
|
||||
final RefreshBody refreshBody = new RefreshBody();
|
||||
refreshBody.limit = 50;
|
||||
refreshBody.location = new RefreshBody.LatLon( latLng.lat, latLng.lng );
|
||||
refreshBody.radius = radius;
|
||||
field.put( "data", GsonUtil.jsonFromObject( refreshBody ) );
|
||||
mRefreshApiService.refreshData( field )
|
||||
query.put( "data", GsonUtil.jsonFromObject( refreshBody ) );
|
||||
mRefreshApiService.refreshData( query )
|
||||
.subscribeOn( Schedulers.io() )
|
||||
.observeOn( AndroidSchedulers.mainThread() )
|
||||
.subscribe( new SubscribeImpl< BaseData >( RequestOptions.create( mContext ) ) {
|
||||
|
||||