opt
This commit is contained in:
@@ -138,6 +138,28 @@ def generateVersionCode() {
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
f8xxLauncherQaDebugImplementation
|
||||
f8xxLauncherDemoDebugImplementation
|
||||
f8xxLauncherOnlineDebugImplementation
|
||||
e8xxLauncherQaDebugImplementation
|
||||
e8xxLauncherDemoDebugImplementation
|
||||
e8xxLauncherOnlineDebugImplementation
|
||||
d8xxIndependentQaDebugImplementation
|
||||
d8xxIndependentDemoDebugImplementation
|
||||
d8xxIndependentOnlineDebugImplementation
|
||||
|
||||
f8xxLauncherQaReleaseImplementation
|
||||
f8xxLauncherDemoReleaseImplementation
|
||||
f8xxLauncherOnlineReleaseImplementation
|
||||
e8xxLauncherQaReleaseImplementation
|
||||
e8xxLauncherDemoReleaseImplementation
|
||||
e8xxLauncherOnlineReleaseImplementation
|
||||
d8xxIndependentQaReleaseImplementation
|
||||
d8xxIndependentDemoReleaseImplementation
|
||||
d8xxIndependentOnlineReleaseImplementation
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
|
||||
@@ -189,9 +211,9 @@ dependencies {
|
||||
implementation project(':modules:mogo-module-back')
|
||||
implementation project(':modules:mogo-module-guide')
|
||||
implementation project(':modules:mogo-module-authorize')
|
||||
implementation project(':modules:mogo-module-media')
|
||||
debugImplementation project(':modules:mogo-module-gps-simulator-debug')
|
||||
releaseImplementation project(':modules:mogo-module-gps-simulator-noop')
|
||||
implementation project(':modules:mogo-module-media')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<meta-data
|
||||
tools:replace="android:value"
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="40e2e7e773c7562b1f2b13699a93992c" />
|
||||
android:value="a36b9f7b086fa3951bb35338a5a06dd3" />
|
||||
</application>
|
||||
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
|
||||
@@ -14,15 +14,17 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.App"
|
||||
tools:replace="android:label">
|
||||
<provide
|
||||
android:name="com.mogo.module.navi.cp.AddressContentProvider"
|
||||
android:authorities="com.zhidao.auto.personal.provider"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
<!-- 高德地图 -->
|
||||
<!-- <provider-->
|
||||
<!-- android:name="com.mogo.module.navi.cp.AddressContentProvider"-->
|
||||
<!-- android:authorities="com.zhidao.auto.personal.provider"-->
|
||||
<!-- android:enabled="true"-->
|
||||
<!-- android:exported="true" />-->
|
||||
<meta-data
|
||||
tools:replace="android:value"
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="a36b9f7b086fa3951bb35338a5a06dd3" />
|
||||
android:value="40e2e7e773c7562b1f2b13699a93992c" />
|
||||
<!-- 高德地图 -->
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -14,15 +14,6 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme.App"
|
||||
tools:replace="android:label">
|
||||
<!-- <provider-->
|
||||
<!-- android:name="com.mogo.module.navi.cp.AddressContentProvider"-->
|
||||
<!-- android:authorities="com.zhidao.auto.personal.provider"-->
|
||||
<!-- android:enabled="true"-->
|
||||
<!-- android:exported="true" />-->
|
||||
<!-- 高德地图 -->
|
||||
<!-- <meta-data-->
|
||||
<!-- android:name="com.amap.api.v2.apikey"-->
|
||||
<!-- android:value="a36b9f7b086fa3951bb35338a5a06dd3" />-->
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -1,5 +1,13 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.mogo.map.impl.automap">
|
||||
|
||||
/
|
||||
<application>
|
||||
<receiver
|
||||
android:name=".navi.AutoNaviReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="AUTONAVI_STANDARD_BROADCAST_SEND" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -26,7 +26,7 @@ public class AutoNaviClient implements IMogoNavi {
|
||||
|
||||
private static final String TAG = "NaviClient";
|
||||
|
||||
public static final String ACTION_AUTO_MAP = "AUTO NAVI_STANDARD_BRO ADCAST_RECV";
|
||||
public static final String ACTION_AUTO_MAP = "AUTONAVI_STANDARD_BROADCAST_RECV";
|
||||
|
||||
public static final String KEY_TYPE = "KEY_TYPE";
|
||||
public static final String SOURCE_APP = "SOURCE_APP";
|
||||
@@ -75,17 +75,18 @@ public class AutoNaviClient implements IMogoNavi {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void naviTo( MogoLatLng endPoint ) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra( KEY_TYPE, 10038 );
|
||||
intent.putExtra( LAT, endPoint.lat );
|
||||
intent.putExtra( LON, endPoint.lon );
|
||||
intent.putExtra( ENTRY_LAT, endPoint.lat );
|
||||
intent.putExtra( ENTRY_LON, endPoint.lon );
|
||||
// intent.putExtra( ENTRY_LAT, endPoint.lat );
|
||||
// intent.putExtra( ENTRY_LON, endPoint.lon );
|
||||
intent.putExtra( DEV, 0 );
|
||||
intent.putExtra( STYLE, -1 );
|
||||
intent.putExtra( SOURCE_APP, "Third App" );
|
||||
startNaviByIntent( intent );
|
||||
sendByIntent( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,7 +111,9 @@ public class AutoNaviClient implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public void stopNavi() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra( "KEY_TYPE", 10010 );
|
||||
sendByIntent( intent );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -118,7 +121,7 @@ public class AutoNaviClient implements IMogoNavi {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
}
|
||||
|
||||
private void startNaviByIntent( Intent intent ) {
|
||||
private void sendByIntent( Intent intent ) {
|
||||
intent.setAction( ACTION_AUTO_MAP );
|
||||
intent.addFlags( Intent.FLAG_INCLUDE_STOPPED_PACKAGES );
|
||||
mContext.sendBroadcast( intent );
|
||||
@@ -126,8 +129,7 @@ public class AutoNaviClient implements IMogoNavi {
|
||||
|
||||
@Override
|
||||
public boolean isNaviing() {
|
||||
Logger.w( TAG, "高德车机导航,不支持此设置" );
|
||||
return false;
|
||||
return MapState.getInstance().isNaving();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,8 +6,11 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.mogo.map.impl.amap.navi.NaviClient;
|
||||
import com.mogo.map.impl.amap.utils.IconTypeUtils;
|
||||
import com.mogo.map.navi.MogoNaviInfo;
|
||||
import com.mogo.map.navi.MogoNaviListenerHandler;
|
||||
import com.mogo.map.navi.MogoTraffic;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
/**
|
||||
@@ -20,7 +23,7 @@ public class AutoNaviReceiver extends BroadcastReceiver {
|
||||
|
||||
private static final String TAG = "AutoNaviReceiver";
|
||||
|
||||
public static final String ACTION_AUTONAVI_SEND = "AUTO NAVI_STANDARD_BROADCAST_SEND";
|
||||
public static final String ACTION_AUTONAVI_SEND = "AUTONAVI_STANDARD_BROADCAST_SEND";
|
||||
private static AutoNaviReceiver autoNaviReceiver;
|
||||
private static boolean sRegisterFlag = false;
|
||||
|
||||
@@ -46,23 +49,92 @@ public class AutoNaviReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive( Context context, Intent intent ) {
|
||||
String action = intent.getAction();
|
||||
|
||||
if ( !TextUtils.equals( ACTION_AUTONAVI_SEND, action ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
int keyType = intent.getIntExtra( "KEY_TYPE", 0 );
|
||||
Logger.d( TAG, "receive: keyType = %d", keyType );
|
||||
switch ( keyType ) {
|
||||
case 10001:
|
||||
MogoNaviInfo naviInfo = new MogoNaviInfo();
|
||||
naviInfo.setCurrentLimitSpeed( intent.getIntExtra( GuideInfoExtraKey.CAMERA_SPEED, 0 ) );
|
||||
naviInfo.setCurrentRoadName( intent.getStringExtra( GuideInfoExtraKey.CUR_ROAD_NAME ) );
|
||||
naviInfo.setCurrentSpeed( intent.getIntExtra( GuideInfoExtraKey.CUR_SPEED, 0 ) );
|
||||
naviInfo.setCurStepRetainDistance( intent.getIntExtra( GuideInfoExtraKey.SEG_REMAIN_DIS, 0 ) );
|
||||
naviInfo.setCurStepRetainTime( intent.getIntExtra( GuideInfoExtraKey.SEG_REMAIN_TIME, 0 ) );
|
||||
naviInfo.setIconResId( intent.getIntExtra( GuideInfoExtraKey.NEW_ICON, 0 ) );
|
||||
naviInfo.setNextRoadName( intent.getStringExtra( GuideInfoExtraKey.NEXT_ROAD_NAME ) );
|
||||
naviInfo.setPathRetainDistance( intent.getIntExtra( GuideInfoExtraKey.ROUTE_REMAIN_DIS, 0 ) );
|
||||
naviInfo.setPathRetainTime( intent.getIntExtra( GuideInfoExtraKey.ROUTE_REMAIN_TIME, 0 ) );
|
||||
MogoNaviListenerHandler.getInstance().onNaviInfoUpdate( naviInfo );
|
||||
handleAutoNaviInfo( context, intent );
|
||||
break;
|
||||
case 10019:
|
||||
int state = intent.getIntExtra( "EXTRA_STATE", -1 );
|
||||
handleMapStatusChanged( state );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 在导航/巡航/模拟导航中auto主动将变化的引导信息发送给第三方系统
|
||||
*
|
||||
* @param intent
|
||||
*/
|
||||
private void handleAutoNaviInfo( Context context, Intent intent ) {
|
||||
|
||||
int type = intent.getIntExtra( GuideInfoExtraKey.TYPE, -1 );
|
||||
|
||||
int cameraSpeed = intent.getIntExtra( GuideInfoExtraKey.CAMERA_SPEED, 0 );
|
||||
int cameraDisc = intent.getIntExtra( GuideInfoExtraKey.CAMERA_DIST, 0 );
|
||||
int cameraType = intent.getIntExtra( GuideInfoExtraKey.CAMERA_TYPE, 0 );
|
||||
|
||||
if ( type == 0 || type == 1 ) {
|
||||
if ( !MapState.getInstance().isNaving() ) {
|
||||
MapState.getInstance().setNaving( true );
|
||||
MogoNaviListenerHandler.getInstance().onStartNavi();
|
||||
}
|
||||
MogoNaviInfo naviInfo = new MogoNaviInfo();
|
||||
naviInfo.setCurrentLimitSpeed( cameraSpeed );
|
||||
naviInfo.setCurrentRoadName( intent.getStringExtra( GuideInfoExtraKey.CUR_ROAD_NAME ) );
|
||||
naviInfo.setCurrentSpeed( intent.getIntExtra( GuideInfoExtraKey.CUR_SPEED, 0 ) );
|
||||
naviInfo.setCurStepRetainDistance( intent.getIntExtra( GuideInfoExtraKey.SEG_REMAIN_DIS, 0 ) );
|
||||
naviInfo.setCurStepRetainTime( intent.getIntExtra( GuideInfoExtraKey.SEG_REMAIN_TIME, 0 ) );
|
||||
naviInfo.setIconResId( IconTypeUtils.getResIdByIconType( context, intent.getIntExtra( GuideInfoExtraKey.NEW_ICON, 0 ) ) );
|
||||
naviInfo.setNextRoadName( intent.getStringExtra( GuideInfoExtraKey.NEXT_ROAD_NAME ) );
|
||||
naviInfo.setPathRetainDistance( intent.getIntExtra( GuideInfoExtraKey.ROUTE_REMAIN_DIS, 0 ) );
|
||||
naviInfo.setPathRetainTime( intent.getIntExtra( GuideInfoExtraKey.ROUTE_REMAIN_TIME, 0 ) );
|
||||
MogoNaviListenerHandler.getInstance().onNaviInfoUpdate( naviInfo );
|
||||
}
|
||||
MogoTraffic mogoTraffic = new MogoTraffic( MapState.getInstance().isAimless() ? MogoTraffic.TYPE_AIM : MogoTraffic.TYPE_NAVI );
|
||||
mogoTraffic.setDistance( cameraDisc );
|
||||
mogoTraffic.setSpeedLimit( cameraSpeed );
|
||||
mogoTraffic.setTrafficType( cameraType );
|
||||
MogoNaviListenerHandler.getInstance().onUpdateTraffic2( mogoTraffic );
|
||||
}
|
||||
|
||||
/**
|
||||
* 当导航发生状态变更时,将相应的状态通知给系统。
|
||||
*
|
||||
* @param state
|
||||
*/
|
||||
private void handleMapStatusChanged( int state ) {
|
||||
if ( state == -1 ) {
|
||||
return;
|
||||
}
|
||||
Logger.d( TAG, "map status: state = %d", state );
|
||||
switch ( state ) {
|
||||
case MapStateValue.START_NAVI:
|
||||
case MapStateValue.START_EMULATOR_NAVI:
|
||||
MapState.getInstance().setNaving( true );
|
||||
MogoNaviListenerHandler.getInstance().onStartNavi();
|
||||
break;
|
||||
case MapStateValue.STOP_NAVI:
|
||||
case MapStateValue.STOP_EMULATOR_NAVI:
|
||||
MapState.getInstance().setNaving( false );
|
||||
MogoNaviListenerHandler.getInstance().onStopNavi();
|
||||
break;
|
||||
case MapStateValue.START_AIMLESS_NAVI:
|
||||
MapState.getInstance().setAimless( true );
|
||||
break;
|
||||
case MapStateValue.STOP_AIMLESS_NAVI:
|
||||
MapState.getInstance().setAimless( false );
|
||||
break;
|
||||
case MapStateValue.EXIT_APP:
|
||||
break;
|
||||
case MapStateValue.DESTINATION:
|
||||
MogoNaviListenerHandler.getInstance().onArriveDestination();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,4 +109,21 @@ public class GuideInfoExtraKey {
|
||||
* 距离下下个路口剩余时间,对应的值为int类型,单位:秒
|
||||
*/
|
||||
public static final String NEXT_SEG_REMAIN_TIME = "NEXT_SEG_REMAIN_TIME";
|
||||
|
||||
/**
|
||||
* 距离最近的电子眼距离,对应的值为int类型,单位:米
|
||||
*/
|
||||
public static final String CAMERA_DIST = "CAMERA_DIST";
|
||||
|
||||
/**
|
||||
* 电子眼类型,对应的值为int类型
|
||||
* 0 测速摄像头
|
||||
* 1为监控摄像头
|
||||
* 2为闯红灯拍照
|
||||
* 3为违章拍照
|
||||
* 4为公交专用道摄像头
|
||||
* 5为应急车道摄像头
|
||||
* 6为非机动车道拍照
|
||||
*/
|
||||
public static final String CAMERA_TYPE = "CAMERA_TYPE";
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
public
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/3
|
||||
*
|
||||
* 高德地图状态
|
||||
*/
|
||||
class MapState {
|
||||
|
||||
private static volatile MapState sInstance;
|
||||
|
||||
private MapState() {
|
||||
}
|
||||
|
||||
public static MapState getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( MapState.class ) {
|
||||
if ( sInstance == null ) {
|
||||
sInstance = new MapState();
|
||||
}
|
||||
}
|
||||
}
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public synchronized void release() {
|
||||
sInstance = null;
|
||||
}
|
||||
|
||||
private boolean isNaving = false;
|
||||
private boolean isAimless = false;
|
||||
|
||||
public boolean isNaving() {
|
||||
return isNaving;
|
||||
}
|
||||
|
||||
public void setNaving( boolean naving ) {
|
||||
isNaving = naving;
|
||||
}
|
||||
|
||||
public boolean isAimless() {
|
||||
return isAimless;
|
||||
}
|
||||
|
||||
public void setAimless( boolean aimless ) {
|
||||
isAimless = aimless;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mogo.map.impl.automap.navi;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020/6/3
|
||||
* <p>
|
||||
* 高德公版地图状态值
|
||||
*/
|
||||
public interface MapStateValue {
|
||||
|
||||
int START_NAVI = 8;
|
||||
|
||||
int STOP_NAVI = 9;
|
||||
|
||||
int START_EMULATOR_NAVI = 10;
|
||||
|
||||
int STOP_EMULATOR_NAVI = 12;
|
||||
|
||||
int START_AIMLESS_NAVI = 24;
|
||||
|
||||
int STOP_AIMLESS_NAVI = 25;
|
||||
|
||||
int EXIT_APP = 45;
|
||||
|
||||
int DESTINATION = 39;
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package com.mogo.map.navi;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
* @since 2020-01-16
|
||||
|
||||
@@ -42,8 +42,10 @@ dependencies {
|
||||
annotationProcessor rootProject.ext.dependencies.aroutercompiler
|
||||
if (Boolean.valueOf(RELEASE)) {
|
||||
implementation rootProject.ext.dependencies.modulemain
|
||||
api rootProject.ext.dependencies.moduleapps
|
||||
} else {
|
||||
implementation project(":modules:mogo-module-main")
|
||||
api project(':modules:mogo-module-apps')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.zhidao.mogo.module.main.launcher;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -14,8 +15,35 @@ import com.mogo.utils.logger.Logger;
|
||||
*/
|
||||
public class MainLauncherActivity extends MainActivity {
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
// Logger.d(TAG, "MainLauncherActivity onCreate()");
|
||||
protected void onCreate( @Nullable Bundle savedInstanceState ) {
|
||||
super.onCreate( savedInstanceState );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadContainerModules() {
|
||||
super.loadContainerModules();
|
||||
// 显示左边遮罩
|
||||
mLeftShadowFrame.setVisibility( View.VISIBLE );
|
||||
mMogoModuleHandler.loadAppsListModule( com.mogo.module.main.R.id.module_main_id_apps_fragment_container );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
super.initViews();
|
||||
mApps.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void hideLayout() {
|
||||
super.hideLayout();
|
||||
mApps.setVisibility( View.GONE );
|
||||
mLeftShadowFrame.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void showLayout() {
|
||||
super.showLayout();
|
||||
mApps.setVisibility( View.VISIBLE );
|
||||
mLeftShadowFrame.setVisibility( View.VISIBLE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<intent-filter>
|
||||
<!-- 一个新应用包已经安装在设备上,数据包括包名(最新安装的包程序不能接收到这个广播)-->
|
||||
<action android:name="android.intent.action.PACKAGE_ADDED" />
|
||||
<action android:name="android.intent.action.PACKAGE_INSTALL" />
|
||||
<!-- 一个新版本的应用安装到设备,替换之前已经存在的版本-->
|
||||
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||
<!-- 一个已存在的应用程序包已经从设备上移除,包括包名(正在被安装的包程序不能接收到这个广播)-->
|
||||
|
||||
@@ -421,6 +421,9 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
if ( naviinfo == null ) {
|
||||
return;
|
||||
}
|
||||
if ( mExitNavi.getVisibility() == View.GONE ) {
|
||||
onStartNavi();
|
||||
}
|
||||
mNaviInfo.notifyChanged( naviinfo );
|
||||
}
|
||||
|
||||
|
||||
@@ -92,21 +92,17 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
}
|
||||
|
||||
// 隐藏布局
|
||||
private void hideLayout() {
|
||||
protected void hideLayout() {
|
||||
mHeader.setVisibility( View.GONE );
|
||||
mApps.setVisibility( View.GONE );
|
||||
mEntrance.setVisibility( View.GONE );
|
||||
mFloatingLayout.setVisibility( View.GONE );
|
||||
mLeftShadowFrame.setVisibility( View.GONE );
|
||||
}
|
||||
|
||||
// 显示布局
|
||||
private void showLayout() {
|
||||
protected void showLayout() {
|
||||
mHeader.setVisibility( View.VISIBLE );
|
||||
mApps.setVisibility( View.VISIBLE );
|
||||
mEntrance.setVisibility( View.VISIBLE );
|
||||
mFloatingLayout.setVisibility( View.VISIBLE );
|
||||
mLeftShadowFrame.setVisibility( View.VISIBLE );
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -148,9 +144,6 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mPresenter.initADAS();
|
||||
hideCoverUpLayout();
|
||||
|
||||
// 显示左边遮罩
|
||||
mLeftShadowFrame.setVisibility( View.VISIBLE );
|
||||
|
||||
// 右移地图中心点
|
||||
mMogoMapUIController = mMogoMapService.getMapUIController();
|
||||
MapCenterPointStrategy.setMapCenterPointByScene( mMogoMapUIController, Scene.AIMLESS );
|
||||
@@ -179,8 +172,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mLocationClient.start( 2_000L );
|
||||
}
|
||||
|
||||
private void loadContainerModules() {
|
||||
mMogoModuleHandler.loadAppsListModule( R.id.module_main_id_apps_fragment_container );
|
||||
protected void loadContainerModules() {
|
||||
mMogoModuleHandler.loadExtensionsModule( R.id.module_main_id_header_fragment_container );
|
||||
mMogoModuleHandler.loadEntrancesModule( R.id.module_main_id_entrance_fragment_container );
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
android:id="@+id/module_main_id_map_left_shadow_frame"
|
||||
android:layout_width="@dimen/module_main_map_left_shadow_frame_width"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/module_main_dw_left_frame_bkg"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/module_main_dw_left_frame_bkg"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<!-- 时间、天气、消息 -->
|
||||
|
||||
@@ -46,14 +46,14 @@ public class MapBroadCastHelper implements IMogoStatusChangedListener {
|
||||
}
|
||||
|
||||
public void notifyXiaozhi( MogoNaviInfo naviinfo ) {
|
||||
Intent intent = new Intent( ACTION_NAV_SEND );
|
||||
intent.putExtra( "KEY_TYPE", 10001 );
|
||||
intent.putExtra( "NEXT_ROAD_NAME", naviinfo.getNextRoadName() );
|
||||
intent.putExtra( "ROUTE_REMAIN_TIME_AUTO", naviinfo.getVoiceRetainTime() );
|
||||
intent.putExtra( "ROUTE_REMAIN_DIS_AUTO", naviinfo.getVoiceRetainDistance() );
|
||||
intent.putExtra( "ICON", naviinfo.getIconResId() );
|
||||
mContext.sendBroadcast( intent );
|
||||
Log.v( "MapBroadCastHelper", "action=" + ACTION_NAV_SEND + " NaviInfo" );
|
||||
// Intent intent = new Intent( ACTION_NAV_SEND );
|
||||
// intent.putExtra( "KEY_TYPE", 10001 );
|
||||
// intent.putExtra( "NEXT_ROAD_NAME", naviinfo.getNextRoadName() );
|
||||
// intent.putExtra( "ROUTE_REMAIN_TIME_AUTO", naviinfo.getVoiceRetainTime() );
|
||||
// intent.putExtra( "ROUTE_REMAIN_DIS_AUTO", naviinfo.getVoiceRetainDistance() );
|
||||
// intent.putExtra( "ICON", naviinfo.getIconResId() );
|
||||
// mContext.sendBroadcast( intent );
|
||||
// Log.v( "MapBroadCastHelper", "action=" + ACTION_NAV_SEND + " NaviInfo" );
|
||||
}
|
||||
|
||||
|
||||
@@ -67,30 +67,30 @@ public class MapBroadCastHelper implements IMogoStatusChangedListener {
|
||||
}
|
||||
|
||||
public void mapFrount() {
|
||||
notifyXizhiNavStatus( STATUS_NAV_FRONT );
|
||||
// notifyXizhiNavStatus( STATUS_NAV_FRONT );
|
||||
}
|
||||
|
||||
public void mapBackground() {
|
||||
notifyXizhiNavStatus( STATUS_NAV_BACKGROUND );
|
||||
// notifyXizhiNavStatus( STATUS_NAV_BACKGROUND );
|
||||
}
|
||||
|
||||
public void startNavi() {
|
||||
notifyXizhiNavStatus( STATUS_NAV_START );
|
||||
// notifyXizhiNavStatus( STATUS_NAV_START );
|
||||
}
|
||||
|
||||
public void stopNavi() {
|
||||
notifyXizhiNavStatus( STATUS_NAV_STOP );
|
||||
// notifyXizhiNavStatus( STATUS_NAV_STOP );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStatusChanged( StatusDescriptor descriptor, boolean isTrue ) {
|
||||
if ( descriptor == StatusDescriptor.AI_ASSIST_READY ) {
|
||||
if ( isTrue ) {
|
||||
if ( AppUtils.isApplicationBroughtToBackground( mContext ) ) {
|
||||
mapBackground();
|
||||
} else {
|
||||
mapFrount();
|
||||
}
|
||||
// if ( AppUtils.isApplicationBroughtToBackground( mContext ) ) {
|
||||
// mapBackground();
|
||||
// } else {
|
||||
// mapFrount();
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,10 +116,10 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
onChangeDayNightMode( day_night_mode );
|
||||
//继续导航
|
||||
} else if ( key_type == 10049 ) {
|
||||
boolean extra_endurance_data = intent.getBooleanExtra( "EXTRA_ENDURANCE_DATA", false );
|
||||
if ( extra_endurance_data ) {
|
||||
onContinueNavigation();
|
||||
}
|
||||
// boolean extra_endurance_data = intent.getBooleanExtra( "EXTRA_ENDURANCE_DATA", false );
|
||||
// if ( extra_endurance_data ) {
|
||||
// onContinueNavigation();
|
||||
// }
|
||||
} else if ( key_type == 10006 ) {
|
||||
// 避免冲突,会同时发送两个广播,这里不操作。
|
||||
//int extra_is_show = intent.getIntExtra( "EXTRA_IS_SHOW", 0 );
|
||||
@@ -131,12 +131,12 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
} else if ( key_type == 10005 ) {
|
||||
int navi_route_prefer = intent.getIntExtra( "NAVI_ROUTE_PREFER", type );
|
||||
} else if ( key_type == 20009 ) {
|
||||
onOpenNavi();
|
||||
// onOpenNavi();
|
||||
} else if ( key_type == 10038 || key_type == 10007 ) {
|
||||
mLauncher.backToLauncher( getContext() );
|
||||
onChoosePath( intent, key_type );
|
||||
// mLauncher.backToLauncher( getContext() );
|
||||
// onChoosePath( intent, key_type );
|
||||
} else if ( key_type == 10021 ) {
|
||||
onStopNaviInternal();
|
||||
// onStopNaviInternal();
|
||||
} else if ( key_type == 10005 ) {
|
||||
// 仅在导航场景下,⽀持第三⽅进⾏路线偏好的重新选择。
|
||||
// 避免收费 | 1
|
||||
@@ -149,12 +149,12 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
// 不走高速躲避收费和拥堵 | 8
|
||||
// 高速优先 | 20
|
||||
// 躲避拥堵且高速优先 | 24
|
||||
int prefer = intent.getIntExtra( "NAVI_ROUTE_PREFER", 0 );
|
||||
MogoNaviConfig config = new MogoNaviConfig().congestion( prefer == 4 )
|
||||
.cost( prefer == 1 || prefer == 7 )
|
||||
.highSpeed( prefer == 20 )
|
||||
.avoidSpeed( prefer == 3 );
|
||||
mMogoMapService.getNavi( getContext() ).reCalculateRoute( config );
|
||||
// int prefer = intent.getIntExtra( "NAVI_ROUTE_PREFER", 0 );
|
||||
// MogoNaviConfig config = new MogoNaviConfig().congestion( prefer == 4 )
|
||||
// .cost( prefer == 1 || prefer == 7 )
|
||||
// .highSpeed( prefer == 20 )
|
||||
// .avoidSpeed( prefer == 3 );
|
||||
// mMogoMapService.getNavi( getContext() ).reCalculateRoute( config );
|
||||
|
||||
}
|
||||
}
|
||||
@@ -220,7 +220,6 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
} else {
|
||||
lat = intent.getDoubleExtra( "LAT", 0.0 );
|
||||
lon = intent.getDoubleExtra( "LON", 0.0 );
|
||||
|
||||
}
|
||||
mMogoSearchManager.calculatePath( new MogoLatLng( lat, lon ) );
|
||||
}
|
||||
@@ -280,16 +279,16 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
private void zoomMap( boolean zoomIn ) {
|
||||
boolean isLocked = mMogoMapService.getMapUIController().isCarLocked();
|
||||
MapControlResult result = mView.getUIController().changeZoom( zoomIn );
|
||||
if ( result == MapControlResult.TARGET ) {
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
if ( zoomIn ) {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "地图已是最大", VoicePreemptType.PREEMPT_TYPE_NEXT, null );
|
||||
} else {
|
||||
AIAssist.getInstance( getContext() ).speakTTSVoice( "地图已是最小", VoicePreemptType.PREEMPT_TYPE_NEXT, null );
|
||||
}
|
||||
}, 1_000L ); // 避免小智障播放完毕之前播报
|
||||
return;
|
||||
}
|
||||
// if ( result == MapControlResult.TARGET ) {
|
||||
// UiThreadHandler.postDelayed( () -> {
|
||||
// if ( zoomIn ) {
|
||||
// AIAssist.getInstance( getContext() ).speakTTSVoice( "地图已是最大", VoicePreemptType.PREEMPT_TYPE_NEXT, null );
|
||||
// } else {
|
||||
// AIAssist.getInstance( getContext() ).speakTTSVoice( "地图已是最小", VoicePreemptType.PREEMPT_TYPE_NEXT, null );
|
||||
// }
|
||||
// }, 1_000L ); // 避免小智障播放完毕之前播报
|
||||
// return;
|
||||
// }
|
||||
if ( isLocked ) {
|
||||
// 保持锁车状态
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
|
||||
@@ -143,6 +143,12 @@ public class MockIntentHandler implements IntentHandler {
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 13: {
|
||||
double lat = intent.getFloatExtra( "lat", 0.0f );
|
||||
double lon = intent.getFloatExtra( "lon", 0.0f );
|
||||
MarkerServiceHandler.getNavi().naviTo( new MogoLatLng( lat, lon ) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user