From f019852f8145734208778874f7dd13a34aad2232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Wed, 15 Jan 2020 15:19:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=96=B0=E9=B2=9C?= =?UTF-8?q?=E4=BA=8B=E5=84=BF=E7=9A=84Marker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/entity/MarkerNoveltyInfo.java | 15 +++-- .../common/entity/MarkerPoiTypeEnum.java | 21 +++++++ .../module/service/MarkerServiceHandler.java | 2 +- .../service/marker/MapMarkerInfoView.java | 53 ++++++++++++++---- .../module/service/marker/MapMarkerView.java | 41 +++++++++++--- .../icon_map_marker_gasoline.png | Bin 1156 -> 0 bytes ...l => bg_shape_reverse_triangle_orange.xml} | 0 .../src/main/res/layout/view_map_marker.xml | 2 +- .../main/res/layout/view_map_marker_info.xml | 2 +- 9 files changed, 110 insertions(+), 26 deletions(-) create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerPoiTypeEnum.java delete mode 100644 modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_gasoline.png rename modules/mogo-module-service/src/main/res/drawable/{bg_shape_reverse_orange_green.xml => bg_shape_reverse_triangle_orange.xml} (100%) diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerNoveltyInfo.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerNoveltyInfo.java index ccf609d422..1b013807f9 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerNoveltyInfo.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerNoveltyInfo.java @@ -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; diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerPoiTypeEnum.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerPoiTypeEnum.java new file mode 100644 index 0000000000..5045d0d203 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerPoiTypeEnum.java @@ -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"; +} \ No newline at end of file diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java index cbd935c58b..bb87bc0523 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/MarkerServiceHandler.java @@ -294,7 +294,7 @@ public class MarkerServiceHandler { } } -// getMapUIController().changeZoom(12); + getMapUIController().changeZoom(12); } /** diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerInfoView.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerInfoView.java index 36dc7d3939..9d7bc1fd75 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerInfoView.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerInfoView.java @@ -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())) { diff --git a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerView.java b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerView.java index a800faabe7..65e52f9ed9 100644 --- a/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerView.java +++ b/modules/mogo-module-service/src/main/java/com/mogo/module/service/marker/MapMarkerView.java @@ -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; } diff --git a/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_gasoline.png b/modules/mogo-module-service/src/main/res/drawable-xhdpi/icon_map_marker_gasoline.png deleted file mode 100644 index bac7ee2e40f8e79158245f5d12ef81c677bc4184..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1156 zcmV-~1bh35P)Px(K1oDDRA>e5T0L(RF%b1`f*=t{L<$lO0tpF;hK7cYJt;VQw z*3}7+uEBPut9=K%-&vN;cCc%hYz1)H@YKTqfIG*l;pNKg6*?US=<*d~-aj`chr20s zq5HhC%1Jpl1zk|;t4(cZ=jKirbLL`{5Y$vku3RDP6w%(B#C{MX| zjmlX2Z*OZ!EG7tdfj>#eRy> zY_ueP;Nsp(h*pquT4~XPvDo8c^C04l%Uxvw`T_VGILE%KEQCg?FqV?aI!h8r4MtE@ zW6M@^K&8Nh@ctYNg5Rl&Jng-*snsfc^n?*$xkZp0fN%5(zM(*5GRZ z489(Cflwb^wzZuSRV!!q+&RzM4nH~KqYnRHHWFZ484_Wg!2RW|YW*2*%wtl3s(oWJ z${@~d>FgzAKG-KMK0(zT?lX+#NlN9AabD#aa$Y}af#=hf*n=KE9tEW91YRSw#aj`a z^y4DZmhLCm7^@_}F|xRueWVKS=IX?VZE`DI3~Ae7WfC|eC2ml-Qur|3BE(W;(md|hz zjCi5|mmgoQ$cqMFJBNQx%Yj9}(=)Hb>I>CS#a*FS49?4ERt_o@HRmZk{VT#1rsGxg=hrIE(H2wO9R2l-7d!@|?j~Gq`A2pSi7}xHAxvfIm*cA?SJicB( zfEkx9u7o(M!mPd~No{qrh=cBz?tq7^u%hrH^oDZK=r)&FJq2$lTb;6P*z(;0%SmZ7 zZ4Z^|8%N4K1R6Xk+bI3Iyf&eYWK}M@UbhCgbyeMuEjysqu5Cj7watgi#|Dg_HTJ{( zlKJ(;S;ecUUm?HZj%CFvptb~6^H}>D^q=6DhgX|iY?lCw-b3HX_8p7Qb;Z}^8;|*} zi$${IKY2R;n`i7Tjm55`b4&3@tiBu1?Z?>C!OzZp2bk7N8AusO8AusO8Ausu&%j?C WKJJxMg4oOe0000mMg diff --git a/modules/mogo-module-service/src/main/res/drawable/bg_shape_reverse_orange_green.xml b/modules/mogo-module-service/src/main/res/drawable/bg_shape_reverse_triangle_orange.xml similarity index 100% rename from modules/mogo-module-service/src/main/res/drawable/bg_shape_reverse_orange_green.xml rename to modules/mogo-module-service/src/main/res/drawable/bg_shape_reverse_triangle_orange.xml diff --git a/modules/mogo-module-service/src/main/res/layout/view_map_marker.xml b/modules/mogo-module-service/src/main/res/layout/view_map_marker.xml index d883a5d2af..0613e51004 100644 --- a/modules/mogo-module-service/src/main/res/layout/view_map_marker.xml +++ b/modules/mogo-module-service/src/main/res/layout/view_map_marker.xml @@ -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" /> \ No newline at end of file diff --git a/modules/mogo-module-service/src/main/res/layout/view_map_marker_info.xml b/modules/mogo-module-service/src/main/res/layout/view_map_marker_info.xml index 8a33092f5c..19b71da718 100644 --- a/modules/mogo-module-service/src/main/res/layout/view_map_marker_info.xml +++ b/modules/mogo-module-service/src/main/res/layout/view_map_marker_info.xml @@ -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" />