增加了新鲜事儿的Marker

This commit is contained in:
董宏宇
2020-01-15 15:19:19 +08:00
parent 2a297ae83f
commit f019852f81
9 changed files with 110 additions and 26 deletions

View File

@@ -1,13 +1,19 @@
package com.mogo.module.common.entity;
/**
* 新鲜事儿Marker数据
*/
public class MarkerNoveltyInfo {
private ContentData contentData;
private MarkerLocation location;
private String poiType;
private String type;
private MarkerLocation location;
private MarkerUserInfo userInfo;
/**
* @see MarkerPoiTypeEnum
*/
private String poiType;
private ContentData contentData;
public ContentData getContentData() {
return contentData;
@@ -50,7 +56,6 @@ public class MarkerNoveltyInfo {
}
public class ContentData {
private String content;
private String iconUrl;
private String imgUrl;

View File

@@ -0,0 +1,21 @@
package com.mogo.module.common.entity;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
* date : 2020-01-1514:47
* desc : 车机启动状态
* version: 1.0
*/
public interface MarkerPoiTypeEnum {
//加油站
public String GAS_STATION = "10001";
//交通检查
public String TRAFFIC_CHECK = "10002";
//封路
public String ROAD_CLOSED = "10003";
//商场打折
public String SHOP_DISCOUNT = "10004";
//4S店
public String FOURS_SHOP = "10005";
}

View File

@@ -294,7 +294,7 @@ public class MarkerServiceHandler {
}
}
// getMapUIController().changeZoom(12);
getMapUIController().changeZoom(12);
}
/**

View File

@@ -11,7 +11,9 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerShareMusic;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.R;
@@ -68,6 +70,9 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
case ServiceConst.CARD_TYPE_USER_DATA:
ivUserHead.setVisibility(View.VISIBLE);
ivIcon.setVisibility(View.INVISIBLE);
loadImageWithMarker(markerShowEntity);
ivCar.setImageResource(R.drawable.icon_map_marker_car_blue);
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
if (bindObj instanceof MarkerOnlineCar) {
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
@@ -78,15 +83,13 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
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:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivUserHead.setImageResource(R.drawable.icon_map_marker_road_block_up);
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);
@@ -94,16 +97,47 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
case ServiceConst.CARD_TYPE_NOVELTY:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_green_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_green);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
if (bindObj instanceof MarkerNoveltyInfo) {
switch (((MarkerNoveltyInfo) bindObj).getPoiType()) {
case MarkerPoiTypeEnum.GAS_STATION:
ivIcon.setImageResource(R.drawable.icon_map_marker_refuel);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_orange_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_orange);
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_green_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_green);
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_off);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_dark_blue_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_dark_blue);
break;
case MarkerPoiTypeEnum.SHOP_DISCOUNT:
break;
case MarkerPoiTypeEnum.FOURS_SHOP:
break;
default:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
clMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_green_info);
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_green);
break;
}
}
break;
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
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);
if (bindObj instanceof MarkerShareMusic) {
// 2 为书籍听书3 为新闻,1 为qq音乐,int
switch (((MarkerShareMusic) bindObj).getShareType()) {
@@ -119,9 +153,6 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
}
}
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;
}
if (!TextUtils.isEmpty(markerShowEntity.getTextContent())) {

View File

@@ -8,7 +8,9 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
import com.mogo.module.common.entity.MarkerShareMusic;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.R;
@@ -59,6 +61,9 @@ public class MapMarkerView extends MapMarkerBaseView {
case ServiceConst.CARD_TYPE_USER_DATA:
ivUserHead.setVisibility(View.VISIBLE);
ivIcon.setVisibility(View.INVISIBLE);
loadImageWithMarker(markerShowEntity);
ivCar.setImageResource(R.drawable.icon_map_marker_car_blue);
ivCar.setRotation((float) markerShowEntity.getMarkerLocation().getAngle());
if (bindObj instanceof MarkerOnlineCar) {
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
@@ -67,9 +72,6 @@ public class MapMarkerView extends MapMarkerBaseView {
ivBg.setImageResource(R.drawable.bg_map_marker_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:
ivUserHead.setVisibility(View.INVISIBLE);
@@ -83,13 +85,41 @@ public class MapMarkerView extends MapMarkerBaseView {
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
ivBg.setImageResource(R.drawable.bg_map_marker_green);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
if (bindObj instanceof MarkerNoveltyInfo) {
switch (((MarkerNoveltyInfo) bindObj).getPoiType()) {
case MarkerPoiTypeEnum.GAS_STATION:
ivIcon.setImageResource(R.drawable.icon_map_marker_refuel);
ivBg.setImageResource(R.drawable.bg_map_marker_oragne);
break;
case MarkerPoiTypeEnum.TRAFFIC_CHECK:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
ivBg.setImageResource(R.drawable.bg_map_marker_green);
break;
case MarkerPoiTypeEnum.ROAD_CLOSED:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_block_off);
ivBg.setImageResource(R.drawable.bg_map_marker_dark_blue);
break;
case MarkerPoiTypeEnum.SHOP_DISCOUNT:
break;
case MarkerPoiTypeEnum.FOURS_SHOP:
break;
default:
ivIcon.setImageResource(R.drawable.icon_map_marker_road_check);
ivBg.setImageResource(R.drawable.bg_map_marker_green);
break;
}
}
break;
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
ivUserHead.setVisibility(View.INVISIBLE);
ivIcon.setVisibility(View.VISIBLE);
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
if (bindObj instanceof MarkerShareMusic) {
// 2 为书籍听书3 为新闻,1 为qq音乐,int
@@ -105,9 +135,6 @@ public class MapMarkerView extends MapMarkerBaseView {
break;
}
}
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
ivCar.setImageResource(R.drawable.icon_map_marker_location_blue);
break;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -47,11 +47,11 @@
android:layout_height="@dimen/dp_45"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_14"
android:src="@drawable/icon_map_marker_road_block_up"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/icon_map_marker_road_block_up"
tools:visibility="visible" />
</merge >

View File

@@ -44,11 +44,11 @@
android:layout_height="@dimen/dp_45"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/dp_14"
android:src="@drawable/icon_map_marker_road_block_up"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:src="@drawable/icon_map_marker_road_block_up"
tools:visibility="visible" />
<TextView