Merge branch 'feature/v1.0.0' of gitlab.zhidaoauto.com:ecos/yycp-service/Launcher into feature/v1.0.0

This commit is contained in:
wangcongtao
2020-01-14 20:08:05 +08:00
10 changed files with 144 additions and 83 deletions

View File

@@ -231,7 +231,7 @@ public class MarkerServiceHandler {
}
}
getMapUIController().changeZoom(10);
getMapUIController().changeZoom(12);
}
/**
@@ -239,22 +239,25 @@ public class MarkerServiceHandler {
*/
public static IMogoMarker drawMapMarker(MarkerShowEntity markerShowEntity) {
Logger.e(TAG, "绘制Marker====markerTag" + markerShowEntity);
try {
if (markerShowEntity.getMarkerLocation() != null) {
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
if (markerShowEntity.getMarkerLocation() != null) {
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(markerShowEntity.getMarkerType())
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
options.icon(markerView);
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(markerShowEntity.getMarkerType())
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
options.icon(markerView);
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
marker.setOnMarkerClickListener(mogoMarkerClickListener);
marker.setObject(markerShowEntity);
return marker;
} else {
Logger.e(TAG, "Location 必须进行初始化!!!!!");
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);
marker.setOnMarkerClickListener(mogoMarkerClickListener);
marker.setObject(markerShowEntity);
return marker;
} else {
Logger.e(TAG, "Location 必须进行初始化!!!!!");
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}

View File

@@ -47,4 +47,9 @@ public class ServiceConst {
*/
public static final String CARD_TYPE_USER_DATA = "CARD_TYPE_USER_DATA";
/**
* 卡片 新鲜事
*/
public static final String CARD_TYPE_NOVELTY = "CARD_TYPE_NOVELTY";
}

View File

@@ -29,7 +29,7 @@ public abstract class MapMarkerBaseView extends ConstraintLayout {
protected Context mContext;
protected MogoImageView ivUserHead;
protected ImageView ivIconForeground;
protected ImageView ivIcon;
protected ImageView ivCar;
public MapMarkerBaseView(Context context) {

View File

@@ -28,7 +28,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
private String TAG = "MapMarkerInfoView";
private TextView tvMarkerContent;
private ConstraintLayout llMarkerContent;
private ConstraintLayout clMarkerContent;
private ImageView ivReverseTriangle;
public MapMarkerInfoView(Context context) {
@@ -51,8 +51,8 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
protected void initView(Context context) {
LayoutInflater.from(context).inflate(R.layout.view_map_marker_info, this);
ivUserHead = findViewById(R.id.ivUserHead);
ivIconForeground = findViewById(R.id.ivIconForeground);
llMarkerContent = findViewById(R.id.llMarkerContent);
ivIcon = findViewById(R.id.ivIcon);
clMarkerContent = findViewById(R.id.clMarkerContent);
ivReverseTriangle = findViewById(R.id.ivReverseTriangle);
ivCar = findViewById(R.id.ivCar);
tvMarkerContent = findViewById(R.id.tvMarkerContent);
@@ -64,51 +64,66 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
Object bindObj = markerShowEntity.getBindObj();
switch (markerShowEntity.getMarkerType()) {
case ServiceConst
.CARD_TYPE_CARS_CHATTING:
ivIconForeground.setVisibility(View.GONE);
case ServiceConst
.CARD_TYPE_USER_DATA:
ivIconForeground.setVisibility(View.GONE);
case ServiceConst.CARD_TYPE_CARS_CHATTING:
case ServiceConst.CARD_TYPE_USER_DATA:
ivUserHead.setVisibility(View.VISIBLE);
ivIcon.setVisibility(View.GONE);
if (bindObj instanceof MarkerOnlineCar) {
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
} else {
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
}
}
loadImageWithMarker(markerShowEntity);
ivCar.setImageResource(R.drawable.icon_map_marker_car_blue);
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
break;
case ServiceConst
.CARD_TYPE_ROAD_CONDITION:
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
ivUserHead.setVisibility(View.GONE);
ivIcon.setVisibility(View.VISIBLE);
ivUserHead.setImageResource(R.drawable.icon_map_marker_road_block_up);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
case ServiceConst
.CARD_TYPE_SHARE_MUSIC:
case ServiceConst.CARD_TYPE_NOVELTY:
ivUserHead.setVisibility(View.GONE);
ivIcon.setVisibility(View.VISIBLE);
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_blue);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
ivUserHead.setVisibility(View.GONE);
ivIcon.setVisibility(View.VISIBLE);
if (bindObj instanceof MarkerShareMusic) {
// 2 为书籍听书3 为新闻,1 为qq音乐,int
switch (((MarkerShareMusic) bindObj).getShareType()) {
case 1:
ivUserHead.setImageResource(R.drawable.icon_map_marker_misic);
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
break;
case 2:
ivUserHead.setImageResource(R.drawable.icon_map_marker_book);
ivIcon.setImageResource(R.drawable.icon_map_marker_book);
break;
case 3:
ivUserHead.setImageResource(R.drawable.icon_map_marker_news);
ivIcon.setImageResource(R.drawable.icon_map_marker_news);
break;
}
}
// ivIconForeground.setVisibility(View.VISIBLE);
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
}
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) {
tvMarkerContent.setText(markerShowEntity.getTextContent());
}

View File

@@ -48,7 +48,7 @@ public class MapMarkerView extends MapMarkerBaseView {
LayoutInflater.from(context).inflate(R.layout.view_map_marker, this);
ivUserHead = findViewById(R.id.ivUserHead);
ivIconForeground = findViewById(R.id.ivIconForeground);
ivIcon = findViewById(R.id.ivIcon);
ivCar = findViewById(R.id.ivCar);
ivBg = findViewById(R.id.ivBg);
}
@@ -58,12 +58,10 @@ public class MapMarkerView extends MapMarkerBaseView {
Object bindObj = markerShowEntity.getBindObj();
switch (markerShowEntity.getMarkerType()) {
case ServiceConst
.CARD_TYPE_CARS_CHATTING:
ivIconForeground.setVisibility(View.GONE);
case ServiceConst
.CARD_TYPE_USER_DATA:
ivIconForeground.setVisibility(View.GONE);
case ServiceConst.CARD_TYPE_CARS_CHATTING:
case ServiceConst.CARD_TYPE_USER_DATA:
ivUserHead.setVisibility(View.VISIBLE);
ivIcon.setVisibility(View.GONE);
if (bindObj instanceof MarkerOnlineCar) {
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
@@ -73,32 +71,48 @@ public class MapMarkerView extends MapMarkerBaseView {
}
}
loadImageWithMarker(markerShowEntity);
ivCar.setImageResource(R.drawable.icon_map_marker_car_blue);
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
break;
case ServiceConst
.CARD_TYPE_ROAD_CONDITION:
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
ivUserHead.setVisibility(View.GONE);
ivIcon.setVisibility(View.VISIBLE);
ivUserHead.setImageResource(R.drawable.icon_map_marker_road_block_up);
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
case ServiceConst
.CARD_TYPE_SHARE_MUSIC:
case ServiceConst.CARD_TYPE_NOVELTY:
ivUserHead.setVisibility(View.GONE);
ivIcon.setVisibility(View.VISIBLE);
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_up);
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
ivUserHead.setVisibility(View.GONE);
ivIcon.setVisibility(View.VISIBLE);
if (bindObj instanceof MarkerShareMusic) {
// 2 为书籍听书3 为新闻,1 为qq音乐,int
switch (((MarkerShareMusic) bindObj).getShareType()) {
case 1:
ivUserHead.setImageResource(R.drawable.icon_map_marker_misic);
ivIcon.setImageResource(R.drawable.icon_map_marker_misic);
break;
case 2:
ivUserHead.setImageResource(R.drawable.icon_map_marker_book);
ivIcon.setImageResource(R.drawable.icon_map_marker_book);
break;
case 3:
ivUserHead.setImageResource(R.drawable.icon_map_marker_news);
ivIcon.setImageResource(R.drawable.icon_map_marker_news);
break;
}
}
// ivIconForeground.setVisibility(View.VISIBLE);
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
}
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
} catch (Exception e) {
e.printStackTrace();