rc
This commit is contained in:
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -417,6 +417,8 @@ public class AMapNaviViewWrapper implements IMogoMapView,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private boolean checkAMapView() {
|
||||
if ( mMapView == null ) {
|
||||
Logger.e( TAG, "高德mapView实例为空,请检查" );
|
||||
|
||||
@@ -31,9 +31,9 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
public static AMapUIController getInstance() {
|
||||
if ( sInstance == null ) {
|
||||
synchronized ( AMapUIController.class ) {
|
||||
if ( sInstance == null ) {
|
||||
if (sInstance == null) {
|
||||
synchronized (AMapUIController.class) {
|
||||
if (sInstance == null) {
|
||||
sInstance = new AMapUIController();
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
public void initClient( IMogoMapUIController client ) {
|
||||
public void initClient(IMogoMapUIController client) {
|
||||
this.mClient = client;
|
||||
}
|
||||
|
||||
@@ -50,50 +50,50 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTrafficEnabled( boolean visible ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.setTrafficEnabled( visible );
|
||||
public void setTrafficEnabled(boolean visible) {
|
||||
if (mClient != null) {
|
||||
mClient.setTrafficEnabled(visible);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom( boolean zoom ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.changeZoom( zoom );
|
||||
public void changeZoom(boolean zoom) {
|
||||
if (mClient != null) {
|
||||
mClient.changeZoom(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeZoom( float zoom ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.changeZoom( zoom );
|
||||
public void changeZoom(float zoom) {
|
||||
if (mClient != null) {
|
||||
mClient.changeZoom(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeMapMode( EnumMapUI mode ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.changeMapMode( mode );
|
||||
public void changeMapMode(EnumMapUI mode) {
|
||||
if (mClient != null) {
|
||||
mClient.changeMapMode(mode);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void moveToCenter( MogoLatLng latLng ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.moveToCenter( latLng );
|
||||
public void moveToCenter(MogoLatLng latLng) {
|
||||
if (mClient != null) {
|
||||
mClient.moveToCenter(latLng);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showMyLocation( boolean visible ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.showMyLocation( visible );
|
||||
public void showMyLocation(boolean visible) {
|
||||
if (mClient != null) {
|
||||
mClient.showMyLocation(visible);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recoverLockMode() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
mClient.recoverLockMode();
|
||||
}
|
||||
}
|
||||
@@ -107,21 +107,21 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void setLockZoom(int var1) {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
mClient.setLockZoom(var1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void displayOverview() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
mClient.displayOverview();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getScalePerPixel() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
return mClient.getScalePerPixel();
|
||||
}
|
||||
return 0;
|
||||
@@ -129,7 +129,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public float getZoomLevel() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
return mClient.getZoomLevel();
|
||||
}
|
||||
return 0;
|
||||
@@ -137,7 +137,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraNorthEastPosition() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
return mClient.getCameraNorthEastPosition();
|
||||
}
|
||||
return null;
|
||||
@@ -145,53 +145,54 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public MogoLatLng getCameraSouthWestPosition() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
return mClient.getCameraSouthWestPosition();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public MogoLatLng getWindowCenterLocation() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
return mClient.getWindowCenterLocation();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPointToCenter( double mapCenterX, double mapCenterY ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.setPointToCenter( mapCenterX, mapCenterY );
|
||||
public void setPointToCenter(double mapCenterX, double mapCenterY) {
|
||||
if (mClient != null) {
|
||||
mClient.setPointToCenter(mapCenterX, mapCenterY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Point getLocationPointInScreen( MogoLatLng latLng ) {
|
||||
if ( mClient != null ) {
|
||||
return mClient.getLocationPointInScreen( latLng );
|
||||
public Point getLocationPointInScreen(MogoLatLng latLng) {
|
||||
if (mClient != null) {
|
||||
return mClient.getLocationPointInScreen(latLng);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MogoLatLng getLocationMogoLatLngInScreen(Point point) {
|
||||
if ( mClient != null ) {
|
||||
return mClient.getLocationMogoLatLngInScreen( point );
|
||||
if (mClient != null) {
|
||||
return mClient.getLocationMogoLatLngInScreen(point);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, long duration ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.startJumpAnimation( marker, high, interpolator, duration );
|
||||
public void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
|
||||
long duration) {
|
||||
if (mClient != null) {
|
||||
mClient.startJumpAnimation(marker, high, interpolator, duration);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRenderFps( int fps ) {
|
||||
if ( mClient != null ) {
|
||||
mClient.setRenderFps( fps );
|
||||
public void setRenderFps(int fps) {
|
||||
if (mClient != null) {
|
||||
mClient.setRenderFps(fps);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +205,7 @@ public class AMapUIController implements IMogoMapUIController {
|
||||
|
||||
@Override
|
||||
public void forceRender() {
|
||||
if ( mClient != null ) {
|
||||
if (mClient != null) {
|
||||
mClient.forceRender();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,43 +19,39 @@ public interface IMogoMapUIController {
|
||||
|
||||
/**
|
||||
* 实时路况
|
||||
*
|
||||
* @param visible
|
||||
*/
|
||||
void setTrafficEnabled( boolean visible );
|
||||
void setTrafficEnabled(boolean visible);
|
||||
|
||||
/**
|
||||
* 地图缩放
|
||||
*
|
||||
* @param zoomIn true - 方法 false - 缩小
|
||||
*/
|
||||
void changeZoom( boolean zoomIn );
|
||||
void changeZoom(boolean zoomIn);
|
||||
|
||||
/**
|
||||
* 修改缩放级别
|
||||
*
|
||||
* @param zoom
|
||||
*/
|
||||
void changeZoom( float zoom );
|
||||
void changeZoom(float zoom);
|
||||
|
||||
/**
|
||||
* 切换2D/3D模式
|
||||
*
|
||||
* @param mode true - 3D模式 false - 2D模式
|
||||
*/
|
||||
void changeMapMode( EnumMapUI mode );
|
||||
void changeMapMode(EnumMapUI mode);
|
||||
|
||||
/**
|
||||
* 将地图移动至当前位置
|
||||
*/
|
||||
void moveToCenter( MogoLatLng latLng );
|
||||
void moveToCenter(MogoLatLng latLng);
|
||||
|
||||
/**
|
||||
* 显示我的位置
|
||||
*
|
||||
* @param visible true - 显示 false - 不显示
|
||||
*/
|
||||
void showMyLocation( boolean visible );
|
||||
void showMyLocation(boolean visible);
|
||||
|
||||
/**
|
||||
* 锁车
|
||||
@@ -72,7 +68,7 @@ public interface IMogoMapUIController {
|
||||
*
|
||||
* @param var1 级别 3-20
|
||||
*/
|
||||
void setLockZoom( int var1 );
|
||||
void setLockZoom(int var1);
|
||||
|
||||
/**
|
||||
* 预览全程
|
||||
@@ -88,29 +84,21 @@ public interface IMogoMapUIController {
|
||||
|
||||
/**
|
||||
* 获取缩放比例
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
float getZoomLevel();
|
||||
|
||||
/**
|
||||
* 获取视图东北角坐标
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng getCameraNorthEastPosition();
|
||||
|
||||
/**
|
||||
* 获取视图西南角坐标
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng getCameraSouthWestPosition();
|
||||
|
||||
/**
|
||||
* 获取视图中心点坐标
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng getWindowCenterLocation();
|
||||
|
||||
@@ -120,40 +108,33 @@ public interface IMogoMapUIController {
|
||||
* @param mapCenterX x 点位置x值与地图宽度的比例
|
||||
* @param mapCenterY y 点位置x值与地图高度的比例
|
||||
*/
|
||||
void setPointToCenter( double mapCenterX, double mapCenterY );
|
||||
void setPointToCenter(double mapCenterX, double mapCenterY);
|
||||
|
||||
/**
|
||||
* 获取经纬度对应的屏幕的位置
|
||||
*
|
||||
* @param latLng
|
||||
* @return
|
||||
*/
|
||||
Point getLocationPointInScreen( MogoLatLng latLng );
|
||||
Point getLocationPointInScreen(MogoLatLng latLng);
|
||||
|
||||
/**
|
||||
* 获取像素点对应的经纬度
|
||||
*
|
||||
* @param point
|
||||
* @return
|
||||
*/
|
||||
MogoLatLng getLocationMogoLatLngInScreen( Point point );
|
||||
MogoLatLng getLocationMogoLatLngInScreen(Point point);
|
||||
|
||||
/**
|
||||
* marker 跳跃动画
|
||||
*
|
||||
* @param marker 跳跃的 marker
|
||||
* @param high 跳跃的高度
|
||||
* @param marker 跳跃的 marker
|
||||
* @param high 跳跃的高度
|
||||
* @param interpolator 插值器
|
||||
* @param duration 动画时间
|
||||
* @param duration 动画时间
|
||||
*/
|
||||
void startJumpAnimation( IMogoMarker marker, float high, Interpolator interpolator, long duration );
|
||||
void startJumpAnimation(IMogoMarker marker, float high, Interpolator interpolator,
|
||||
long duration);
|
||||
|
||||
/**
|
||||
* 设置刷新帧率
|
||||
*
|
||||
* @param fps
|
||||
*/
|
||||
void setRenderFps( int fps );
|
||||
void setRenderFps(int fps);
|
||||
|
||||
/**
|
||||
* @param tag 调用业务
|
||||
|
||||
@@ -70,6 +70,7 @@ public class MogoMapUIController implements IMogoMapUIController {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void moveToCenter(MogoLatLng latLng) {
|
||||
if (mDelegate != null) {
|
||||
|
||||
@@ -32,4 +32,24 @@ public class ExtensionsModuleConst {
|
||||
public static final String CLOSE_PAGE = "com.zhidao.launcher.close.page";
|
||||
public static final String CLOSE = "com.zhidao.launcher.close";
|
||||
|
||||
|
||||
|
||||
public static final String[] CMD_UPLOAD_BLOCK = {"上报拥堵"};
|
||||
public static final String[] CMD_TRAFFIC_CHECK = {"上报交通检查"};
|
||||
public static final String[] CMD_ROAD_CLOSURE = {"上报封路"};
|
||||
|
||||
//上报拥堵
|
||||
public static final String UPLOAD_ROAD_BLOCK = "command_upload_block";
|
||||
//上报交通检查
|
||||
public static final String UPLOAD_TRAFFIC_CHECK = "command_upload_traffic_check";
|
||||
//上报封路
|
||||
public static final String UPLOAD_ROAD_CLOSURE = "command_upload_road_closure";
|
||||
|
||||
//埋点
|
||||
//分享分类 1:路况,2:油价,3:交通检查,4:封路
|
||||
public static final String LAUNCHER_SHARE_TYPE = "Launcher_Share_type";
|
||||
//分享/上报按钮点击 from=1 手动点击 from=2 语音打开
|
||||
public static final String LAUNCHER_SHARE_CLICK = "Launcher_Share_Click";
|
||||
public static final String CARNET_USER_UPLOAD = "CarNet_user_upload";
|
||||
|
||||
}
|
||||
|
||||
@@ -50,8 +50,9 @@ import java.util.Map;
|
||||
* <p>
|
||||
* 描述
|
||||
*/
|
||||
public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresenter > implements EntranceView,
|
||||
IMogoNaviListener, IMogoMapListener {
|
||||
public class EntranceFragment extends MvpFragment<EntranceView, EntrancePresenter>
|
||||
implements EntranceView,
|
||||
IMogoNaviListener, IMogoMapListener {
|
||||
|
||||
private static final String TAG = "EntranceFragment";
|
||||
|
||||
@@ -90,6 +91,7 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
*/
|
||||
private IMogoModuleProvider mSearchProvider;
|
||||
private boolean mIsLock = true;
|
||||
private TextView ivMode;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
@@ -98,28 +100,37 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
|
||||
@Override
|
||||
protected void initViews() {
|
||||
mMogoFragmentManager = ( IMogoFragmentManager ) ARouter.getInstance().build( MogoServicePaths.PATH_FRAGMENT_MANAGER ).navigation();
|
||||
mMogoAddressManager = ( IMogoAddressManager ) ARouter.getInstance().build( MogoServicePaths.PATH_ADDRESS_MANAGER ).navigation();
|
||||
mMogoFragmentManager = (IMogoFragmentManager) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_FRAGMENT_MANAGER)
|
||||
.navigation();
|
||||
mMogoAddressManager = (IMogoAddressManager) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_ADDRESS_MANAGER)
|
||||
.navigation();
|
||||
|
||||
mCommonAddress = findViewById( R.id.module_entrance_id_common_address );
|
||||
mCommonAddress = findViewById(R.id.module_entrance_id_common_address);
|
||||
|
||||
mSearch = findViewById( R.id.module_entrance_id_search );
|
||||
mSearch = findViewById(R.id.module_entrance_id_search);
|
||||
|
||||
mSearch.setOnClickListener( view -> {
|
||||
mSearchProvider = ( IMogoModuleProvider ) ARouter.getInstance().build( MogoModulePaths.PATH_MODULE_SEARCH ).navigation();
|
||||
final Fragment fragment = mSearchProvider.createFragment( getContext(), null );
|
||||
mMogoFragmentManager.push( new FragmentDescriptor.Builder().fragment( fragment ).tag( MogoModulePaths.PATH_FRAGMENT_SEARCH ).notifyMainModule( true ).build() );
|
||||
} );
|
||||
mSearch.setOnClickListener(view -> {
|
||||
mSearchProvider = (IMogoModuleProvider) ARouter.getInstance()
|
||||
.build(MogoModulePaths.PATH_MODULE_SEARCH)
|
||||
.navigation();
|
||||
final Fragment fragment = mSearchProvider.createFragment(getContext(), null);
|
||||
mMogoFragmentManager.push(new FragmentDescriptor.Builder().fragment(fragment)
|
||||
.tag(MogoModulePaths.PATH_FRAGMENT_SEARCH)
|
||||
.notifyMainModule(true)
|
||||
.build());
|
||||
});
|
||||
|
||||
mHome = findViewById( R.id.module_entrance_id_home );
|
||||
mHome.setOnClickListener( view -> {
|
||||
mHome = findViewById(R.id.module_entrance_id_home);
|
||||
mHome.setOnClickListener(view -> {
|
||||
mMogoAddressManager.goHome();
|
||||
} );
|
||||
});
|
||||
|
||||
mCompany = findViewById( R.id.module_entrance_id_company );
|
||||
mCompany.setOnClickListener( view -> {
|
||||
mCompany = findViewById(R.id.module_entrance_id_company);
|
||||
mCompany.setOnClickListener(view -> {
|
||||
mMogoAddressManager.goCompany();
|
||||
} );
|
||||
});
|
||||
|
||||
mUploadRoadCondition = findViewById( R.id.module_entrance_id_upload_road_condition );
|
||||
mUploadRoadCondition.setOnClickListener( view -> {
|
||||
@@ -130,59 +141,80 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
mVRMode.setOnClickListener( view -> {
|
||||
} );
|
||||
|
||||
mMove2CurrentLocation = findViewById( R.id.module_entrance_id_move2_current_location );
|
||||
mMove2CurrentLocation.setOnClickListener( view -> {
|
||||
mMove2CurrentLocation = findViewById(R.id.module_entrance_id_move2_current_location);
|
||||
mMove2CurrentLocation.setOnClickListener(view -> {
|
||||
final MogoLocation location = mMogoLocationClient.getLastKnowLocation();
|
||||
if ( location != null ) {
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
mMApUIController.changeZoom( 16.0f );
|
||||
mMogoStatusManager.setUserInteractionStatus( TAG, true, false );
|
||||
if (location != null) {
|
||||
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
mMApUIController.changeZoom(16.0f);
|
||||
mMogoStatusManager.setUserInteractionStatus(TAG, true, false);
|
||||
mMApUIController.recoverLockMode();
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
mNaviInfo = findViewById( R.id.module_entrance_id_navi_info_panel );
|
||||
mExitNavi = findViewById( R.id.module_entrance_id_exit_navi );
|
||||
mExitNavi.setOnClickListener( view -> {
|
||||
if ( mMogoNavi != null ) {
|
||||
mNaviInfo = findViewById(R.id.module_entrance_id_navi_info_panel);
|
||||
mExitNavi = findViewById(R.id.module_entrance_id_exit_navi);
|
||||
mExitNavi.setOnClickListener(view -> {
|
||||
if (mMogoNavi != null) {
|
||||
//if ( mIsLock ) {
|
||||
NaviNoticeDialog naviNoticeDialog = new NaviNoticeDialog( getContext() );
|
||||
NaviNoticeDialog naviNoticeDialog = new NaviNoticeDialog(getContext());
|
||||
naviNoticeDialog.show();
|
||||
//} else {
|
||||
// mMApUIController.recoverLockMode();
|
||||
//}
|
||||
}
|
||||
} );
|
||||
});
|
||||
|
||||
mSpeedLimit = findViewById( R.id.module_entrance_id_speed_limit_container );
|
||||
mSpeedLimitValue = findViewById( R.id.module_entrance_id_speed_limit_value );
|
||||
mSpeedLimitUnit = findViewById( R.id.module_entrance_id_speed_limit_unit );
|
||||
ivMode = findViewById(R.id.module_ext_id_north);
|
||||
ivMode.setOnClickListener(new View.OnClickListener() {
|
||||
@Override public void onClick(View v) {
|
||||
if (ivMode.isSelected()) {
|
||||
mMApUIController.changeMapMode(EnumMapUI.CarUp_2D);
|
||||
} else {
|
||||
mMApUIController.changeMapMode(EnumMapUI.NorthUP_2D);
|
||||
}
|
||||
ivMode.setSelected(!ivMode.isSelected());
|
||||
ivMode.setText(
|
||||
getString(ivMode.isSelected() ? R.string.mode_car_up : R.string.mode_north_up));
|
||||
}
|
||||
});
|
||||
|
||||
mSpeedLimit = findViewById(R.id.module_entrance_id_speed_limit_container);
|
||||
mSpeedLimitValue = findViewById(R.id.module_entrance_id_speed_limit_value);
|
||||
mSpeedLimitUnit = findViewById(R.id.module_entrance_id_speed_limit_unit);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected EntrancePresenter createPresenter() {
|
||||
return new EntrancePresenter( getContext(), this );
|
||||
return new EntrancePresenter(getContext(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated( @Nullable Bundle savedInstanceState ) {
|
||||
super.onActivityCreated( savedInstanceState );
|
||||
mService = ( IMogoMapService ) ARouter.getInstance().build( MogoServicePaths.PATH_SERVICES_MAP ).navigation( getContext() );
|
||||
mMogoRegisterCenter = ( IMogoRegisterCenter ) ARouter.getInstance().build( MogoServicePaths.PATH_REGISTER_CENTER ).navigation( getContext() );
|
||||
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
mService = (IMogoMapService) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_SERVICES_MAP)
|
||||
.navigation(getContext());
|
||||
mMogoRegisterCenter = (IMogoRegisterCenter) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_REGISTER_CENTER)
|
||||
.navigation(getContext());
|
||||
mMApUIController = mService.getMapUIController();
|
||||
mMogoLocationClient = mService.getSingletonLocationClient( getContext() );
|
||||
mMogoNavi = mService.getNavi( getContext() );
|
||||
mAnalytics = ( IMogoAnalytics ) ARouter.getInstance().build( MogoServicePaths.PATH_UTILS_ANALYTICS ).navigation( getContext() );
|
||||
mMogoStatusManager = ( IMogoStatusManager ) ARouter.getInstance().build( MogoServicePaths.PATH_STATUS_MANAGER ).navigation( getContext() );
|
||||
mMogoLocationClient = mService.getSingletonLocationClient(getContext());
|
||||
mMogoNavi = mService.getNavi(getContext());
|
||||
mAnalytics = (IMogoAnalytics) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_UTILS_ANALYTICS)
|
||||
.navigation(getContext());
|
||||
mMogoStatusManager = (IMogoStatusManager) ARouter.getInstance()
|
||||
.build(MogoServicePaths.PATH_STATUS_MANAGER)
|
||||
.navigation(getContext());
|
||||
|
||||
mMogoRegisterCenter.registerMogoNaviListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoMapListener( ExtensionsModuleConst.TYPE_ENTRANCE, this );
|
||||
mMogoRegisterCenter.registerMogoNaviListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
|
||||
mMogoRegisterCenter.registerMogoMapListener(ExtensionsModuleConst.TYPE_ENTRANCE, this);
|
||||
|
||||
mMogoMarkerManager = mService.getMarkerManager( getContext() );
|
||||
mMogoMarkerManager = mService.getMarkerManager(getContext());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onInitNaviFailure() {
|
||||
}
|
||||
@@ -192,28 +224,30 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNaviInfoUpdate( MogoNaviInfo naviinfo ) {
|
||||
if ( naviinfo == null ) {
|
||||
public void onNaviInfoUpdate(MogoNaviInfo naviinfo) {
|
||||
if (naviinfo == null) {
|
||||
return;
|
||||
}
|
||||
mNaviInfo.notifyChanged( naviinfo );
|
||||
mNaviInfo.notifyChanged(naviinfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartNavi() {
|
||||
mCommonAddress.setVisibility( View.GONE );
|
||||
mNaviInfo.setVisibility( View.VISIBLE );
|
||||
mExitNavi.setVisibility( View.VISIBLE );
|
||||
mMApUIController.setPointToCenter( 0.675926, 0.77552 );
|
||||
mCommonAddress.setVisibility(View.GONE);
|
||||
mNaviInfo.setVisibility(View.VISIBLE);
|
||||
ivMode.setVisibility(View.VISIBLE);
|
||||
mExitNavi.setVisibility(View.VISIBLE);
|
||||
mMApUIController.setPointToCenter(0.675926, 0.77552);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopNavi() {
|
||||
mCommonAddress.setVisibility( View.VISIBLE );
|
||||
mNaviInfo.setVisibility( View.GONE );
|
||||
mExitNavi.setVisibility( View.GONE );
|
||||
mSpeedLimit.setVisibility( View.GONE );
|
||||
mMApUIController.setPointToCenter( 0.66145, 0.590688 );
|
||||
mCommonAddress.setVisibility(View.VISIBLE);
|
||||
mNaviInfo.setVisibility(View.GONE);
|
||||
ivMode.setVisibility(View.GONE);
|
||||
mExitNavi.setVisibility(View.GONE);
|
||||
mSpeedLimit.setVisibility(View.GONE);
|
||||
mMApUIController.setPointToCenter(0.66145, 0.590688);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -225,16 +259,16 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateTraffic( MogoTraffic traffic ) {
|
||||
if ( traffic == null ) {
|
||||
public void onUpdateTraffic(MogoTraffic traffic) {
|
||||
if (traffic == null) {
|
||||
return;
|
||||
}
|
||||
if ( traffic.getSpeedLimit() <= 0 ) {
|
||||
mSpeedLimit.setVisibility( View.INVISIBLE );
|
||||
mSpeedLimitValue.setText( "--" );
|
||||
if (traffic.getSpeedLimit() <= 0) {
|
||||
mSpeedLimit.setVisibility(View.INVISIBLE);
|
||||
mSpeedLimitValue.setText("--");
|
||||
} else {
|
||||
mSpeedLimit.setVisibility( View.VISIBLE );
|
||||
mSpeedLimitValue.setText( String.valueOf( traffic.getSpeedLimit() ) );
|
||||
mSpeedLimit.setVisibility(View.VISIBLE);
|
||||
mSpeedLimitValue.setText(String.valueOf(traffic.getSpeedLimit()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,45 +278,43 @@ public class EntranceFragment extends MvpFragment< EntranceView, EntrancePresent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTouch( MotionEvent motionEvent ) {
|
||||
public void onTouch(MotionEvent motionEvent) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPOIClick( MogoPoi poi ) {
|
||||
public void onPOIClick(MogoPoi poi) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapClick( MogoLatLng latLng ) {
|
||||
public void onMapClick(MogoLatLng latLng) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLockMap( boolean isLock ) {
|
||||
public void onLockMap(boolean isLock) {
|
||||
mIsLock = isLock;
|
||||
if ( isLock ) {
|
||||
mExitNavi.setText( R.string.module_ext_str_exit_navi );
|
||||
if (isLock) {
|
||||
mExitNavi.setText(R.string.module_ext_str_exit_navi);
|
||||
} else {
|
||||
mExitNavi.setText( R.string.module_ext_str_exit_navi );
|
||||
mExitNavi.setText(R.string.module_ext_str_exit_navi);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
public void onMapModeChanged(EnumMapUI ui) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMapChanged( MogoLatLng latLng, float zoom, float tilt, float bearing ) {
|
||||
public void onMapChanged(MogoLatLng latLng, float zoom, float tilt, float bearing) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void traceData( String from ) {
|
||||
Map< String, Object > properties = new HashMap<>();
|
||||
properties.put( "from", from );
|
||||
mAnalytics.track( "Launcher_Share_Click", properties );
|
||||
private void traceData(String from) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("from", from);
|
||||
mAnalytics.track("Launcher_Share_Click", properties);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,20 @@
|
||||
package com.mogo.module.extensions.entrance;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.mogo.commons.mvp.Presenter;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.module.extensions.ExtensionsModuleConst;
|
||||
import com.mogo.module.share.ShareControl;
|
||||
import com.mogo.service.MogoServicePaths;
|
||||
import com.mogo.service.analytics.IMogoAnalytics;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author congtaowang
|
||||
@@ -16,10 +25,13 @@ import com.mogo.module.share.ShareControl;
|
||||
public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
|
||||
private Context mContext;
|
||||
private IMogoAnalytics mAnalytics;
|
||||
|
||||
public EntrancePresenter(Context context, EntranceView view) {
|
||||
super(view);
|
||||
mContext = context;
|
||||
mAnalytics = (IMogoAnalytics) ARouter.getInstance().build(MogoServicePaths.PATH_UTILS_ANALYTICS).navigation(getContext());
|
||||
|
||||
registerUnWake();
|
||||
}
|
||||
|
||||
@@ -28,6 +40,14 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
ExtensionsModuleConst.CMD_CLOSE, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.CANCLE_SHARE,
|
||||
ExtensionsModuleConst.CMD_CANCLE_SHARE, mogoVoiceListener);
|
||||
//探路相关上报
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK,
|
||||
ExtensionsModuleConst.CMD_UPLOAD_BLOCK, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK,
|
||||
ExtensionsModuleConst.CMD_TRAFFIC_CHECK, mogoVoiceListener);
|
||||
AIAssist.getInstance(mContext).registerUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE,
|
||||
ExtensionsModuleConst.CMD_ROAD_CLOSURE, mogoVoiceListener);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,6 +59,12 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
if (cmd.equals(ExtensionsModuleConst.CANCLE_SHARE)
|
||||
|| cmd.equals(ExtensionsModuleConst.CLOSE)) { //取消分享,关闭页面
|
||||
ShareControl.getInstance(mContext).dismissDialog();
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK)) { //上报拥堵
|
||||
uploadRoadCondition();
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK)) { //上报交通检查
|
||||
uploadTrfficCheck();
|
||||
} else if (cmd.equals(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE)) { //上报封路
|
||||
uploadRoadClosed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,9 +86,73 @@ public class EntrancePresenter extends Presenter<EntranceView> {
|
||||
};
|
||||
|
||||
|
||||
private void uploadRoadCondition() {
|
||||
traceTanluData("2");
|
||||
sendShareReceiver("1");
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 上报路况 ----> ");
|
||||
traceTypeData("1");
|
||||
ShareControl.getInstance(mContext).dismissDialog();
|
||||
}
|
||||
|
||||
private void uploadTrfficCheck() {
|
||||
sendShareReceiver("2");
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 分享交通检查 ----> ");
|
||||
traceTypeData("3");
|
||||
ShareControl.getInstance(mContext).dismissDialog();
|
||||
}
|
||||
|
||||
private void uploadRoadClosed() {
|
||||
sendShareReceiver("3");
|
||||
Logger.d("EntrancePresenter", "mogoIntentListener 分享封路 ----> ");
|
||||
traceTypeData("4");
|
||||
ShareControl.getInstance(mContext).dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送广播 1拥堵,2交通检查,3封路
|
||||
*/
|
||||
private void sendShareReceiver(String type) {
|
||||
Logger.d("EntrancePresenter", "TanluCardViewFragment sendShareReceiver ---->");
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("com.zhidao.roadcondition.share");
|
||||
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
||||
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
|
||||
intent.putExtra("type", type);
|
||||
getContext().sendBroadcast(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* type=1 路况
|
||||
* <p>
|
||||
* type=2 油价
|
||||
* <p>
|
||||
* type=3 交通检查
|
||||
* <p>
|
||||
* type=4 封路
|
||||
*
|
||||
* @param type
|
||||
*/
|
||||
private void traceTypeData(String type) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
mAnalytics.track(ExtensionsModuleConst.LAUNCHER_SHARE_TYPE, properties);
|
||||
}
|
||||
|
||||
private void traceTanluData(String type) {
|
||||
Map<String, Object> properties = new HashMap<>();
|
||||
properties.put("type", type);
|
||||
mAnalytics.track(ExtensionsModuleConst.CARNET_USER_UPLOAD, properties);
|
||||
}
|
||||
|
||||
|
||||
private void unregisterUnWake() {
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.CANCLE_SHARE);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.CLOSE);
|
||||
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_BLOCK);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_TRAFFIC_CHECK);
|
||||
AIAssist.getInstance(mContext).unregisterUnWakeupCommand(ExtensionsModuleConst.UPLOAD_ROAD_CLOSURE);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BIN
modules/mogo-module-extensions/src/main/res/drawable-ldpi/icon_car_up.png
Executable file
BIN
modules/mogo-module-extensions/src/main/res/drawable-ldpi/icon_car_up.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 577 B |
BIN
modules/mogo-module-extensions/src/main/res/drawable-ldpi/icon_north_up.png
Executable file
BIN
modules/mogo-module-extensions/src/main/res/drawable-ldpi/icon_north_up.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 316 B |
BIN
modules/mogo-module-extensions/src/main/res/drawable-xhdpi/icon_car_up.png
Executable file
BIN
modules/mogo-module-extensions/src/main/res/drawable-xhdpi/icon_car_up.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
modules/mogo-module-extensions/src/main/res/drawable-xhdpi/icon_north_up.png
Executable file
BIN
modules/mogo-module-extensions/src/main/res/drawable-xhdpi/icon_north_up.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 609 B |
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/icon_north_up" android:state_selected="true"/>
|
||||
<item android:drawable="@drawable/icon_north_up" android:state_checked="true"/>
|
||||
<item android:drawable="@drawable/icon_car_up"/>
|
||||
</selector>
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
|
||||
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#50526E"
|
||||
android:startColor="#3F4057" />
|
||||
<corners android:radius="@dimen/dp_15"/>
|
||||
|
||||
</shape>
|
||||
|
||||
@@ -112,6 +112,23 @@
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/module_ext_id_north"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:text="@string/mode_car_up"
|
||||
android:paddingTop="@dimen/dp_14"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_marginTop="@dimen/dp_33"
|
||||
android:background="@drawable/shape_react_gray_round"
|
||||
android:drawableTop="@drawable/selector_icon_north_up"
|
||||
app:layout_constraintTop_toBottomOf="@+id/module_entrance_id_navi_info_panel"
|
||||
app:layout_constraintLeft_toLeftOf="@+id/module_entrance_id_navi_info_panel"
|
||||
android:layout_height="@dimen/dp_120"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/module_entrance_id_operation_panel"
|
||||
android:layout_width="@dimen/module_ext_operation_panel_width"
|
||||
|
||||
@@ -20,8 +20,10 @@
|
||||
<string name="module_ext_str_exit_navi">退出导航</string>
|
||||
<string name="module_ext_str_continue_navi">继续导航</string>
|
||||
<string name="module_ext_str_exit_path">退出全览</string>
|
||||
<string name="mode_car_up">车头</string>
|
||||
<string name="mode_north_up">正北</string>
|
||||
|
||||
<string-array name="module_ext_str_arr_ai_tips">
|
||||
<string-array name="module_ext_str_arr_ai_tips">
|
||||
<item>你好小智,播放音乐</item>
|
||||
<item>你好小智,我要听音乐</item>
|
||||
<item>你好小智,播放赵磊的歌</item>
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.module.navi.constants.SearchServiceHolder
|
||||
import com.mogo.module.navi.ui.search.ChoosePathFragment
|
||||
import com.mogo.utils.logger.Logger
|
||||
import androidx.core.content.ContextCompat.startActivity
|
||||
import com.mogo.map.navi.MogoNaviConfig
|
||||
import com.mogo.module.navi.ui.search.SearchFragment
|
||||
import com.mogo.service.fragmentmanager.FragmentDescriptor
|
||||
|
||||
@@ -20,27 +21,27 @@ import com.mogo.service.fragmentmanager.FragmentDescriptor
|
||||
* 2020-01-18.
|
||||
*/
|
||||
object NaviManager {
|
||||
private lateinit var mReceiver:BroadcastReceiver
|
||||
private lateinit var mReceiver: BroadcastReceiver
|
||||
private val AUTONAVI_STANDARD_BROADCAST_RECV = "AUTONAVI_STANDARD_BROADCAST_RECV"
|
||||
|
||||
fun init(context: Context){
|
||||
fun init(context: Context) {
|
||||
mReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(
|
||||
context: Context,
|
||||
intent: Intent
|
||||
) {
|
||||
val action = intent.action
|
||||
if (TextUtils.equals(action, AUTONAVI_STANDARD_BROADCAST_RECV)) {
|
||||
if (TextUtils.equals(action, AUTONAVI_STANDARD_BROADCAST_RECV)) {
|
||||
val key_type = intent.getIntExtra("KEY_TYPE", 0)
|
||||
Logger.d("NaviManager","key_type"+key_type,null)
|
||||
if (key_type == 10038||key_type == 10007) {
|
||||
Logger.d("NaviManager", "key_type" + key_type, null)
|
||||
if (key_type == 10038 || key_type == 10007) {
|
||||
val lat: Double
|
||||
val lon: Double
|
||||
|
||||
if (key_type==10007){
|
||||
if (key_type == 10007) {
|
||||
lat = intent.getDoubleExtra("ENTRY_LAT", 0.0)
|
||||
lon = intent.getDoubleExtra("ENTRY_LON", 0.0)
|
||||
}else{
|
||||
} else {
|
||||
lat = intent.getDoubleExtra("LAT", 0.0)
|
||||
lon = intent.getDoubleExtra("LON", 0.0)
|
||||
|
||||
@@ -49,14 +50,15 @@ object NaviManager {
|
||||
|
||||
var newInstance =
|
||||
ChoosePathFragment.newInstance(
|
||||
MogoLatLng(lat,lon)
|
||||
MogoLatLng(lat, lon)
|
||||
)
|
||||
SearchServiceHolder.push(
|
||||
newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT
|
||||
)
|
||||
}else if (key_type == 10021) {
|
||||
SearchServiceHolder.getNavi().stopNavi()
|
||||
}else if (key_type == 20009) {
|
||||
} else if (key_type == 10021) {
|
||||
SearchServiceHolder.getNavi()
|
||||
.stopNavi()
|
||||
} else if (key_type == 20009) {
|
||||
showHome()
|
||||
SearchServiceHolder.fragmentManager
|
||||
.clearAll()
|
||||
@@ -70,7 +72,23 @@ object NaviManager {
|
||||
.build()
|
||||
)
|
||||
|
||||
} else if (key_type == 10005) {
|
||||
|
||||
// * 仅在导航场景下,⽀持第三⽅进⾏路线偏好的重新选择。
|
||||
// * `避免收费` |`1` `多策略算路` |`2` `不走高速` |`3` ` 躲避拥堵` |`4` `不走高速且避免收费` |`5` `不走高速且躲避拥堵` |`6`
|
||||
// * `躲避收费和拥堵` |`7` `不走高速躲避收费和拥堵` |`8` `高速优先` |`20` `躲避拥堵且高速优先` |`24`
|
||||
// *
|
||||
var prefer = intent.getIntExtra("NAVI_ROUTE_PREFER", 0)
|
||||
|
||||
var avoidSpeed = MogoNaviConfig().congestion(prefer == 4)
|
||||
.cost(prefer == 1||prefer == 7)
|
||||
.highSpeed(prefer == 20)
|
||||
.avoidSpeed(prefer == 3)
|
||||
SearchServiceHolder.getNavi()
|
||||
.reCalculateRoute(avoidSpeed)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,9 +3,12 @@ package com.mogo.module.navi.ui.search
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.BitmapFactory
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.map.marker.IMogoMarker
|
||||
import com.mogo.map.marker.MogoMarkerOptions
|
||||
import com.mogo.map.search.geo.MogoPoiItem
|
||||
@@ -17,6 +20,7 @@ import com.mogo.module.navi.constants.SearchServiceHolder
|
||||
import com.mogo.module.navi.ui.adapter.SearchCategoryAdapter
|
||||
import com.mogo.module.navi.ui.base.BaseFragment
|
||||
import com.mogo.module.navi.uitls.BitmapUtils
|
||||
import com.mogo.module.navi.uitls.StringUtils
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.cv_search_result
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.et_navi_search
|
||||
import kotlinx.android.synthetic.main.fragment_search_category.iv_navi_back
|
||||
@@ -28,14 +32,36 @@ import kotlinx.android.synthetic.main.fragment_search_category.tv_navi_navi
|
||||
* @author zyz
|
||||
* 2020-01-09.
|
||||
*/
|
||||
class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
class CategorySearchFragment : BaseFragment(), CategoryView, IMogoVoiceCmdCallBack {
|
||||
override fun onCmdSelected(cmd: String?) {
|
||||
if (cmd?.startsWith("position") == true) {
|
||||
var index = cmd.substring(8)
|
||||
mAdapter.setCurrent(index.toInt())
|
||||
updateMarker()
|
||||
goPath()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCmdAction(speakText: String?) {
|
||||
}
|
||||
|
||||
override fun onCmdCancel(speakText: String?) {
|
||||
}
|
||||
|
||||
override fun onSpeakEnd(speakText: String?) {
|
||||
}
|
||||
|
||||
override fun onSpeakSelectTimeOut(speakText: String?) {
|
||||
}
|
||||
|
||||
private val TAG: String = "CategorySearchFragment"
|
||||
private var addMarkers: List<IMogoMarker>? = null
|
||||
|
||||
private lateinit var cmds: ArrayList<String>
|
||||
override fun renderSearchPoiResult(datums: List<MogoPoiItem>?) {
|
||||
mAdapter.setDatas(datums)
|
||||
cv_search_result.visibility = View.VISIBLE
|
||||
pb_path.visibility=View.GONE
|
||||
pb_path.visibility = View.GONE
|
||||
var arrayList = ArrayList<MogoMarkerOptions>()
|
||||
for (index in 0 until datums!!.size) {
|
||||
var decodeResource =
|
||||
@@ -55,14 +81,19 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
// .anchor(0.5f, 1f)
|
||||
.longitude(datums[index].point?.lng ?: 0.0)
|
||||
arrayList.add(options)
|
||||
|
||||
var int2String = StringUtils.int2String(index)
|
||||
AIAssist.getInstance(context)
|
||||
.registerUnWakeupCommand(
|
||||
"position" + index, arrayOf("第" + int2String + "个", "第" + int2String + "条"), this
|
||||
)
|
||||
cmds.add("position" + index)
|
||||
}
|
||||
addMarkers = SearchServiceHolder.getMarkerManger()
|
||||
.addMarkers(TAG, arrayList, true)
|
||||
moveMapToRight()
|
||||
}
|
||||
|
||||
|
||||
|
||||
private lateinit var mAdapter: SearchCategoryAdapter
|
||||
|
||||
private lateinit var mSearchPresenter: CategoryPresenter
|
||||
@@ -75,8 +106,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
)
|
||||
mSearchPresenter = CategoryPresenter(this)
|
||||
lifecycle.addObserver(mSearchPresenter)
|
||||
|
||||
|
||||
cmds=ArrayList<String>()
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@@ -104,16 +134,22 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
|
||||
tv_navi_navi.setOnClickListener {
|
||||
|
||||
var newInstance = ChoosePathFragment.newInstance(mAdapter.currentItem.point)
|
||||
|
||||
SearchServiceHolder.push(newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT)
|
||||
goPath()
|
||||
}
|
||||
mAdapter.setOnClickListener {
|
||||
var position = it.getTag(R.id.tag_position) as Int
|
||||
mAdapter.setCurrent(position)
|
||||
|
||||
updateMarker()
|
||||
}
|
||||
|
||||
AIAssist.getInstance(context)
|
||||
.registerUnWakeupCommand("back", arrayOf("关闭", "返回"), this)
|
||||
|
||||
}
|
||||
|
||||
private fun goPath() {
|
||||
var newInstance = ChoosePathFragment.newInstance(mAdapter.currentItem.point)
|
||||
SearchServiceHolder.push(newInstance, MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT)
|
||||
}
|
||||
|
||||
private fun updateMarker() {
|
||||
@@ -124,7 +160,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
?.setIcon(getMarkerIcon(mAdapter.current))
|
||||
}
|
||||
|
||||
private fun getMarkerIcon(index :Int): Bitmap {
|
||||
private fun getMarkerIcon(index: Int): Bitmap {
|
||||
var decodeResource =
|
||||
BitmapFactory.decodeResource(
|
||||
resources,
|
||||
@@ -133,7 +169,7 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
|
||||
var createWaterMask =
|
||||
BitmapUtils.createWaterMask(
|
||||
context, decodeResource, (index+1).toString(), R.color.white, 18
|
||||
context, decodeResource, (index + 1).toString(), R.color.white, 18
|
||||
)
|
||||
return createWaterMask
|
||||
}
|
||||
@@ -149,6 +185,10 @@ class CategorySearchFragment : BaseFragment(), CategoryView {
|
||||
lifecycle.removeObserver(mSearchPresenter)
|
||||
SearchServiceHolder.getMarkerManger()
|
||||
.removeMarkers(TAG)
|
||||
|
||||
cmds.forEach {
|
||||
AIAssist.getInstance(context).unregisterUnWakeupCommand(it)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -200,8 +200,6 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
||||
SearchServiceHolder.getMarkerManger()
|
||||
.removeMarkers()
|
||||
|
||||
|
||||
|
||||
AIAssist.getInstance(context)
|
||||
.registerUnWakeupCommand("firstPath", arrayOf<String>(firstPath), this)
|
||||
AIAssist.getInstance(context)
|
||||
@@ -210,8 +208,6 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
||||
.registerUnWakeupCommand("thirdPath", arrayOf<String>(thirdPath), this)
|
||||
AIAssist.getInstance(context)
|
||||
.registerUnWakeupCommand("startNavi", arrayOf<String>(startNavi), this)
|
||||
AIAssist.getInstance(context)
|
||||
.registerUnWakeupCommand("cancel", arrayOf<String>("取消", "退出", "返回", "退出导航", "取消导航"), this)
|
||||
|
||||
}
|
||||
|
||||
@@ -255,8 +251,7 @@ class ChoosePathFragment : BaseFragment(), IMogoNaviListener, IMogoVoiceCmdCallB
|
||||
.unregisterUnWakeupCommand("thirdPath")
|
||||
AIAssist.getInstance(context)
|
||||
.unregisterUnWakeupCommand("startNavi")
|
||||
AIAssist.getInstance(context)
|
||||
.unregisterUnWakeupCommand("cancel")
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.mogo.module.navi.ui.search;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.os.health.ServiceHealthStats;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -11,6 +13,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.commons.analytics.AnalyticsUtils;
|
||||
import com.mogo.commons.voice.AIAssist;
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack;
|
||||
import com.mogo.map.search.inputtips.MogoTip;
|
||||
import com.mogo.module.common.MogoModulePaths;
|
||||
import com.mogo.module.navi.R;
|
||||
@@ -22,7 +26,9 @@ import com.mogo.module.navi.ui.adapter.HistoryPoiAdapter;
|
||||
import com.mogo.module.navi.ui.adapter.SearchPoiAdapter;
|
||||
import com.mogo.module.navi.ui.base.UiController;
|
||||
import com.mogo.module.navi.ui.setting.NaviSettingFragment;
|
||||
import com.mogo.module.navi.uitls.StringUtils;
|
||||
import com.mogo.service.fragmentmanager.FragmentDescriptor;
|
||||
import com.mogo.service.fragmentmanager.FragmentStackTransactionListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -38,7 +44,9 @@ import java.util.List;
|
||||
* {@link SearchConstants#SEARCH_TYPE_MULTI_HOME}
|
||||
*/
|
||||
@Route(path = MogoModulePaths.PATH_FRAGMENT_SEARCH)
|
||||
public class SearchFragment extends BaseSearchFragment implements SearchView, View.OnClickListener {
|
||||
public class SearchFragment extends BaseSearchFragment
|
||||
implements SearchView, View.OnClickListener, IMogoVoiceCmdCallBack,
|
||||
FragmentStackTransactionListener {
|
||||
|
||||
public static final String TAG = "search";
|
||||
|
||||
@@ -119,10 +127,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
SearchServiceHolder.INSTANCE.getAnalyticsManager()
|
||||
.track("Navigation_History_destination", new HashMap<String, Object>());
|
||||
SearchPoi item = (SearchPoi) v.getTag(R.id.tag_item);
|
||||
MogoTip mogoTip = EntityConvertUtils.poi2MogoTip(item);
|
||||
SearchServiceHolder.INSTANCE.push(
|
||||
ChoosePathFragment.Companion.newInstance(mogoTip.getPoint()),
|
||||
MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT);
|
||||
goHistory(item);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -131,8 +136,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
MogoTip tag = (MogoTip) v.getTag(R.id.tag_position);
|
||||
SearchPoi searchPoi = EntityConvertUtils.tipToPoi(tag);
|
||||
if (tag.getPoint() == null) {
|
||||
push(CategorySearchFragment.Companion.newInstance(tag.getName()),
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY);
|
||||
goCategory(tag.getName());
|
||||
} else {
|
||||
mSearchPresenter.insert(searchPoi);
|
||||
SearchServiceHolder.INSTANCE.push(
|
||||
@@ -150,10 +154,7 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
|
||||
findViewById(R.id.tv_navi_setting).setOnClickListener(new View.OnClickListener() {
|
||||
@Override public void onClick(View v) {
|
||||
SearchServiceHolder.INSTANCE.getAnalyticsManager()
|
||||
.track("Navigation_button_setting", new HashMap<String, Object>());
|
||||
|
||||
push(new NaviSettingFragment(), MogoModulePaths.PATH_FRAGMENT_SETTING);
|
||||
goSetting();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -183,6 +184,56 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
mSearchPresenter.startSearchPoiByInput(mSearchBox.getText().toString());
|
||||
}
|
||||
});
|
||||
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(BACK_CMD, new String[] { "关闭", "返回" }, this);
|
||||
}
|
||||
|
||||
private void goSetting() {
|
||||
SearchServiceHolder.INSTANCE.getAnalyticsManager()
|
||||
.track("Navigation_button_setting", new HashMap<String, Object>());
|
||||
|
||||
push(new NaviSettingFragment(), MogoModulePaths.PATH_FRAGMENT_SETTING);
|
||||
}
|
||||
|
||||
private void goHistory(SearchPoi item) {
|
||||
MogoTip mogoTip = EntityConvertUtils.poi2MogoTip(item);
|
||||
SearchServiceHolder.INSTANCE.push(
|
||||
ChoosePathFragment.Companion.newInstance(mogoTip.getPoint()),
|
||||
MogoModulePaths.PATH_FRAGMENT_CHOOSE_PAHT);
|
||||
}
|
||||
|
||||
private static final String GO_HOME_CMD = "goHome";
|
||||
private static final String GO_COMPANY_CMD = "goCompany";
|
||||
private static final String GAS_CMD = "gas";
|
||||
private static final String RESTAURANT_CMD = "restaurant";
|
||||
private static final String TOILET_CMD = "toilet";
|
||||
private static final String PARK_CMD = "park";
|
||||
private static final String WASH_CMD = "wash";
|
||||
private static final String NAVI_SETTING_CMD = "setting";
|
||||
private static final String CLEAN_CMD = "clean";
|
||||
private static final String BACK_CMD = "back";
|
||||
|
||||
private void registerVoidCmd() {
|
||||
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(GO_HOME_CMD, new String[] { "回家" }, this);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(GO_COMPANY_CMD, new String[] { "去公司" }, this);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(GAS_CMD, new String[] { "加油站" }, this);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(RESTAURANT_CMD, new String[] { "餐馆" }, this);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(TOILET_CMD, new String[] { "卫生间", "厕所" }, this);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(PARK_CMD, new String[] { "停车场" }, this);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(NAVI_SETTING_CMD, new String[] { "导航设置" }, this);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(CLEAN_CMD, new String[] { "清空历史目的地" }, this);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand(WASH_CMD, new String[] { "洗车" }, this);
|
||||
}
|
||||
|
||||
private void push(Fragment fragment, String tag) {
|
||||
@@ -289,8 +340,25 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
}
|
||||
showHistory();
|
||||
mHistoryAdapter.setDatas(datums);
|
||||
registerHistory();
|
||||
}
|
||||
|
||||
private void registerHistory() {
|
||||
List<SearchPoi> datums = mHistoryAdapter.getList();
|
||||
for (int i = 0; i < datums.size(); i++) {
|
||||
String s = StringUtils.int2String(i + 1);
|
||||
AIAssist.getInstance(getContext())
|
||||
.registerUnWakeupCommand("history" + i,
|
||||
new String[] { "第" + s + "个", "第" + s + "条" }, this);
|
||||
if (cmds.contains("history" + i)) {
|
||||
continue;
|
||||
}
|
||||
cmds.add("history" + i);
|
||||
}
|
||||
}
|
||||
|
||||
private List<String> cmds = new ArrayList<String>();
|
||||
|
||||
@Override
|
||||
public int getSearchType() {
|
||||
return mSearchType;
|
||||
@@ -407,6 +475,10 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
@Override public void onClick(View v) {
|
||||
TextView category = (TextView) v;
|
||||
String text = category.getText().toString();
|
||||
goCategory(text);
|
||||
}
|
||||
|
||||
private void goCategory(String text) {
|
||||
push(CategorySearchFragment.Companion.newInstance(text),
|
||||
MogoModulePaths.PATH_FRAGMENT_SEARCH_CATEGORY);
|
||||
}
|
||||
@@ -416,5 +488,135 @@ public class SearchFragment extends BaseSearchFragment implements SearchView, Vi
|
||||
super.onDestroyView();
|
||||
SearchServiceHolder.INSTANCE.getMapUIController().showMyLocation(true);
|
||||
moveMapToRight();
|
||||
unRegisterVoice();
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(BACK_CMD);
|
||||
}
|
||||
|
||||
private void unRegisterVoice() {
|
||||
|
||||
//private static final String GO_HOME_CMD="goHome";
|
||||
//private static final String GO_COMPANY_CMD="goCompany";
|
||||
//private static final String GAS_CMD="gas";
|
||||
//private static final String RESTAURANT_CMD="restaurant";
|
||||
//private static final String TOILET_CMD="toilet";
|
||||
//private static final String PARK_CMD="park";
|
||||
//private static final String WASH_CMD="wash";
|
||||
//private static final String NAVI_SETTING_CMD="setting";
|
||||
//private static final String CLEAN_CMD="clean";
|
||||
//private static final String BACK_CMD="back";
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(GO_HOME_CMD);
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(GO_COMPANY_CMD);
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(GAS_CMD);
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(RESTAURANT_CMD);
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(TOILET_CMD);
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(PARK_CMD);
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(WASH_CMD);
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(NAVI_SETTING_CMD);
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(CLEAN_CMD);
|
||||
for (String cmd : cmds) {
|
||||
AIAssist.getInstance(getContext()).unregisterUnWakeupCommand(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
//@Override public void onPause() {
|
||||
// super.onPause();
|
||||
// unRegisterVoice();
|
||||
//}
|
||||
//
|
||||
//@Override public void onResume() {
|
||||
// super.onResume();
|
||||
// registerVoidCmd();
|
||||
// registerHistory();
|
||||
//}
|
||||
|
||||
|
||||
@Override public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
if (hidden) {
|
||||
unRegisterVoice();
|
||||
} else {
|
||||
registerVoidCmd();
|
||||
registerHistory();
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onCmdSelected(String cmd) {
|
||||
if (!TextUtils.isEmpty(cmd) && cmd.startsWith("history")) {
|
||||
String index = cmd.substring(7);
|
||||
SearchPoi item = mHistoryAdapter.getItem(Integer.valueOf(index));
|
||||
goHistory(item);
|
||||
return;
|
||||
}
|
||||
switch (cmd) {
|
||||
case CLEAN_CMD:
|
||||
mSearchPresenter.deleteAllCachedPoi();
|
||||
AIAssist.getInstance(getContext())
|
||||
.speakQAndACmd(getString(R.string.notice_clean_history),
|
||||
new String[] { "确定" }, new String[] { "取消" }, this);
|
||||
break;
|
||||
|
||||
case BACK_CMD:
|
||||
SearchServiceHolder.INSTANCE.getFragmentManager().pop();
|
||||
break;
|
||||
case GAS_CMD:
|
||||
|
||||
goCategory(getString(R.string.navi_gas));
|
||||
|
||||
break;
|
||||
case GO_COMPANY_CMD:
|
||||
AddressManager.INSTANCE.goCompany();
|
||||
|
||||
break;
|
||||
case GO_HOME_CMD:
|
||||
AddressManager.INSTANCE.goHome();
|
||||
break;
|
||||
case NAVI_SETTING_CMD:
|
||||
goSetting();
|
||||
break;
|
||||
|
||||
case PARK_CMD:
|
||||
goCategory(getString(R.string.navi_park));
|
||||
|
||||
break;
|
||||
case RESTAURANT_CMD:
|
||||
goCategory(getString(R.string.navi_restrant));
|
||||
|
||||
break;
|
||||
|
||||
case TOILET_CMD:
|
||||
goCategory(getString(R.string.navi_toilet));
|
||||
break;
|
||||
|
||||
case WASH_CMD:
|
||||
goCategory(getString(R.string.navi_wash));
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onCmdAction(String speakText) {
|
||||
|
||||
mSearchPresenter.deleteAllCachedPoi();
|
||||
mSearchPresenter.hideDialog();
|
||||
}
|
||||
|
||||
@Override public void onCmdCancel(String speakText) {
|
||||
|
||||
mSearchPresenter.hideDialog();
|
||||
}
|
||||
|
||||
@Override public void onSpeakEnd(String speakText) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onSpeakSelectTimeOut(String speakText) {
|
||||
|
||||
}
|
||||
|
||||
@Override public void onTransaction(int size) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,6 +136,8 @@ public class SearchPresenter extends Presenter<SearchView> {
|
||||
mCompositeDisposable.add(disposable);
|
||||
}
|
||||
|
||||
private NoticeDialog noticeDialog;
|
||||
|
||||
public void deleteAllCachedPoi() {
|
||||
|
||||
//new AlertDialog.Builder( getContext() )
|
||||
@@ -150,7 +152,7 @@ public class SearchPresenter extends Presenter<SearchView> {
|
||||
// .create()
|
||||
// .show();
|
||||
|
||||
NoticeDialog noticeDialog = new NoticeDialog(getContext(),"清空历史记录?","立即清空");
|
||||
noticeDialog = new NoticeDialog(getContext(),"清空历史记录?","立即清空");
|
||||
|
||||
//noticeDialog.setContent("清空历史记录?");
|
||||
//noticeDialog.setPositiveButton("立即清空");
|
||||
@@ -165,7 +167,13 @@ public class SearchPresenter extends Presenter<SearchView> {
|
||||
noticeDialog.show();
|
||||
}
|
||||
|
||||
private void deleteAllCachedPoiImpl() {
|
||||
public void hideDialog(){
|
||||
if (noticeDialog != null) {
|
||||
noticeDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteAllCachedPoiImpl() {
|
||||
final Disposable disposable = AppDataBase.getDatabase(getContext())
|
||||
.poiDao()
|
||||
.getAll()
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.mogo.module.navi.uitls;
|
||||
|
||||
/**
|
||||
* @author zyz
|
||||
* 2020-03-05.
|
||||
*/
|
||||
public class StringUtils {
|
||||
|
||||
public static String int2String(int index){
|
||||
switch (index){
|
||||
case 1:
|
||||
return "一";
|
||||
case 2:
|
||||
return "二";
|
||||
case 3:
|
||||
return "三";
|
||||
case 4:
|
||||
return "四";
|
||||
case 5:
|
||||
return "五";
|
||||
case 6:
|
||||
return "六";
|
||||
case 7:
|
||||
return "七";
|
||||
case 8:
|
||||
return "八";
|
||||
case 9:
|
||||
return "九";
|
||||
default:
|
||||
return "十";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,4 +41,5 @@
|
||||
<string name="navi_set_company">去设置公司</string>
|
||||
<string name="preference_navi_day_mode">日夜模式</string>
|
||||
<string name="set_fps">设置刷新帧率</string>
|
||||
<string name="notice_clean_history">清空历史记录,确定还是取消</string>
|
||||
</resources>
|
||||
|
||||
@@ -179,6 +179,9 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
case 3:
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_news);
|
||||
break;
|
||||
default:
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -310,7 +310,6 @@ public class MapMarkerManager implements IMogoMarkerClickListener, IMogoOnMessag
|
||||
|
||||
// 绘制Marker
|
||||
public synchronized void drawMapMarker(MarkerResponse response) {
|
||||
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
// 解析不同的Marker类型,然后对应的进行绘制
|
||||
|
||||
@@ -155,6 +155,9 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
case 3:
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_news);
|
||||
break;
|
||||
default:
|
||||
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user