rc
This commit is contained in:
@@ -44,6 +44,7 @@ public abstract class MvpFragment< V extends IView, P extends Presenter< V > > e
|
||||
@Override
|
||||
public void onViewCreated( @NonNull View view, @Nullable Bundle savedInstanceState ) {
|
||||
super.onViewCreated( view, savedInstanceState );
|
||||
initViews(savedInstanceState);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,6 +67,7 @@ public abstract class MvpFragment< V extends IView, P extends Presenter< V > > e
|
||||
* presenter 生命周期错乱
|
||||
*/
|
||||
protected abstract void initViews();
|
||||
protected void initViews(Bundle savedInstanceState){}
|
||||
|
||||
/**
|
||||
* 创建 presenter 实例
|
||||
|
||||
@@ -155,6 +155,10 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
aMap.setOnCameraChangeListener( this );
|
||||
}
|
||||
AMapMessageManager.getInstance().registerAMapMessageListener( this );
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private Context getContext() {
|
||||
@@ -422,6 +426,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
mMapView.getMap().setMyLocationEnabled( true );
|
||||
MyLocationStyle style = mMapView.getMap().getMyLocationStyle();
|
||||
style.myLocationType( MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER );
|
||||
style.interval(1000);
|
||||
style.showMyLocation( visible );
|
||||
style.strokeColor( Color.TRANSPARENT );
|
||||
style.strokeWidth( 0 );
|
||||
style.showMyLocation(visible);
|
||||
@@ -461,7 +467,7 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
public void onNaviStarted() {
|
||||
if ( checkAMapView() ) {
|
||||
mMapView.setCarOverlayVisible( true );
|
||||
showMyLocation( false );
|
||||
//showMyLocation( false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class NaviClient implements IMogoNavi {
|
||||
|
||||
private NaviClient( Context context ) {
|
||||
mAMapNavi = AMapNavi.getInstance( context );
|
||||
mAMapNavi.setEmulatorNaviSpeed( 120 );
|
||||
//mAMapNavi.setEmulatorNaviSpeed( 120 );
|
||||
mAMapNavi.setUseInnerVoice( true );
|
||||
mAMapNaviListener = new NaviListenerAdapter( context, mAMapNavi, this );
|
||||
mAimlessModeListener = new AimlessModeListenerAdapter() {
|
||||
|
||||
@@ -62,6 +62,9 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
|
||||
mNaviOverlayHelper = new NaviOverlayHelper( mAMapNavi, AMapWrapper.getAMap(), mContext );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public void setNaviing( boolean mIsNaviing ) {
|
||||
this.mIsNaviing = mIsNaviing;
|
||||
}
|
||||
@@ -90,6 +93,7 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
|
||||
@Override
|
||||
public void onInitNaviSuccess() {
|
||||
MogoNaviListenerHandler.getInstance().onInitNaviSuccess();
|
||||
//mAMapNavi.startAimlessMode(AimLessMode.CAMERA_AND_SPECIALROAD_DETECTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -202,6 +206,7 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
|
||||
@Override
|
||||
public void onLocationChange( AMapNaviLocation aMapNaviLocation ) {
|
||||
super.onLocationChange( aMapNaviLocation );
|
||||
Logger.i( TAG, "onLocationChange" +aMapNaviLocation.getCoord().toString());
|
||||
mNaviOverlayHelper.handlePassedLocation( aMapNaviLocation );
|
||||
}
|
||||
|
||||
|
||||
BIN
libraries/map-amap/src/main/res/drawable-ldpi/ic_endpoint.png
Executable file → Normal file
BIN
libraries/map-amap/src/main/res/drawable-ldpi/ic_endpoint.png
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 482 B After Width: | Height: | Size: 516 B |
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_endpoint.png
Executable file → Normal file
BIN
libraries/map-amap/src/main/res/drawable-xhdpi/ic_endpoint.png
Executable file → Normal file
Binary file not shown.
|
Before Width: | Height: | Size: 788 B After Width: | Height: | Size: 804 B |
@@ -306,7 +306,7 @@ public class MainActivity extends MvpActivity< MainView, MainPresenter > impleme
|
||||
private void startLocation() {
|
||||
mLocationClient = mMogoMapService.getSingletonLocationClient( getApplicationContext() );
|
||||
mLocationClient.addLocationListener( this );
|
||||
mLocationClient.start(10_000L);
|
||||
mLocationClient.start(2_000L);
|
||||
}
|
||||
|
||||
private void loadContainerModules() {
|
||||
|
||||
@@ -31,7 +31,15 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
//mMogoMapView = findViewById( R.id.module_map_id_map );
|
||||
//mMogoMap = mMogoMapView.getMap();
|
||||
//mMogoMap.getUIController().showMyLocation( true );
|
||||
}
|
||||
|
||||
@Override protected void initViews(Bundle savedInstanceState) {
|
||||
super.initViews(savedInstanceState);
|
||||
mMogoMapView = findViewById( R.id.module_map_id_map );
|
||||
mMogoMapView.onCreate( savedInstanceState );
|
||||
mMogoMap = mMogoMapView.getMap();
|
||||
mMogoMap.getUIController().showMyLocation( true );
|
||||
}
|
||||
@@ -45,9 +53,9 @@ public class MapFragment extends MvpFragment< MapView, MapPresenter > implements
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
if ( mMogoMapView != null ) {
|
||||
mMogoMapView.onCreate( savedInstanceState );
|
||||
}
|
||||
//if ( mMogoMapView != null ) {
|
||||
// mMogoMapView.onCreate( savedInstanceState );
|
||||
//}
|
||||
initMapView();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user