diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/marker/AMapMarkerWrapper.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/marker/AMapMarkerWrapper.java index 1aad674edb..949dc5ac62 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/marker/AMapMarkerWrapper.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/marker/AMapMarkerWrapper.java @@ -17,6 +17,8 @@ import com.mogo.map.marker.anim.OnMarkerAnimationListener; import com.mogo.utils.logger.Logger; import com.zhidaoauto.map.sdk.open.abs.marker.MarkerAnimationListener; import com.zhidaoauto.map.sdk.open.marker.Animation; +import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptor; +import com.zhidaoauto.map.sdk.open.marker.BitmapDescriptorFactory; import com.zhidaoauto.map.sdk.open.marker.Marker; import com.zhidaoauto.map.sdk.open.marker.MarkerOptions; import com.zhidaoauto.map.sdk.open.marker.MarkerScaleAnimation; @@ -139,19 +141,19 @@ public class AMapMarkerWrapper implements IMogoMarker, Observer { if ( icons == null || icons.isEmpty() ) { return; } -// ArrayList descriptors = new ArrayList<>(); -// for ( Bitmap icon : icons ) { -// if ( icon == null || icon.isRecycled() ) { -// continue; -// } -// descriptors.add( BitmapDescriptorFactory.fromBitmap( icon ) ); -// } -// if ( descriptors.isEmpty() ) { -// return; -// } -// if ( mMarker != null ) { -// mMarker.setIcons( descriptors ); -// } + ArrayList descriptors = new ArrayList<>(); + for ( Bitmap icon : icons ) { + if ( icon == null || icon.isRecycled() ) { + continue; + } + descriptors.add( BitmapDescriptorFactory.INSTANCE.fromBitmap(icon)); + } + if ( descriptors.isEmpty() ) { + return; + } + if ( mMarker != null ) { + mMarker.setIcons( descriptors ); + } } @Override diff --git a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/utils/ObjectUtils.java b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/utils/ObjectUtils.java index 5f198a34d4..2639322021 100644 --- a/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/utils/ObjectUtils.java +++ b/libraries/map-custom/src/main/java/com/mogo/map/impl/custom/utils/ObjectUtils.java @@ -52,89 +52,89 @@ import java.util.List; */ public class ObjectUtils { - public static MarkerOptions fromMogo( MogoMarkerOptions opt ) { + public static MarkerOptions fromMogo(MogoMarkerOptions opt) { - if ( opt == null ) { + if (opt == null) { return null; } - ArrayList< BitmapDescriptor > descriptors = new ArrayList<>(); - final ArrayList< Bitmap > icons = opt.getIcons(); - if ( icons != null && !icons.isEmpty() ) { - for ( Bitmap icon : icons ) { - if ( icon == null || icon.isRecycled() ) { + ArrayList descriptors = new ArrayList<>(); + final ArrayList icons = opt.getIcons(); + if (icons != null && !icons.isEmpty()) { + for (Bitmap icon : icons) { + if (icon == null || icon.isRecycled()) { continue; } - descriptors.add( new BitmapDescriptor( icon ) ); + descriptors.add(new BitmapDescriptor(icon)); } } MarkerOptions markerOptions = new MarkerOptions() - .position( new LonLatPoint( opt.getLongitude(), opt.getLatitude() ) ) - .anchor( opt.getU(), opt.getV() ) + .position(new LonLatPoint(opt.getLongitude(), opt.getLatitude())) + .anchor(opt.getU(), opt.getV()) // .icons( descriptors ) // .period( opt.getPeriod() ) - .rotateAngle( opt.getRotate() ) - .setFlat( opt.isFlat() ) - .visible( opt.isVisible() ) - .infoWindowEnable( opt.isInifoWindowEnable() ) - .alpha( opt.getAlpha() ) - .setGps( opt.isGps() ) + .rotateAngle(opt.getRotate()) + .setFlat(opt.isFlat()) + .visible(opt.isVisible()) + .infoWindowEnable(opt.isInifoWindowEnable()) + .alpha(opt.getAlpha()) + .setGps(opt.isGps()) // .draggable( opt.isDraggable() ) - .setInfoWindowOffset( opt.getOffsetX(), opt.getOffsetY() ) - .zIndex( opt.getzIndex() ); - BitmapDescriptor descriptor = getBitmapDescriptorFromMogo( opt ); - if ( descriptor != null ) { - markerOptions.markerIcon( descriptor ); + .setInfoWindowOffset(opt.getOffsetX(), opt.getOffsetY()) + .zIndex(opt.getzIndex()); + BitmapDescriptor descriptor = getBitmapDescriptorFromMogo(opt); + if (descriptor != null) { + markerOptions.markerIcon(descriptor); } - if ( opt.getIcon3DRes() != 0 ) { - markerOptions.marker3DIcon( opt.getIcon3DRes() ); + if (opt.getIcon3DRes() != 0) { + markerOptions.marker3DIcon(opt.getIcon3DRes()); } - if ( !TextUtils.isEmpty( opt.getTitle() ) ) { - markerOptions.title( opt.getTitle() ); + if (!TextUtils.isEmpty(opt.getTitle())) { + markerOptions.title(opt.getTitle()); } - if ( !TextUtils.isEmpty( opt.getSnippet() ) ) { - markerOptions.snippet( opt.getSnippet() ); + if (!TextUtils.isEmpty(opt.getSnippet())) { + markerOptions.snippet(opt.getSnippet()); } return markerOptions; } - private static BitmapDescriptor getBitmapDescriptorFromMogo( MogoMarkerOptions options ) { - if ( options == null ) { + private static BitmapDescriptor getBitmapDescriptorFromMogo(MogoMarkerOptions options) { + if (options == null) { return null; } Bitmap icon = options.getIcon(); - if ( icon != null ) { - return BitmapDescriptorFactory.INSTANCE.fromBitmap( icon ); + if (icon != null) { + return BitmapDescriptorFactory.INSTANCE.fromBitmap(icon); } View view = options.getIconView(); - if ( view != null ) { - return BitmapDescriptorFactory.INSTANCE.fromView( view ); + if (view != null) { + return BitmapDescriptorFactory.INSTANCE.fromView(view); } return null; } - public static MogoLocation fromLocation( com.zhidaoauto.map.sdk.open.location.MogoLocation aLocation ) { - if ( aLocation == null ) { + public static MogoLocation fromLocation(com.zhidaoauto.map.sdk.open.location.MogoLocation aLocation) { + if (aLocation == null) { return null; } MogoLocation location = new MogoLocation(); // location.setLocType( aLocation.getLocationType() ); - location.setSpeed( aLocation.getSpeed() ); - location.setLatitude( aLocation.getLat() ); - location.setLongitude( aLocation.getLon() ); - location.setAltitude( aLocation.getAltitude() ); + location.setSpeed(aLocation.getSpeed()); + location.setLatitude(aLocation.getLat()); + location.setLongitude(aLocation.getLon()); + location.setAltitude(aLocation.getAltitude()); // location.setTime( aLocation.getTime() ); - location.setBearing( aLocation.getHeading() ); + location.setBearing(aLocation.getHeading()); // location.setAccuracy( aLocation.getAccuracy() ); - location.setCityCode( aLocation.getCityCode() ); - location.setCityName( aLocation.getCity() ); - location.setProvider( aLocation.getProvider() ); - location.setAddress( aLocation.getAddress() ); - location.setDistrict( aLocation.getDistrict() ); - location.setProvince( aLocation.getProvince() ); - location.setAdCode( aLocation.getAdCode() ); + location.setCityCode(aLocation.getCityCode()); + location.setCityName(aLocation.getCity()); + location.setProvider(aLocation.getProvider()); + location.setAddress(aLocation.getAddress()); + location.setDistrict(aLocation.getDistrict()); + location.setProvince(aLocation.getProvince()); + location.setAdCode(aLocation.getAdCode()); // location.setLocationDetail( aLocation.getLocationDetail() ); // location.setPoiName( aLocation.getPoiName() ); // location.setAoiName( aLocation.getAoiName() ); @@ -149,11 +149,11 @@ public class ObjectUtils { return location; } - public static LonLatPoint fromMogo( MogoLatLng latLng ) { - if ( latLng == null ) { + public static LonLatPoint fromMogo(MogoLatLng latLng) { + if (latLng == null) { return null; } - return new LonLatPoint( latLng.lon, latLng.lat ); + return new LonLatPoint(latLng.lon, latLng.lat); } // public static NaviLatLng fromMogoAsNavi( MogoLatLng latLng ) { @@ -170,11 +170,11 @@ public class ObjectUtils { // return new LatLng( latLng.lat, latLng.lng ); // } - public static MogoLatLng fromAMap( LonLatPoint point ) { - if ( point == null ) { + public static MogoLatLng fromAMap(LonLatPoint point) { + if (point == null) { return null; } - return new MogoLatLng( point.getLatitude(), point.getLongitude() ); + return new MogoLatLng(point.getLatitude(), point.getLongitude()); } // public static MogoLatLng CameraPositionfromAMap( LatLng point ) { @@ -184,19 +184,19 @@ public class ObjectUtils { // return new MogoLatLng( point.latitude, point.longitude ); // } - public static GeocodeQuery fromMogo( MogoGeocodeQuery query ) { - if ( query == null ) { + public static GeocodeQuery fromMogo(MogoGeocodeQuery query) { + if (query == null) { return null; } - GeocodeQuery q = new GeocodeQuery( query.getLocationName(), query.getCity() ); + GeocodeQuery q = new GeocodeQuery(query.getLocationName(), query.getCity()); return q; } - public static RegeocodeQuery fromMogo( MogoRegeocodeQuery query ) { - if ( query == null ) { + public static RegeocodeQuery fromMogo(MogoRegeocodeQuery query) { + if (query == null) { return null; } - RegeocodeQuery q = new RegeocodeQuery( fromMogo( query.getPoint() ), 1000 ); + RegeocodeQuery q = new RegeocodeQuery(fromMogo(query.getPoint()), 1000); return q; } @@ -238,39 +238,39 @@ public class ObjectUtils { // return mogoCrossroad; // } - public static MogoGeocodeAddress fromAMap( GeocodeAddress address ) { - if ( address == null ) { + public static MogoGeocodeAddress fromAMap(GeocodeAddress address) { + if (address == null) { return null; } MogoGeocodeAddress mogoGeocodeAddress = new MogoGeocodeAddress(); - mogoGeocodeAddress.setAdcode( address.getAdcode() ); - mogoGeocodeAddress.setBuilding( address.getBuilding() ); - mogoGeocodeAddress.setCity( address.getCity() ); - mogoGeocodeAddress.setDistrict( address.getDistrict() ); - mogoGeocodeAddress.setFormatAddress( address.getFormatAddress() ); - mogoGeocodeAddress.setLatlng( fromAMap( address.getLonlat() ) ); - mogoGeocodeAddress.setLevel( address.getLevel() ); - mogoGeocodeAddress.setNeighborhood( address.getNeighborhood() ); - mogoGeocodeAddress.setProvince( address.getProvince() ); - mogoGeocodeAddress.setTownship( address.getTownship() ); + mogoGeocodeAddress.setAdcode(address.getAdcode()); + mogoGeocodeAddress.setBuilding(address.getBuilding()); + mogoGeocodeAddress.setCity(address.getCity()); + mogoGeocodeAddress.setDistrict(address.getDistrict()); + mogoGeocodeAddress.setFormatAddress(address.getFormatAddress()); + mogoGeocodeAddress.setLatlng(fromAMap(address.getLonlat())); + mogoGeocodeAddress.setLevel(address.getLevel()); + mogoGeocodeAddress.setNeighborhood(address.getNeighborhood()); + mogoGeocodeAddress.setProvince(address.getProvince()); + mogoGeocodeAddress.setTownship(address.getTownship()); return mogoGeocodeAddress; } - public static MogoGeocodeResult fromAMap( GeocodeResult result ) { - if ( result == null || result.getGeocodeAddressList() == null ) { + public static MogoGeocodeResult fromAMap(GeocodeResult result) { + if (result == null || result.getGeocodeAddressList() == null) { return null; } MogoGeocodeResult mogoGeocodeResult = new MogoGeocodeResult(); - final List< MogoGeocodeAddress > addresses = new ArrayList<>(); - List< GeocodeAddress > list = result.getGeocodeAddressList(); - for ( GeocodeAddress geocodeAddress : list ) { - final MogoGeocodeAddress mogoGeocodeAddress = fromAMap( geocodeAddress ); - if ( mogoGeocodeAddress != null ) { - addresses.add( mogoGeocodeAddress ); + final List addresses = new ArrayList<>(); + List list = result.getGeocodeAddressList(); + for (GeocodeAddress geocodeAddress : list) { + final MogoGeocodeAddress mogoGeocodeAddress = fromAMap(geocodeAddress); + if (mogoGeocodeAddress != null) { + addresses.add(mogoGeocodeAddress); } } - mogoGeocodeResult.setAddresses( addresses ); + mogoGeocodeResult.setAddresses(addresses); return mogoGeocodeResult; } @@ -286,7 +286,7 @@ public class ObjectUtils { // } // // public static MogoPhoto fromAMap( Photo photo ) { -// if ( photo == null ) { +// if ( photo == null ) {f // return null; // } // MogoPhoto mogoPhoto = new MogoPhoto(); @@ -346,23 +346,23 @@ public class ObjectUtils { // return mogoSubPoiItem; // } - public static MogoPoiItem fromAMap( PoiItem poiItem ) { - if ( poiItem == null ) { + public static MogoPoiItem fromAMap(PoiItem poiItem) { + if (poiItem == null) { return null; } MogoPoiItem mogoPoiItem = new MogoPoiItem(); - mogoPoiItem.setAdCode( poiItem.getAdCode() ); - mogoPoiItem.setAdName( poiItem.getAdName() ); - mogoPoiItem.setBusinessArea( poiItem.getBusinessArea() ); - mogoPoiItem.setCityCode( poiItem.getCityCode() ); - mogoPoiItem.setCityName( poiItem.getCityName() ); - mogoPoiItem.setDirection( poiItem.getDirection() ); - mogoPoiItem.setDistance( poiItem.getDistance() ); - mogoPoiItem.setEmail( poiItem.getEmail() ); - mogoPoiItem.setEnter( fromAMap( poiItem.getEnter() ) ); - mogoPoiItem.setExit( fromAMap( poiItem.getExit() ) ); + mogoPoiItem.setAdCode(poiItem.getAdCode()); + mogoPoiItem.setAdName(poiItem.getAdName()); + mogoPoiItem.setBusinessArea(poiItem.getBusinessArea()); + mogoPoiItem.setCityCode(poiItem.getCityCode()); + mogoPoiItem.setCityName(poiItem.getCityName()); + mogoPoiItem.setDirection(poiItem.getDirection()); + mogoPoiItem.setDistance(poiItem.getDistance()); + mogoPoiItem.setEmail(poiItem.getEmail()); + mogoPoiItem.setEnter(fromAMap(poiItem.getEnter())); + mogoPoiItem.setExit(fromAMap(poiItem.getExit())); // mogoPoiItem.setIndoorData( fromAMap( poiItem.getIndoorData() ) ); - mogoPoiItem.setParkingType( poiItem.getParkingType() ); + mogoPoiItem.setParkingType(poiItem.getParkingType()); // mogoPoiItem.setIndoorMap( poiItem.isIndoorMap() ); // if ( poiItem.getPhotos() != null ) { // List< MogoPhoto > mogoPhotos = new ArrayList<>(); @@ -375,13 +375,13 @@ public class ObjectUtils { // mogoPoiItem.setPhotos( mogoPhotos ); // } // mogoPoiItem.setPoiExtension( fromAMap( poiItem.getPoiExtension() ) ); - mogoPoiItem.setPoiId( poiItem.getPoiId() ); - mogoPoiItem.setPoint( fromAMap( poiItem.getLonLatPoint() ) ); - mogoPoiItem.setPostcode( poiItem.getPostcode() ); - mogoPoiItem.setProvinceCode( poiItem.getProvinceCode() ); - mogoPoiItem.setProvinceName( poiItem.getProvinceName() ); - mogoPoiItem.setShopID( poiItem.getShopID() ); - mogoPoiItem.setSnippet( poiItem.getSnippet() ); + mogoPoiItem.setPoiId(poiItem.getPoiId()); + mogoPoiItem.setPoint(fromAMap(poiItem.getLonLatPoint())); + mogoPoiItem.setPostcode(poiItem.getPostcode()); + mogoPoiItem.setProvinceCode(poiItem.getProvinceCode()); + mogoPoiItem.setProvinceName(poiItem.getProvinceName()); + mogoPoiItem.setShopID(poiItem.getShopID()); + mogoPoiItem.setSnippet(poiItem.getSnippet()); // if ( poiItem.getSubPois() != null ) { // List< MogoSubPoiItem > mogoSubPoiItems = new ArrayList<>(); // for ( SubPoiItem subPois : poiItem.getSubPois() ) { @@ -392,20 +392,20 @@ public class ObjectUtils { // } // mogoPoiItem.setSubPois( mogoSubPoiItems ); // } - mogoPoiItem.setTel( poiItem.getTel() ); - mogoPoiItem.setTypeCode( poiItem.getTypeCode() ); - mogoPoiItem.setTitle( poiItem.getTitle() ); - mogoPoiItem.setTypeDes( poiItem.getTypeDes() ); - mogoPoiItem.setWebsite( poiItem.getWebsite() ); + mogoPoiItem.setTel(poiItem.getTel()); + mogoPoiItem.setTypeCode(poiItem.getTypeCode()); + mogoPoiItem.setTitle(poiItem.getTitle()); + mogoPoiItem.setTypeDes(poiItem.getTypeDes()); + mogoPoiItem.setWebsite(poiItem.getWebsite()); return mogoPoiItem; } - public static MogoRegeocodeAddress fromAMap( RegeocodeAddress regeocodeAddress ) { - if ( regeocodeAddress == null ) { + public static MogoRegeocodeAddress fromAMap(RegeocodeAddress regeocodeAddress) { + if (regeocodeAddress == null) { return null; } MogoRegeocodeAddress mogoRegeocodeAddress = new MogoRegeocodeAddress(); - mogoRegeocodeAddress.setAdCode( regeocodeAddress.getAdCode() ); + mogoRegeocodeAddress.setAdCode(regeocodeAddress.getAdCode()); // if ( regeocodeAddress.getAois() != null ) { // List< MogoAoiItem > items = new ArrayList<>(); // for ( AoiItem aois : regeocodeAddress.getAois() ) { @@ -417,7 +417,7 @@ public class ObjectUtils { // mogoRegeocodeAddress.setAois( items ); // } - mogoRegeocodeAddress.setBuilding( regeocodeAddress.getBuilding() ); + mogoRegeocodeAddress.setBuilding(regeocodeAddress.getBuilding()); // if ( regeocodeAddress.getBusinessAreas() != null ) { // List< MogoBusinessArea > mogoBusinessAreas = new ArrayList<>(); // for ( BusinessArea businessArea : regeocodeAddress.getBusinessAreas() ) { @@ -429,9 +429,9 @@ public class ObjectUtils { // mogoRegeocodeAddress.setBusinessAreas( mogoBusinessAreas ); // } - mogoRegeocodeAddress.setCity( regeocodeAddress.getCity() ); - mogoRegeocodeAddress.setCityCode( regeocodeAddress.getCityCode() ); - mogoRegeocodeAddress.setCountry( regeocodeAddress.getCountry() ); + mogoRegeocodeAddress.setCity(regeocodeAddress.getCity()); + mogoRegeocodeAddress.setCityCode(regeocodeAddress.getCityCode()); + mogoRegeocodeAddress.setCountry(regeocodeAddress.getCountry()); // if ( regeocodeAddress.getCrossroads() != null ) { // List< MogoCrossroad > mogoCrossroads = new ArrayList<>(); // for ( Crossroad crossroad : regeocodeAddress.getCrossroads() ) { @@ -443,19 +443,19 @@ public class ObjectUtils { // } // mogoRegeocodeAddress.setCrossroads( mogoCrossroads ); // } - mogoRegeocodeAddress.setDistrict( regeocodeAddress.getDistrict() ); - mogoRegeocodeAddress.setFormatAddress( regeocodeAddress.getFormatAddress() ); - mogoRegeocodeAddress.setNeighborhood( regeocodeAddress.getNeighborhood() ); - if ( regeocodeAddress.getPoiList() != null ) { - List< MogoPoiItem > mogoPoiItems = new ArrayList<>(); - List< PoiItem > list = regeocodeAddress.getPoiList(); - for ( PoiItem pois : list ) { - MogoPoiItem mogoPoiItem = fromAMap( pois ); - mogoPoiItems.add( mogoPoiItem ); + mogoRegeocodeAddress.setDistrict(regeocodeAddress.getDistrict()); + mogoRegeocodeAddress.setFormatAddress(regeocodeAddress.getFormatAddress()); + mogoRegeocodeAddress.setNeighborhood(regeocodeAddress.getNeighborhood()); + if (regeocodeAddress.getPoiList() != null) { + List mogoPoiItems = new ArrayList<>(); + List list = regeocodeAddress.getPoiList(); + for (PoiItem pois : list) { + MogoPoiItem mogoPoiItem = fromAMap(pois); + mogoPoiItems.add(mogoPoiItem); } - mogoRegeocodeAddress.setPois( mogoPoiItems ); + mogoRegeocodeAddress.setPois(mogoPoiItems); } - mogoRegeocodeAddress.setProvince( regeocodeAddress.getProvince() ); + mogoRegeocodeAddress.setProvince(regeocodeAddress.getProvince()); // if ( regeocodeAddress.getRoads() != null ) { // List< MogoRegeocodeRoad > mogoRegeocodeRoads = new ArrayList<>(); // for ( RegeocodeRoad road : regeocodeAddress.getRoads() ) { @@ -467,43 +467,43 @@ public class ObjectUtils { // mogoRegeocodeAddress.setRoads( mogoRegeocodeRoads ); // } // mogoRegeocodeAddress.setStreetNumber( fromAMap( regeocodeAddress.getStreetNumber() ) ); - mogoRegeocodeAddress.setTowncode( regeocodeAddress.getTowncode() ); - mogoRegeocodeAddress.setTownship( regeocodeAddress.getTownship() ); + mogoRegeocodeAddress.setTowncode(regeocodeAddress.getTowncode()); + mogoRegeocodeAddress.setTownship(regeocodeAddress.getTownship()); return mogoRegeocodeAddress; } - public static MogoRegeocodeResult fromAMap( RegeocodeResult regeocodeResult ) { - if ( regeocodeResult == null ) { + public static MogoRegeocodeResult fromAMap(RegeocodeResult regeocodeResult) { + if (regeocodeResult == null) { return null; } MogoRegeocodeResult mogoRegeocodeResult = new MogoRegeocodeResult(); - mogoRegeocodeResult.setRegeocodeAddress( fromAMap( regeocodeResult.getRegeocodeAddress() ) ); + mogoRegeocodeResult.setRegeocodeAddress(fromAMap(regeocodeResult.getRegeocodeAddress())); return mogoRegeocodeResult; } - public static InputtipsQuery fromMogo( MogoInputtipsQuery query ) { - if ( query == null ) { + public static InputtipsQuery fromMogo(MogoInputtipsQuery query) { + if (query == null) { return null; } - InputtipsQuery inputtipsQuery = new InputtipsQuery( query.getKeyword(), query.getCity() ); - inputtipsQuery.setCityLimit( query.isCityLimit() ); - inputtipsQuery.setLocation( fromMogo( query.getLocation() ) ); - inputtipsQuery.setType( query.getType() ); + InputtipsQuery inputtipsQuery = new InputtipsQuery(query.getKeyword(), query.getCity()); + inputtipsQuery.setCityLimit(query.isCityLimit()); + inputtipsQuery.setLocation(fromMogo(query.getLocation())); + inputtipsQuery.setType(query.getType()); return inputtipsQuery; } - public static MogoTip fromAMap( Tip tip ) { - if ( tip == null ) { + public static MogoTip fromAMap(Tip tip) { + if (tip == null) { return null; } MogoTip mogoTip = new MogoTip(); - mogoTip.setAdCode( tip.getAdcode() ); - mogoTip.setAddress( tip.getAddress() ); - mogoTip.setDistrict( tip.getDistrict() ); - mogoTip.setName( tip.getName() ); - mogoTip.setPoiID( tip.getPoiID() ); - mogoTip.setPoint( fromAMap( tip.getLatPoint() ) ); - mogoTip.setTypeCode( tip.getTypeCode() ); + mogoTip.setAdCode(tip.getAdcode()); + mogoTip.setAddress(tip.getAddress()); + mogoTip.setDistrict(tip.getDistrict()); + mogoTip.setName(tip.getName()); + mogoTip.setPoiID(tip.getPoiID()); + mogoTip.setPoint(fromAMap(tip.getLatPoint())); + mogoTip.setTypeCode(tip.getTypeCode()); return mogoTip; } @@ -518,100 +518,100 @@ public class ObjectUtils { // return mogoPoi; // } - public static MogoPoiSearchQuery fromAMap( Query query ) { - if ( query == null ) { + public static MogoPoiSearchQuery fromAMap(Query query) { + if (query == null) { return null; } - MogoPoiSearchQuery mogoPoiSearchQuery = new MogoPoiSearchQuery( query.getKeyword(), query.getCategory(), query.getCity() ); + MogoPoiSearchQuery mogoPoiSearchQuery = new MogoPoiSearchQuery(query.getKeyword(), query.getCategory(), query.getCity()); // mogoPoiSearchQuery.setBuilding( query.getBuilding() ); - mogoPoiSearchQuery.setCityLimit( query.getCityLimit() ); - mogoPoiSearchQuery.setDistanceSort( query.getDistanceSort() ); - mogoPoiSearchQuery.setLocation( fromAMap( query.getLocation() ) ); - mogoPoiSearchQuery.setPageNum( query.getPageNum() ); - mogoPoiSearchQuery.setPageSize( query.getPageSize() ); + mogoPoiSearchQuery.setCityLimit(query.getCityLimit()); + mogoPoiSearchQuery.setDistanceSort(query.getDistanceSort()); + mogoPoiSearchQuery.setLocation(fromAMap(query.getLocation())); + mogoPoiSearchQuery.setPageNum(query.getPageNum()); + mogoPoiSearchQuery.setPageSize(query.getPageSize()); return mogoPoiSearchQuery; } - public static Query fromMogo( MogoPoiSearchQuery query ) { - if ( query == null || query.getQuery() == null ) { + public static Query fromMogo(MogoPoiSearchQuery query) { + if (query == null || query.getQuery() == null) { return null; } - Query psq = new Query( query.getQuery(), "", "" ); - String category = getCategory( query.getQuery() ); - if ( !category.equals( "" ) ) - psq = new Query( "", "", getCategory( query.getQuery() ) ); + Query psq = new Query(query.getQuery(), "", ""); + String category = getCategory(query.getQuery()); + if (!category.equals("")) + psq = new Query("", "", getCategory(query.getQuery())); // psq.setBuilding( query.getBuilding() ); - psq.setCityLimit( query.isCityLimit() ); - psq.setDistanceSort( query.isDistanceSort() ); - psq.setLocation( fromMogo( query.getLocation() ) ); - psq.setPageNum( query.getPageNum() ); - psq.setPageSize( query.getPageSize() ); + psq.setCityLimit(query.isCityLimit()); + psq.setDistanceSort(query.isDistanceSort()); + psq.setLocation(fromMogo(query.getLocation())); + psq.setPageNum(query.getPageNum()); + psq.setPageSize(query.getPageSize()); return psq; } - public static MogoSearchBound fromAMap( SearchBound bound ) { - if ( bound == null ) { + public static MogoSearchBound fromAMap(SearchBound bound) { + if (bound == null) { return null; } - if ( bound.getShape() == SearchBound.BOUND_SHAPE ) { - return new MogoSearchBound( fromAMap( bound.getCenter() ), bound.getRange(), bound.isDistanceSort() ); - } else if ( bound.getShape() == SearchBound.POLYGON_SHAPE ) { - return new MogoSearchBound( fromAMap( bound.getPolyGonList() ) ); - } else if ( bound.getShape() == SearchBound.RECTANGLE_SHAPE ) { - return new MogoSearchBound( fromAMap( bound.getLowerLeft() ), fromAMap( bound.getUpperRight() ) ); + if (bound.getShape() == SearchBound.BOUND_SHAPE) { + return new MogoSearchBound(fromAMap(bound.getCenter()), bound.getRange(), bound.isDistanceSort()); + } else if (bound.getShape() == SearchBound.POLYGON_SHAPE) { + return new MogoSearchBound(fromAMap(bound.getPolyGonList())); + } else if (bound.getShape() == SearchBound.RECTANGLE_SHAPE) { + return new MogoSearchBound(fromAMap(bound.getLowerLeft()), fromAMap(bound.getUpperRight())); } return null; } - public static List< MogoLatLng > fromAMap( List< LonLatPoint > latLngs ) { - if ( latLngs == null ) { + public static List fromAMap(List latLngs) { + if (latLngs == null) { return null; } - List< MogoLatLng > result = new ArrayList<>( latLngs.size() ); - for ( LonLatPoint latLng : latLngs ) { - result.add( fromAMap( latLng ) ); + List result = new ArrayList<>(latLngs.size()); + for (LonLatPoint latLng : latLngs) { + result.add(fromAMap(latLng)); } return result; } - public static List< LonLatPoint > fromMogo( List< MogoLatLng > latLngs ) { - if ( latLngs == null ) { + public static List fromMogo(List latLngs) { + if (latLngs == null) { return null; } - List< LonLatPoint > result = new ArrayList<>( latLngs.size() ); - for ( MogoLatLng latLng : latLngs ) { - result.add( fromMogo( latLng ) ); + List result = new ArrayList<>(latLngs.size()); + for (MogoLatLng latLng : latLngs) { + result.add(fromMogo(latLng)); } return result; } - public static SearchBound fromMogo( MogoSearchBound bound ) { - if ( bound == null ) { + public static SearchBound fromMogo(MogoSearchBound bound) { + if (bound == null) { return null; } - if ( bound.getShape() == MogoSearchBound.SHAPE_BOUND ) { - return new SearchBound( fromMogo( bound.getCenterPoint() ), bound.getRadiusInMeters(), bound.isDistanceSort() ); - } else if ( bound.getShape() == MogoSearchBound.SHAPE_POLYGON ) { - return new SearchBound( fromMogo( bound.getPolyGonList() ) ); - } else if ( bound.getShape() == MogoSearchBound.SHAPE_RECTANGLE ) { - return new SearchBound( fromMogo( bound.getLowerLeft() ), fromMogo( bound.getUpperRight() ) ); + if (bound.getShape() == MogoSearchBound.SHAPE_BOUND) { + return new SearchBound(fromMogo(bound.getCenterPoint()), bound.getRadiusInMeters(), bound.isDistanceSort()); + } else if (bound.getShape() == MogoSearchBound.SHAPE_POLYGON) { + return new SearchBound(fromMogo(bound.getPolyGonList())); + } else if (bound.getShape() == MogoSearchBound.SHAPE_RECTANGLE) { + return new SearchBound(fromMogo(bound.getLowerLeft()), fromMogo(bound.getUpperRight())); } return null; } - public static MogoPoiResult fromAMap( PoiSearchResult result ) { - if ( result == null ) { + public static MogoPoiResult fromAMap(PoiSearchResult result) { + if (result == null) { return null; } MogoPoiResult mogoPoiResult = new MogoPoiResult(); - if ( result.getItems() != null ) { - final List< PoiSearchItem > poiItems = result.getItems(); - final ArrayList< MogoPoiItem > mogoPoiItems = new ArrayList<>( poiItems.size() ); - for ( PoiSearchItem poiItem : poiItems ) { - mogoPoiItems.add( fromAMap( poiItem.getPoi() ) ); + if (result.getItems() != null) { + final List poiItems = result.getItems(); + final ArrayList mogoPoiItems = new ArrayList<>(poiItems.size()); + for (PoiSearchItem poiItem : poiItems) { + mogoPoiItems.add(fromAMap(poiItem.getPoi())); } - mogoPoiResult.setPois( mogoPoiItems ); + mogoPoiResult.setPois(mogoPoiItems); } return mogoPoiResult; } @@ -690,27 +690,27 @@ public class ObjectUtils { // return null; // } - public static PolylineOptions fromMogo( MogoPolylineOptions options ) { - if ( options == null ) { + public static PolylineOptions fromMogo(MogoPolylineOptions options) { + if (options == null) { return null; } PolylineOptions target = new PolylineOptions(); - if ( options.getPoints() != null ) { - List< LonLatPoint > points = new ArrayList<>(); - for ( MogoLatLng point : options.getPoints() ) { - points.add( fromMogo( point ) ); + if (options.getPoints() != null) { + List points = new ArrayList<>(); + for (MogoLatLng point : options.getPoints()) { + points.add(fromMogo(point)); } - target.setLonLatPoints( points ); + target.lonLatPoints(points); } - target.setLineWidth( options.getWidth() ); - target.setColor( options.getColor() ); + target.setLineWidth(options.getWidth()); + target.setColor(options.getColor()); // target.zIndex( options.getWidth() ); // target.visible( options.isVisible() ); //// target.geodesic( options.isGeodesic() ); // target.setDottedLine( options.isDottedLine() ); - target.useGradient( options.isGradient() ); - if ( options.getColorValues() != null ) { - target.colorValues( options.getColorValues() ); + target.useGradient(options.isGradient()); + if (options.getColorValues() != null) { + target.colorValues(options.getColorValues()); } // target.transparency( options.getTransparency() ); // target.aboveMaskLayer( options.isAboveMaskLayer() ); @@ -727,24 +727,24 @@ public class ObjectUtils { // return new MogoLatLng( latLng.latitude, latLng.longitude ); // } - public static MapCameraPosition fromAMap( CameraPosition position ) { - if ( position == null ) { + public static MapCameraPosition fromAMap(CameraPosition position) { + if (position == null) { return null; } - return new MapCameraPosition( fromAMap( position.getTarget() ), position.getBearing(), position.getTilt(), position.getZoom() ); + return new MapCameraPosition(fromAMap(position.getTarget()), position.getBearing(), position.getTilt(), position.getZoom()); } - private static String getCategory( String key ) { + private static String getCategory(String key) { String category = ""; - if ( key.equals( "加油站" ) ) { + if (key.equals("加油站")) { category = "6"; - } else if ( key.equals( "停车场" ) ) { + } else if (key.equals("停车场")) { category = "12"; - } else if ( key.equals( "餐馆" ) ) { + } else if (key.equals("餐馆")) { category = "22"; - } else if ( key.equals( "洗车" ) ) { + } else if (key.equals("洗车")) { category = "8"; - } else if ( key.equals( "厕所" ) ) { + } else if (key.equals("厕所")) { } return category; diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XPolylineManager.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XPolylineManager.java index 94edcd19be..7947ee9061 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XPolylineManager.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/manager/impl/MoGoV2XPolylineManager.java @@ -48,9 +48,11 @@ public class MoGoV2XPolylineManager implements IMoGoV2XPolylineManager { case V2XPoiTypeEnum.FOURS_BLOCK_UP: case V2XPoiTypeEnum.ALERT_CAR_TROUBLE_WARNING + "": colors.add(0xFFFFA31A); + colors.add(0xFFE32F46); break; default: colors.add(0xFFE32F46); + colors.add(0xFFFFA31A); break; } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SimpleCoverVideoPlayer.kt b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SimpleCoverVideoPlayer.kt index 149bf52401..c6158ee49b 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SimpleCoverVideoPlayer.kt +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/view/SimpleCoverVideoPlayer.kt @@ -10,6 +10,7 @@ import com.bumptech.glide.Glide import com.bumptech.glide.request.RequestOptions import com.mogo.module.common.glide.SkinAbleBitmapTarget import com.mogo.module.v2x.R +import com.mogo.module.v2x.V2XServiceManager import com.mogo.utils.logger.Logger import com.shuyu.gsyvideoplayer.GSYVideoManager import com.shuyu.gsyvideoplayer.utils.GSYVideoType @@ -45,6 +46,9 @@ class SimpleCoverVideoPlayer : StandardGSYVideoPlayer { } override fun getLayoutId(): Int { + if (V2XServiceManager.getMoGoStatusManager().isVrMode) { + return R.layout.v2x_road_video_plyer_layout_vr + } return R.layout.v2x_road_video_plyer_layout } diff --git a/modules/mogo-module-v2x/src/main/res/layout/v2x_road_video_plyer_layout_vr.xml b/modules/mogo-module-v2x/src/main/res/layout/v2x_road_video_plyer_layout_vr.xml new file mode 100644 index 0000000000..61c8b584da --- /dev/null +++ b/modules/mogo-module-v2x/src/main/res/layout/v2x_road_video_plyer_layout_vr.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + //加载中圈圈 + + + +