diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java index d596c0ec55..d1c4f79a1c 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/MarkerUserInfo.java @@ -2,23 +2,25 @@ package com.mogo.module.common.entity; +import android.text.TextUtils; + import java.io.Serializable; import java.util.Calendar; @SuppressWarnings("unused") public class MarkerUserInfo implements Serializable { - + private int age; - + private String gender; - + private String sn; - + private String userHead; - + private Long userId; - + private String userName; public String getAge() { @@ -75,6 +77,17 @@ public class MarkerUserInfo implements Serializable { this.age = age; } + public int getGenderValue() { + if (!TextUtils.isEmpty(gender)) { + if ("男".equals(gender)) { + return 0; + } + return 1; + } else { + return 0; + } + } + public String getGender() { return gender; } 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 ab29d5ce6d..79119f8139 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 @@ -5,10 +5,13 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; +import android.widget.ImageView; import android.widget.TextView; import androidx.annotation.Nullable; +import androidx.constraintlayout.widget.ConstraintLayout; +import com.mogo.module.common.entity.MarkerOnlineCar; import com.mogo.module.common.entity.MarkerShowEntity; import com.mogo.module.service.R; import com.mogo.module.service.ServiceConst; @@ -24,6 +27,8 @@ public class MapMarkerInfoView extends MapMarkerBaseView { private String TAG = "MapMarkerInfoView"; private TextView tvMarkerContent; + private ConstraintLayout llMarkerContent; + private ImageView ivReverseTriangle; public MapMarkerInfoView(Context context) { super(context); @@ -46,24 +51,41 @@ public class MapMarkerInfoView extends MapMarkerBaseView { 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); + ivReverseTriangle = findViewById(R.id.ivReverseTriangle); ivCar = findViewById(R.id.ivCar); tvMarkerContent = findViewById(R.id.tvMarkerContent); } public void updateView(MarkerShowEntity markerShowEntity) { try { + + 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); + + if (bindObj instanceof MarkerOnlineCar) { + if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) { + llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_blue_info); + } else { + llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info); + } + } break; case ServiceConst .CARD_TYPE_ROAD_CONDITION: + break; case ServiceConst .CARD_TYPE_SHARE_MUSIC: ivIconForeground.setVisibility(View.VISIBLE); + llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info); + break; }