解决了bug

【在线车辆】非本人车辆应该是设计图上的白色,当前是蓝色的
http://jira.zhidaohulian.com/projects/UI/issues/UI-26?filter=myopenissues
【在线车辆】地图上车辆显示的气泡头像,没有显示车主头像
http://jira.zhidaohulian.com/projects/UI/issues/UI-10?filter=myopenissues
This commit is contained in:
董宏宇
2020-02-04 19:07:32 +08:00
parent 89f1c1a785
commit f2cfa41269
5 changed files with 33 additions and 30 deletions

View File

@@ -479,7 +479,6 @@ public class MarkerServiceHandler {
Logger.e(TAG, "绘制Marker====drawMapMarker" + markerShowEntity);
try {
if (markerShowEntity.getMarkerLocation() != null) {
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity);
MogoMarkerOptions options = new MogoMarkerOptions()
.owner(markerShowEntity.getMarkerType())
@@ -487,6 +486,7 @@ public class MarkerServiceHandler {
.object(markerShowEntity)
.latitude(markerShowEntity.getMarkerLocation().getLat())
.longitude(markerShowEntity.getMarkerLocation().getLon());
View markerView = MapMarkerAdapter.getMarkerView(mContext, markerShowEntity, options);
options.icon(markerView);
IMogoMarker marker = getMarkerManager().addMarker(markerShowEntity.getMarkerType(), options);

View File

@@ -3,6 +3,7 @@ package com.mogo.module.service.marker;
import android.content.Context;
import android.view.View;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerShowEntity;
/**
@@ -21,11 +22,11 @@ public class MapMarkerAdapter {
* @param markerShowEntity 要填充的数据
* @return MarkerView
*/
public static View getMarkerView(Context context, MarkerShowEntity markerShowEntity) {
public static View getMarkerView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options) {
if (markerShowEntity.isChecked()) {
return new MapMarkerInfoView(context, markerShowEntity);
return new MapMarkerInfoView(context, markerShowEntity, options);
} else {
return new MapMarkerView(context, markerShowEntity);
return new MapMarkerView(context, markerShowEntity, options);
}
}
}

View File

@@ -9,6 +9,7 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerShowEntity;
import com.mogo.module.service.MarkerServiceHandler;
import com.mogo.module.service.R;
@@ -28,7 +29,7 @@ public abstract class MapMarkerBaseView extends ConstraintLayout {
private String TAG = "MapMarkerBaseView";
protected Context mContext;
protected MogoMarkerOptions mOptions;
protected MogoImageView ivUserHead;
protected ImageView ivIcon;
protected ImageView ivCar;
@@ -58,32 +59,29 @@ public abstract class MapMarkerBaseView extends ConstraintLayout {
protected void loadImageWithMarker(final MarkerShowEntity markerShowEntity) {
if (!TextUtils.isEmpty(markerShowEntity.getIconUrl())) {
ivUserHead.post(new Runnable() {
@Override
public void run() {
MarkerServiceHandler
.getImageloader()
.displayImage(markerShowEntity.getIconUrl(),
ivUserHead,
WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50),
new IMogoImageLoaderListener() {
@Override
public void onStart() {
MarkerServiceHandler
.getImageloader()
.displayImage(markerShowEntity.getIconUrl(),
ivUserHead,
WindowUtils.dip2px(mContext, 50), WindowUtils.dip2px(mContext, 50),
new IMogoImageLoaderListener() {
@Override
public void onStart() {
}
}
@Override
public void onCompleted(Bitmap bitmap) {
Logger.d(TAG, "loadImageWithMarker loaded.");
}
@Override
public void onCompleted(Bitmap bitmap) {
Logger.d(TAG, "loadImageWithMarker loaded.");
mOptions.notifyObservers();
}
@Override
public void onFailure(Exception e) {
Logger.e(TAG, "loadImageWithMarker onFailure.");
}
});
}
});
@Override
public void onFailure(Exception e) {
Logger.e(TAG, "loadImageWithMarker onFailure.");
mOptions.notifyObservers();
}
});
} else {
ivUserHead.setBackgroundResource(R.drawable.icon_default_user_head);

View File

@@ -11,6 +11,7 @@ import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
@@ -45,8 +46,9 @@ public class MapMarkerInfoView extends MapMarkerBaseView {
super(context, attrs, defStyleAttr);
}
public MapMarkerInfoView(Context context, MarkerShowEntity markerShowEntity) {
public MapMarkerInfoView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options) {
super(context);
mOptions = options;
updateView(markerShowEntity);
}

View File

@@ -8,6 +8,7 @@ import android.widget.ImageView;
import androidx.annotation.Nullable;
import com.mogo.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerNoveltyInfo;
import com.mogo.module.common.entity.MarkerOnlineCar;
import com.mogo.module.common.entity.MarkerPoiTypeEnum;
@@ -40,8 +41,9 @@ public class MapMarkerView extends MapMarkerBaseView {
super(context, attrs, defStyleAttr);
}
public MapMarkerView(Context context, MarkerShowEntity markerShowEntity) {
public MapMarkerView(Context context, MarkerShowEntity markerShowEntity, MogoMarkerOptions options) {
super(context);
mOptions=options;
updateView(markerShowEntity);
}