opt
@@ -155,7 +155,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
mMapView.setRouteOverlayVisible( false );
|
||||
mMapView.setCarOverlayVisible( false );
|
||||
setUIMode(EnumMapUI.CarUp_2D, null);
|
||||
setUIMode( EnumMapUI.CarUp_2D, null );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
initMapView();
|
||||
initListeners();
|
||||
initMyLocation();
|
||||
initLocationSource();
|
||||
// initLocationSource();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +450,6 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if ( mMapView == null ) {
|
||||
Logger.e( TAG, "高德mapView实例为空,请检查" );
|
||||
@@ -467,22 +466,17 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
return;
|
||||
}
|
||||
loseLockMode();
|
||||
mMapView.getMap()
|
||||
.moveCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) );
|
||||
mMapView.getMap().moveCamera( CameraUpdateFactory.newLatLng( new LatLng( latLng.lat, latLng.lng ) ) );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
Logger.d( TAG, "showMyLocation1" );
|
||||
Logger.d( TAG, "showMyLocation1 %s", visible );
|
||||
if ( visible && NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
return;
|
||||
}
|
||||
if ( checkAMapView() ) {
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
|
||||
if ( visible ) {
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
style.showMyLocation( visible );
|
||||
if ( visible ) {
|
||||
// 强制刷新一遍车标
|
||||
@@ -492,19 +486,15 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
private View mCursorView;
|
||||
|
||||
@Override
|
||||
public void showMyLocation( float degree ) {
|
||||
public void showMyLocation( View view ) {
|
||||
if ( NaviClient.getInstance( getContext() ).isNaviing() ) {
|
||||
return;
|
||||
}
|
||||
if ( checkAMapView() ) {
|
||||
mCursorView = View.inflate( getContext(), R.layout.map_amap_cursor, null );
|
||||
mCursorView.setRotation( degree );
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
style.showMyLocation( true );
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromView( mCursorView ) );
|
||||
style.myLocationIcon( BitmapDescriptorFactory.fromView( view ) );
|
||||
mMapView.getMap().setMyLocationStyle( style );
|
||||
}
|
||||
}
|
||||
@@ -523,7 +513,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
private void initLocationSource(){
|
||||
private void initLocationSource() {
|
||||
if ( checkAMapView() ) {
|
||||
mMapView.getMap().setLocationSource( new LocationSource() {
|
||||
@Override
|
||||
|
||||
@@ -94,9 +94,9 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( float degree ) {
|
||||
public void showMyLocation( View view ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.showMyLocation( degree );
|
||||
mClient.showMyLocation( view );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,9 +56,10 @@ public interface IMogoMapUIController {
|
||||
void showMyLocation( boolean visible );
|
||||
|
||||
/**
|
||||
* @param degree 车标方向
|
||||
*
|
||||
* @param view
|
||||
*/
|
||||
void showMyLocation( float degree );
|
||||
void showMyLocation( View view );
|
||||
|
||||
/**
|
||||
* 以外部定位的方式改变当前位置
|
||||
|
||||
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 86 KiB |
@@ -88,9 +88,9 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( float degree ) {
|
||||
public void showMyLocation( View view ) {
|
||||
if ( mDelegate != null ) {
|
||||
mDelegate.showMyLocation( degree );
|
||||
mDelegate.showMyLocation( view );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,11 +59,10 @@ import java.util.List;
|
||||
* 描述:加载各个模块
|
||||
*/
|
||||
public class MainActivity extends MvpActivity< MainView, MainPresenter > implements MainView,
|
||||
IMogoLocationListener,
|
||||
IMogoMarkerClickListener, IMogoVoiceCmdCallBack {
|
||||
IMogoLocationListener,
|
||||
IMogoMarkerClickListener {
|
||||
|
||||
private static final String TAG = "MainActivity";
|
||||
private static final String BACK_CMD = "back";
|
||||
|
||||
private IMogoServiceApis mServiceApis;
|
||||
private IMogoMapService mMogoMapService;
|
||||
@@ -281,18 +280,11 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoFragmentManager.registerMainFragmentStackTransactionListener( ( size ) -> {
|
||||
if ( size == 0 ) {
|
||||
showLayout();
|
||||
|
||||
AIAssist.getInstance(getContext())
|
||||
.unregisterUnWakeupCommand(BACK_CMD);
|
||||
|
||||
} else if ( size == 1 ) {
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(BACK_CMD, new String[] { "关闭", "返回" }, this);
|
||||
|
||||
UiThreadHandler.postDelayed(new Runnable() {
|
||||
@Override public void run() {
|
||||
mMogoMapUIController.setPointToCenter(0.5,0.5);
|
||||
|
||||
UiThreadHandler.postDelayed( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mMogoMapUIController.setPointToCenter( 0.5, 0.5 );
|
||||
}
|
||||
}, 1000 );
|
||||
hideLayout();
|
||||
@@ -424,28 +416,4 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
mMogoFragmentManager = null;
|
||||
AIAssist.getInstance( this ).release();
|
||||
}
|
||||
|
||||
@Override public void onCmdSelected(String cmd) {
|
||||
|
||||
if (TextUtils.equals(BACK_CMD,cmd)) {
|
||||
mMogoFragmentManager.clearAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override public void onCmdAction(String speakText) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onCmdCancel(String speakText) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onSpeakEnd(String speakText) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onSpeakSelectTimeOut(String speakText) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import android.os.Message;
|
||||
import android.os.Trace;
|
||||
import android.text.TextUtils;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -48,6 +49,7 @@ import com.mogo.service.IMogoServiceApis;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.cardmanager.IMogoCardManager;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import com.mogo.service.fragmentmanager.IMogoFragmentManager;
|
||||
import com.mogo.service.intent.IMogoIntentListener;
|
||||
import com.mogo.service.intent.IMogoIntentManager;
|
||||
@@ -85,7 +87,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
IMogoStatusChangedListener,
|
||||
IMogoIntentListener,
|
||||
IMogoAimlessModeListener,
|
||||
IMogoVoiceCmdCallBack {
|
||||
IMogoVoiceCmdCallBack,
|
||||
FragmentStackTransactionListener {
|
||||
|
||||
private boolean mInternalUnWakeupRegisterStatus = false;
|
||||
|
||||
@@ -310,6 +313,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
mLauncher = apis.getLauncherApi();
|
||||
mFragmentManager = apis.getFragmentManagerApi();
|
||||
mCardManager = apis.getCardManagerApi();
|
||||
|
||||
mFragmentManager.addMainFragmentStackTransactionListener( this );
|
||||
initWorkThread();
|
||||
}
|
||||
|
||||
@@ -633,17 +638,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
case ADAS_UI:
|
||||
try {
|
||||
if ( isTrue ) {
|
||||
// ADAS 时,不在自动刷新打点策略
|
||||
stopAutoRefreshStrategy();
|
||||
// 清除所有的打点信息记录
|
||||
MarkerServiceHandler.getMapMarkerManager().alreadySmallMarker.clear();
|
||||
onAdasOn();
|
||||
} else {
|
||||
// 主动刷新
|
||||
refreshStrategy();
|
||||
// ADAS关闭后,打开打点策略
|
||||
if ( mAutoRefreshCallback != null ) {
|
||||
mAutoRefreshCallback.onSuccess();
|
||||
}
|
||||
onAdasClosed();
|
||||
}
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
@@ -659,6 +656,21 @@ public class MogoServices implements IMogoMapListener,
|
||||
}
|
||||
}
|
||||
|
||||
private void onAdasOn(){
|
||||
// ADAS 时,不在自动刷新打点策略
|
||||
stopAutoRefreshStrategy();
|
||||
// 清除所有的打点信息记录
|
||||
MarkerServiceHandler.getMapMarkerManager().alreadySmallMarker.clear();
|
||||
}
|
||||
|
||||
private void onAdasClosed(){
|
||||
refreshStrategy();
|
||||
// ADAS关闭后,打开打点策略
|
||||
if ( mAutoRefreshCallback != null ) {
|
||||
mAutoRefreshCallback.onSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
public void restartAutoRefreshAtTime( int time ) {
|
||||
if ( time < 0 ) {
|
||||
Logger.w( TAG, "ignore refresh request case time < 0" );
|
||||
@@ -798,6 +810,9 @@ public class MogoServices implements IMogoMapListener,
|
||||
} else if ( MogoReceiver.ACTION_VOICE_READY.equals( command ) ) {
|
||||
AIAssist.getInstance( mContext ).flush();
|
||||
} else if ( ServiceConst.COMMAND_MY_LOCATION.equals( command ) ) {
|
||||
if ( mStatusManager.isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
mUiController.recoverLockMode();
|
||||
}
|
||||
@@ -853,10 +868,17 @@ public class MogoServices implements IMogoMapListener,
|
||||
return;
|
||||
}
|
||||
UiThreadHandler.post( () -> {
|
||||
mUiController.showMyLocation( ( ( float ) degree ) );
|
||||
|
||||
mUiController.showMyLocation( inflateCursorView( degree ) );
|
||||
} );
|
||||
}
|
||||
|
||||
private View inflateCursorView( double degree ) {
|
||||
View view = View.inflate( mContext, R.layout.map_amap_cursor, null );
|
||||
view.setRotation( ( float ) degree );
|
||||
return view;
|
||||
}
|
||||
|
||||
private void changeMyLocation( CarStateInfo.ValuesBean valuesBean ) {
|
||||
if ( valuesBean == null ) {
|
||||
return;
|
||||
@@ -903,6 +925,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
if ( mStatusManager.isMainPageOnResume() ) {
|
||||
mUiController.recoverLockMode();
|
||||
}
|
||||
} else if ( TextUtils.equals( ServiceConst.CMD_BACK, cmd ) ) {
|
||||
mFragmentManager.clearAll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -925,4 +949,13 @@ public class MogoServices implements IMogoMapListener,
|
||||
public void onSpeakSelectTimeOut( String speakText ) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTransaction( int size ) {
|
||||
if ( size == 0 ) {
|
||||
AIAssist.getInstance( mContext ).unregisterUnWakeupCommand( ServiceConst.CMD_BACK );
|
||||
} else {
|
||||
AIAssist.getInstance( mContext ).registerUnWakeupCommand( ServiceConst.CMD_BACK, ServiceConst.CMD_BACK_WORDS, this );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,5 +149,8 @@ public class ServiceConst {
|
||||
"定位我的位置"
|
||||
};
|
||||
|
||||
public static final String CMD_BACK = "back";
|
||||
public static final String[] CMD_BACK_WORDS = new String[]{"关闭", "返回"};
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -340,6 +340,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
|
||||
mLastDataResult = response.getResult();
|
||||
@@ -392,6 +396,10 @@ public class MapMarkerManager implements IMogoMarkerClickListener,
|
||||
return;
|
||||
}
|
||||
|
||||
if ( MarkerServiceHandler.getMogoStatusManager().isSearchUIShow() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( TextUtils.isEmpty( mCurrentModuleName ) ) {
|
||||
// 默认大而全
|
||||
mCurrentModuleName = ServiceConst.CARD_TYPE_BUSINESS_OPERATION;
|
||||
|
||||
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 126 KiB After Width: | Height: | Size: 126 KiB |
@@ -6,8 +6,13 @@ import android.content.Intent;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.AbsMogoApplication;
|
||||
import com.mogo.map.MogoOverlayManager;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.adas.IMogoADASController;
|
||||
import com.mogo.service.impl.MogoServiceApis;
|
||||
import com.mogo.service.impl.singleton.SingletonsHolder;
|
||||
import com.mogo.service.impl.statusmanager.MogoStatusManager;
|
||||
import com.mogo.service.statusmanager.IMogoStatusManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import org.json.JSONObject;
|
||||
@@ -33,8 +38,15 @@ public class MogoADASController implements IMogoADASController {
|
||||
public static final String VAL_OPEN = "打开";
|
||||
public static final String VAL_CLOSE = "关闭";
|
||||
|
||||
private MogoStatusManager mStatusManager = SingletonsHolder.get( IMogoStatusManager.class );
|
||||
|
||||
@Override
|
||||
public void openADAS() {
|
||||
|
||||
if ( mStatusManager.isADASShow() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent( ACTION );
|
||||
intent.putExtra( PARAM_COMMAND, VAL_COMMAND );
|
||||
JSONObject object = new JSONObject();
|
||||
@@ -50,6 +62,11 @@ public class MogoADASController implements IMogoADASController {
|
||||
|
||||
@Override
|
||||
public void closeADAS() {
|
||||
|
||||
if ( !mStatusManager.isADASShow() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
Intent intent = new Intent( ACTION );
|
||||
intent.putExtra( PARAM_COMMAND, VAL_COMMAND );
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||