bugfix
This commit is contained in:
@@ -67,7 +67,7 @@ dependencies {
|
||||
implementation project(':foudations:mogo-commons')
|
||||
}
|
||||
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.5.4'
|
||||
implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.5.5'
|
||||
// implementation 'com.zhidaoauto.machine:map:1.0.0-vr-7.4.5-log-1'
|
||||
}
|
||||
|
||||
|
||||
@@ -50,10 +50,10 @@ public class MapMarkerAdapter {
|
||||
* @return MarkerView
|
||||
*/
|
||||
public static IMarkerView getMarkerInfoWindowView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
|
||||
if ( markerShowEntity.isChecked() ) {
|
||||
return new MapMarkerInfoView( context, markerShowEntity, options );
|
||||
} else {
|
||||
return new MapMarkerView( context, markerShowEntity, options );
|
||||
}
|
||||
// if ( markerShowEntity.isChecked() ) {
|
||||
// return new MapMarkerInfoView( context, markerShowEntity, options );
|
||||
// } else {
|
||||
// }
|
||||
return new MapMarkerView( context, markerShowEntity, options );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,11 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
public MapMarkerInfoView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
|
||||
super( context );
|
||||
mOptions = options;
|
||||
updateView( markerShowEntity );
|
||||
try {
|
||||
updateView( markerShowEntity );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,7 +64,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout_info, this );
|
||||
ivUserHead = findViewById( R.id.ivUserHead );
|
||||
// ivIcon = findViewById( R.id.ivIcon );
|
||||
ivIcon = findViewById(R.id.ivIcon);
|
||||
ivIcon = findViewById( R.id.ivIcon );
|
||||
clMarkerContent = findViewById( R.id.clMarkerContent );
|
||||
ivReverseTriangle = findViewById( R.id.ivReverseTriangle );
|
||||
ivCar = findViewById( R.id.ivCar );
|
||||
@@ -69,84 +73,80 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
|
||||
@Override
|
||||
public void updateView( MarkerShowEntity markerShowEntity ) {
|
||||
try {
|
||||
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow_vr );
|
||||
} else {
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
|
||||
}
|
||||
clMarkerContent.setBackgroundResource( R.drawable.bg_map_marker_yellow_info );
|
||||
ivReverseTriangle.setImageResource( R.drawable.bg_shape_reverse_yellow );
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_CARS_CHATTING:
|
||||
case ModuleNames.CARD_TYPE_USER_DATA:
|
||||
ivUserHead.setVisibility( View.VISIBLE );
|
||||
ivIcon.setVisibility( View.INVISIBLE );
|
||||
loadImageWithMarker( markerShowEntity );
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_car_gray );
|
||||
//ivCar.setRotation(new Random().nextInt(360));
|
||||
ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() );
|
||||
break;
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
ivUserHead.setVisibility( View.INVISIBLE );
|
||||
ivIcon.setVisibility( View.VISIBLE );
|
||||
|
||||
if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) {
|
||||
// 根据poiType获取对应的图片
|
||||
String poiType = ((MarkerExploreWay) bindObj).getPoiType();
|
||||
PoiWrapper poiWrapper =
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType(poiType);
|
||||
if (poiWrapper != null) {
|
||||
// 加载图片
|
||||
loadPoiTypeIcon(poiWrapper.getIconInfoUrl(),poiWrapper.getIconInfoRes());
|
||||
}else{
|
||||
Logger.e(TAG, "未能根据poiType获取对应poi信息,无法渲染info marker====" + poiType);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ModuleNames.CARD_TYPE_SHARE_MUSIC:
|
||||
ivUserHead.setVisibility( View.INVISIBLE );
|
||||
ivIcon.setVisibility( View.VISIBLE );
|
||||
|
||||
if ( bindObj instanceof MarkerShareMusic ) {
|
||||
// 2 为书籍听书,3 为新闻,1 为qq音乐,int
|
||||
switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) {
|
||||
case 1:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
|
||||
break;
|
||||
case 2:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_book );
|
||||
break;
|
||||
case 3:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_news );
|
||||
break;
|
||||
default:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ( !TextUtils.isEmpty( markerShowEntity.getTextContent() ) ) {
|
||||
String content;
|
||||
if ( markerShowEntity.getTextContent().length() > 8 ) {
|
||||
content = markerShowEntity.getTextContent().substring( 0, 7 ) + "...";
|
||||
} else {
|
||||
content = markerShowEntity.getTextContent();
|
||||
}
|
||||
tvMarkerContent.setText( content );
|
||||
}
|
||||
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
if ( MogoApisHandler.getInstance().getApis().getStatusManagerApi().isVrMode() ) {
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow_vr );
|
||||
} else {
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
|
||||
}
|
||||
clMarkerContent.setBackgroundResource( R.drawable.bg_map_marker_yellow_info );
|
||||
ivReverseTriangle.setImageResource( R.drawable.bg_shape_reverse_yellow );
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_CARS_CHATTING:
|
||||
case ModuleNames.CARD_TYPE_USER_DATA:
|
||||
ivUserHead.setVisibility( View.VISIBLE );
|
||||
ivIcon.setVisibility( View.INVISIBLE );
|
||||
loadImageWithMarker( markerShowEntity );
|
||||
ivCar.setImageResource( R.drawable.icon_map_marker_car_gray );
|
||||
//ivCar.setRotation(new Random().nextInt(360));
|
||||
ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() );
|
||||
break;
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
ivUserHead.setVisibility( View.INVISIBLE );
|
||||
ivIcon.setVisibility( View.VISIBLE );
|
||||
|
||||
if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) {
|
||||
// 根据poiType获取对应的图片
|
||||
String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType();
|
||||
PoiWrapper poiWrapper =
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType( poiType );
|
||||
if ( poiWrapper != null ) {
|
||||
// 加载图片
|
||||
loadPoiTypeIcon( poiWrapper.getIconInfoUrl(), poiWrapper.getIconInfoRes() );
|
||||
} else {
|
||||
Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染info marker====" + poiType );
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ModuleNames.CARD_TYPE_SHARE_MUSIC:
|
||||
ivUserHead.setVisibility( View.INVISIBLE );
|
||||
ivIcon.setVisibility( View.VISIBLE );
|
||||
|
||||
if ( bindObj instanceof MarkerShareMusic ) {
|
||||
// 2 为书籍听书,3 为新闻,1 为qq音乐,int
|
||||
switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) {
|
||||
case 1:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
|
||||
break;
|
||||
case 2:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_book );
|
||||
break;
|
||||
case 3:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_news );
|
||||
break;
|
||||
default:
|
||||
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ( !TextUtils.isEmpty( markerShowEntity.getTextContent() ) ) {
|
||||
String content;
|
||||
if ( markerShowEntity.getTextContent().length() > 8 ) {
|
||||
content = markerShowEntity.getTextContent().substring( 0, 7 ) + "...";
|
||||
} else {
|
||||
content = markerShowEntity.getTextContent();
|
||||
}
|
||||
tvMarkerContent.setText( content );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ import com.mogo.utils.logger.Logger;
|
||||
* desc : 地图Marker图标
|
||||
* version: 1.0
|
||||
*/
|
||||
public class
|
||||
MapMarkerView extends MapMarkerBaseView {
|
||||
public class MapMarkerView extends MapMarkerBaseView {
|
||||
private String TAG = "MapMarkerView";
|
||||
|
||||
private FrameLayout clMarkerTopView;
|
||||
private MarkerShowEntity mMarkerShowEntity;
|
||||
|
||||
public MapMarkerView( Context context ) {
|
||||
super( context );
|
||||
@@ -45,7 +45,12 @@ MapMarkerView extends MapMarkerBaseView {
|
||||
public MapMarkerView( Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options ) {
|
||||
super( context );
|
||||
mOptions = options;
|
||||
updateView( markerShowEntity );
|
||||
mMarkerShowEntity = markerShowEntity;
|
||||
try {
|
||||
updateView( markerShowEntity );
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -55,37 +60,35 @@ MapMarkerView extends MapMarkerBaseView {
|
||||
} else {
|
||||
LayoutInflater.from( context ).inflate( R.layout.modudle_services_marker_layout, this );
|
||||
}
|
||||
ivIcon = findViewById( R.id.ivIcon );
|
||||
clMarkerTopView = findViewById( R.id.clMarkerTopView );
|
||||
ivIcon = findViewById( R.id.ivIcon );
|
||||
ivCar = findViewById( R.id.ivCar );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateView( MarkerShowEntity markerShowEntity ) {
|
||||
try {
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) {
|
||||
// 根据poiType获取对应的图片
|
||||
String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType();
|
||||
PoiWrapper poiWrapper =
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType( poiType );
|
||||
if ( poiWrapper != null ) {
|
||||
// 加载图片
|
||||
loadPoiTypeIcon( poiWrapper.getIconUrl(), poiWrapper.getIconRes() );
|
||||
} else {
|
||||
Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染marker====" + poiType );
|
||||
}
|
||||
Object bindObj = markerShowEntity.getBindObj();
|
||||
switch ( markerShowEntity.getMarkerType() ) {
|
||||
case ModuleNames.CARD_TYPE_ROAD_CONDITION:
|
||||
case ModuleNames.CARD_TYPE_NOVELTY:
|
||||
if ( mMarkerShowEntity != null && mMarkerShowEntity.isChecked() ) {
|
||||
clMarkerTopView.setBackgroundResource( R.drawable.module_services_marker_vr_bkg_checked );
|
||||
}
|
||||
if ( bindObj instanceof MarkerExploreWay && ( ( MarkerExploreWay ) bindObj ).getPoiType() != null ) {
|
||||
// 根据poiType获取对应的图片
|
||||
String poiType = ( ( MarkerExploreWay ) bindObj ).getPoiType();
|
||||
PoiWrapper poiWrapper =
|
||||
CloudPoiManager.getInstance().getWrapperByPoiType( poiType );
|
||||
if ( poiWrapper != null ) {
|
||||
// 加载图片
|
||||
loadPoiTypeIcon( poiWrapper.getIconUrl(), poiWrapper.getIconRes() );
|
||||
} else {
|
||||
Logger.e( TAG, "未能根据poiType获取对应poi信息,无法渲染marker====" + poiType );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
} catch ( Exception e ) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
@@ -927,6 +927,8 @@ public class MogoServices implements IMogoMapListener,
|
||||
return mLastCarLocation;
|
||||
}
|
||||
|
||||
private boolean mLastStatusIsVr = false;
|
||||
|
||||
@Override
|
||||
public void onMapModeChanged( EnumMapUI ui ) {
|
||||
if ( ui == EnumMapUI.Type_VR ) {
|
||||
@@ -934,11 +936,15 @@ public class MogoServices implements IMogoMapListener,
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "你已进入鹰眼模式" );
|
||||
mLastStatusIsVr = true;
|
||||
} else {
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false );
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "你已离开鹰眼模式" );
|
||||
if ( mLastStatusIsVr ) {
|
||||
mLastStatusIsVr = false;
|
||||
MogoApisHandler.getInstance().getApis().getStatusManagerApi().setVrMode( TAG, false );
|
||||
MapCenterPointStrategy.resetByChangeMode();
|
||||
MapMarkerManager.getInstance().redrawMarkerByStyleChanged();
|
||||
AIAssist.getInstance( mContext ).speakTTSVoice( "你已离开鹰眼模式" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user