This commit is contained in:
wangcongtao
2020-05-26 14:05:51 +08:00
parent 3a8f39678c
commit 63629e47ba
32 changed files with 1080 additions and 366 deletions

View File

@@ -41,7 +41,6 @@ public abstract class MapMarkerBaseView extends LinearLayout implements IMarkerV
protected MogoImageView ivUserHead;
protected ImageView ivIcon;
protected ImageView ivCar;
protected ConstraintLayout clMarkerTopView;
protected IMogoMarker mMarker;
public MapMarkerBaseView(Context context) {

View File

@@ -3,23 +3,17 @@ package com.mogo.module.service.marker;
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.map.marker.MogoMarkerOptions;
import com.mogo.module.common.entity.MarkerExploreWay;
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;
import com.mogo.module.service.ServiceConst;
import java.util.Random;
/**
* author : donghongyu
* e-mail : 1358506549@qq.com
@@ -52,40 +46,17 @@ public class MapMarkerView extends MapMarkerBaseView {
protected void initView( Context context ) {
LayoutInflater.from( context ).inflate( R.layout.view_map_marker, this );
ivUserHead = findViewById( R.id.ivUserHead );
ivIcon = findViewById( R.id.ivIcon );
ivCar = findViewById( R.id.ivCar );
ivBg = findViewById( R.id.ivBg );
clMarkerTopView = findViewById( R.id.clMarkerTopView );
}
public void updateView( MarkerShowEntity markerShowEntity ) {
try {
Object bindObj = markerShowEntity.getBindObj();
ivBg.setImageResource( R.drawable.bg_map_marker_dark );
switch ( markerShowEntity.getMarkerType() ) {
case ServiceConst.CARD_TYPE_CARS_CHATTING:
case ServiceConst.CARD_TYPE_USER_DATA:
ivUserHead.setVisibility( View.VISIBLE );
ivIcon.setVisibility( View.INVISIBLE );
loadImageWithMarker( markerShowEntity );
ivCar.setImageResource( R.drawable.icon_map_marker_car_gray );
ivCar.setRotation( ( float ) markerShowEntity.getMarkerLocation().getAngle() );
// ivCar.setRotation(new Random().nextInt(360));
clMarkerTopView.setVisibility( View.GONE );
if ( bindObj instanceof MarkerOnlineCar ) {
if ( ( ( MarkerOnlineCar ) bindObj ).getUserInfo().getGenderValue() == 0 ) {
} else {
}
}
break;
case ServiceConst.CARD_TYPE_ROAD_CONDITION:
case ServiceConst.CARD_TYPE_NOVELTY:
ivUserHead.setVisibility( View.INVISIBLE );
ivIcon.setVisibility( View.VISIBLE );
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
if ( bindObj instanceof MarkerExploreWay ) {
switch ( ( ( MarkerExploreWay ) bindObj ).getPoiType() ) {
case MarkerPoiTypeEnum.GAS_STATION:
@@ -137,29 +108,6 @@ public class MapMarkerView extends MapMarkerBaseView {
}
}
break;
case ServiceConst.CARD_TYPE_SHARE_MUSIC:
ivUserHead.setVisibility( View.INVISIBLE );
ivIcon.setVisibility( View.VISIBLE );
ivCar.setImageResource( R.drawable.icon_map_marker_location_yellow );
if ( bindObj instanceof MarkerShareMusic ) {
// 2 为书籍听书3 为新闻,1 为qq音乐,int
switch ( ( ( MarkerShareMusic ) bindObj ).getShareType() ) {
case 1:
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
break;
case 2:
ivIcon.setImageResource( R.drawable.icon_map_marker_book );
break;
case 3:
ivIcon.setImageResource( R.drawable.icon_map_marker_news );
break;
default:
ivIcon.setImageResource( R.drawable.icon_map_marker_misic );
break;
}
}
break;
}
} catch ( Exception e ) {