private static List<PatternItem> getStrokePattern(UiOptions.StrokePatternDef strokePatternDef) { List<PatternItem> patternItems = new ArrayList<>(); switch (strokePatternDef) { case DEFAULT: patternItems = null; break; case DASHED: patternItems = PATTERN_DASHED; break; case DOTTED: patternItems = PATTERN_DOTTED; break; case MIXED: patternItems = PATTERN_MIXED; break; } return patternItems; }
/** * Updates all UI fields. */ private void updateUI(final Location oldLocation) { if (!isLocationEnabled && map != null) { mRequestingLocationUpdates = true; zoom = map.getCameraPosition().zoom; Log.i("CAMERA_ZOOM", "zoom:" + zoom); if (mCurrentLocation != null) { marker = placeMarker(PiecePicker.getPiece(new PieceSquareShape(PIECE_SIZE), piece), mCurrentLocation); } } if (mCurrentLocation != null) { if (oldLocation!= null) { // refresh ogni 2 sec -> record mondiale 8,33m/s => ~16 ogni 2 sec => 15 // per essere sicuri if (CoordinatesUtility.distance(mCurrentLocation, oldLocation)<MAX_DIFFERENCE_UPDATE_POLYLINE) { List<PatternItem> dashItems = new ArrayList<>(); // 5 and 10 pixel long dash dashItems.add(new Dash(5)); dashItems.add(new Gap(25)); dashItems.add(new Dash(15)); map.addPolyline(new PolylineOptions() .add(new LatLng(oldLocation.getLatitude(), oldLocation.getLongitude()), new LatLng(mCurrentLocation.getLatitude(), mCurrentLocation.getLongitude())) .endCap(new RoundCap()) .startCap(new RoundCap()) .pattern(dashItems) .width(30) .color(Color.CYAN)); if (marker == null) { PieceShape markerPic = new PieceSquareShape(PIECE_SIZE); marker = placeMarker(PiecePicker.getPiece(markerPic, piece), mCurrentLocation); } marker.setPosition(new LatLng(mCurrentLocation.getLatitude(), mCurrentLocation.getLongitude())); } if (drawer != null) { showHintIfNear(); } } map.moveCamera(CameraUpdateFactory.newLatLngZoom( new LatLng(mCurrentLocation.getLatitude(), mCurrentLocation.getLongitude()), map.getCameraPosition().zoom)); } }
public List<PatternItem> getStrokePattern() { return real.getStrokePattern(); }
public PolygonOptions strokePattern(List<PatternItem> pattern) { real.strokePattern(pattern); return this; }
public List<PatternItem> getPattern() { return real.getPattern(); }
public CircleOptions strokePattern(List<PatternItem> pattern) { real.strokePattern(pattern); return this; }
@Override public List<PatternItem> getStrokePattern() { return real.getStrokePattern(); }
@Override public void setStrokePattern(List<PatternItem> strokePattern) { real.setStrokePattern(strokePattern); }
@Override public List<PatternItem> getPattern() { return real.getPattern(); }
@Override public void setPattern(List<PatternItem> pattern) { real.setPattern(pattern); }
List<PatternItem> getStrokePattern();
void setStrokePattern(List<PatternItem> strokePattern);
List<PatternItem> getPattern();
void setPattern(List<PatternItem> pattern);