增加了默认的marker样式
This commit is contained in:
@@ -136,7 +136,7 @@ public class MarkerServiceHandler {
|
||||
lastMarkerShowEntity.setChecked(false);
|
||||
drawMapMarker(lastMarkerShowEntity);
|
||||
|
||||
lastMarker.destroy();
|
||||
lastMarker.remove();
|
||||
}
|
||||
|
||||
// 将当前的Marker设置为选中
|
||||
@@ -147,7 +147,7 @@ public class MarkerServiceHandler {
|
||||
|
||||
lastMarker = drawMapMarker(markerShowEntity);
|
||||
|
||||
marker.destroy();
|
||||
marker.remove();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +73,10 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
if (bindObj instanceof MarkerOnlineCar) {
|
||||
if (((MarkerOnlineCar) bindObj).getUserInfo().getGenderValue() == 0) {
|
||||
llMarkerContent.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);
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -85,7 +87,7 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
|
||||
.CARD_TYPE_SHARE_MUSIC:
|
||||
ivIconForeground.setVisibility(View.VISIBLE);
|
||||
llMarkerContent.setBackgroundResource(R.drawable.bg_map_marker_purple_info);
|
||||
|
||||
ivReverseTriangle.setImageResource(R.drawable.bg_shape_reverse_triangle_purple);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,11 @@ import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
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;
|
||||
@@ -21,6 +23,8 @@ import com.mogo.module.service.ServiceConst;
|
||||
public class MapMarkerView extends MapMarkerBaseView {
|
||||
private String TAG = "MapMarkerView";
|
||||
|
||||
private ImageView ivBg;
|
||||
|
||||
public MapMarkerView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
@@ -45,22 +49,36 @@ public class MapMarkerView extends MapMarkerBaseView {
|
||||
ivUserHead = findViewById(R.id.ivUserHead);
|
||||
ivIconForeground = findViewById(R.id.ivIconForeground);
|
||||
ivCar = findViewById(R.id.ivCar);
|
||||
ivBg = findViewById(R.id.ivBg);
|
||||
}
|
||||
|
||||
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) {
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_blue);
|
||||
} else {
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_ROAD_CONDITION:
|
||||
break;
|
||||
case ServiceConst
|
||||
.CARD_TYPE_SHARE_MUSIC:
|
||||
ivIconForeground.setVisibility(View.VISIBLE);
|
||||
ivBg.setImageResource(R.drawable.bg_map_marker_purple);
|
||||
break;
|
||||
}
|
||||
ivCar.setRotation(markerShowEntity.getMarkerLocation().getAngle());
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
android:pivotY="15%"
|
||||
android:toDegrees="45" >
|
||||
<shape android:shape="rectangle" >
|
||||
<solid android:color="#C843FF" />
|
||||
<solid android:color="#6828E8" />
|
||||
</shape >
|
||||
</rotate >
|
||||
</item >
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
android:id="@+id/llMarkerContent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_74"
|
||||
android:background="@drawable/bg_map_marker_green_info"
|
||||
android:background="@drawable/bg_map_marker_blue_info"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" >
|
||||
@@ -71,7 +71,7 @@
|
||||
android:id="@+id/ivReverseTriangle"
|
||||
android:layout_width="10dp"
|
||||
android:layout_height="10dp"
|
||||
android:src="@drawable/bg_shape_reverse_triangle_green"
|
||||
android:src="@drawable/bg_shape_reverse_triangle_blue"
|
||||
app:layout_constraintEnd_toEndOf="@+id/llMarkerContent"
|
||||
app:layout_constraintStart_toStartOf="@+id/llMarkerContent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/llMarkerContent" />
|
||||
|
||||
Reference in New Issue
Block a user