@Test public void changeLocationUpdatesShouldReturnFalseWhenGivenValidLocationUpdateParams() { assertFalse(kujakuMapView.changeLocationUpdates(5000, 2000, 999)); }
@Override public boolean changeLocationUpdates(long updateInterval, long fastestUpdateInterval, int accuracyLevel) { ILocationClient locationClient = getLocationClient(); if (updateInterval > -1 && fastestUpdateInterval > -1 && (accuracyLevel == LocationRequest.PRIORITY_HIGH_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_LOW_POWER || accuracyLevel == LocationRequest.PRIORITY_NO_POWER) && locationClient != null) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(accuracyLevel); for (LocationListener locationListener : locationClient.getLocationListeners()) { ((GoogleLocationClient)locationClient) .requestLocationUpdates(locationListener, locationRequest); } return locationClient.getLocationListeners().size() > 0; } return false; }
KujakuMapView extends MapView implements IKujakuMapView, MapboxMap.OnMapClickListener, MapboxMap.OnMapLongClickListener { @Override public boolean changeLocationUpdates(long updateInterval, long fastestUpdateInterval, int accuracyLevel) { ILocationClient locationClient = getLocationClient(); if (updateInterval > -1 && fastestUpdateInterval > -1 && (accuracyLevel == LocationRequest.PRIORITY_HIGH_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_LOW_POWER || accuracyLevel == LocationRequest.PRIORITY_NO_POWER) && locationClient != null) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(accuracyLevel); for (LocationListener locationListener : locationClient.getLocationListeners()) { ((GoogleLocationClient)locationClient) .requestLocationUpdates(locationListener, locationRequest); } return locationClient.getLocationListeners().size() > 0; } return false; } }
KujakuMapView extends MapView implements IKujakuMapView, MapboxMap.OnMapClickListener, MapboxMap.OnMapLongClickListener { @Override public boolean changeLocationUpdates(long updateInterval, long fastestUpdateInterval, int accuracyLevel) { ILocationClient locationClient = getLocationClient(); if (updateInterval > -1 && fastestUpdateInterval > -1 && (accuracyLevel == LocationRequest.PRIORITY_HIGH_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_LOW_POWER || accuracyLevel == LocationRequest.PRIORITY_NO_POWER) && locationClient != null) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(accuracyLevel); for (LocationListener locationListener : locationClient.getLocationListeners()) { ((GoogleLocationClient)locationClient) .requestLocationUpdates(locationListener, locationRequest); } return locationClient.getLocationListeners().size() > 0; } return false; } KujakuMapView(@NonNull Context context);  KujakuMapView(@NonNull Context context, @Nullable AttributeSet attrs);  KujakuMapView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr);  KujakuMapView(@NonNull Context context, @Nullable MapboxMapOptions options); }
KujakuMapView extends MapView implements IKujakuMapView, MapboxMap.OnMapClickListener, MapboxMap.OnMapLongClickListener { @Override public boolean changeLocationUpdates(long updateInterval, long fastestUpdateInterval, int accuracyLevel) { ILocationClient locationClient = getLocationClient(); if (updateInterval > -1 && fastestUpdateInterval > -1 && (accuracyLevel == LocationRequest.PRIORITY_HIGH_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_LOW_POWER || accuracyLevel == LocationRequest.PRIORITY_NO_POWER) && locationClient != null) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(accuracyLevel); for (LocationListener locationListener : locationClient.getLocationListeners()) { ((GoogleLocationClient)locationClient) .requestLocationUpdates(locationListener, locationRequest); } return locationClient.getLocationListeners().size() > 0; } return false; } KujakuMapView(@NonNull Context context);  KujakuMapView(@NonNull Context context, @Nullable AttributeSet attrs);  KujakuMapView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr);  KujakuMapView(@NonNull Context context, @Nullable MapboxMapOptions options); @Override void addPoint(boolean useGPS, @NonNull final AddPointCallback addPointCallback); @Override void addPoint(boolean useGPS, @NonNull AddPointCallback addPointCallback, @Nullable MarkerOptions markerOptions); @Override void addPoint(boolean useGPS, @NonNull AddPointCallback addPointCallback, @DrawableRes int markerResourceId); @Override void enableAddPoint(boolean canAddPoint); void setViewVisibility(View view, boolean isVisible); @Override void enableAddPoint(boolean canAddPoint, @Nullable final OnLocationChanged onLocationChanged); @Override @Nullable JSONObject dropPoint(); @Nullable @Override JSONObject dropPoint(@DrawableRes int markerResourceId); @Override @Nullable JSONObject dropPoint(@Nullable LatLng latLng); @Nullable @Override JSONObject dropPoint(@Nullable MarkerOptions markerOptions); @Nullable @Override JSONObject dropPoint(@Nullable LatLng latLng, @DrawableRes int markerResourceId); Set<WmtsLayer> getWmtsLayers(); @Override void addWmtsLayer(@NonNull WmtsCapabilities capabilities); @Override void addWmtsLayer(@NonNull WmtsCapabilities capabilities, @Nullable String layerIdentifier); @Override void addWmtsLayer(@NonNull WmtsCapabilities capabilities, @Nullable String layerIdentifier, @Nullable String styleIdentifier); @Override void addWmtsLayer(@NonNull WmtsCapabilities capabilities, @Nullable String layerIdentifier, @Nullable String styleIdentifier, @Nullable String tileMatrixSetLinkIdentifier); boolean isCanAddPoint(); void centerMap(@NonNull LatLng point, int animateToNewTargetDuration, double newZoom); void centerMap(@NonNull LatLng point, int animateToNewTargetDuration); @Override void onStop(); @Override void showCurrentLocationBtn(boolean isVisible); void setVisibility(View view, boolean isVisible); Set<io.ona.kujaku.domain.Point> getDroppedPoints(); void updateDroppedPoints(List<io.ona.kujaku.domain.Point> droppedPoints); @Override void setOnFeatureClickListener(@NonNull OnFeatureClickListener onFeatureClickListener, @Nullable String... layerIds); @Override void setOnFeatureClickListener(@NonNull OnFeatureClickListener onFeatureClickListener, @Nullable Expression expressionFilter, @Nullable String... layerIds); @Override void setOnFeatureLongClickListener(@NonNull OnFeatureLongClickListener onFeatureLongClickListener, @Nullable String... layerIds); @Override void setOnFeatureLongClickListener(@NonNull OnFeatureLongClickListener onFeatureLongClickListener, @Nullable Expression expressionFilter, @Nullable String... layerIds); void setOnKujakuLayerClickListener(@NonNull OnKujakuLayerClickListener onKujakuLayerClickListener); void setOnKujakuLayerLongClickListener(@NonNull OnKujakuLayerLongClickListener onKujakuLayerLongClickListener); @Override void focusOnUserLocation(boolean focusOnMyLocation); @Override void focusOnUserLocation(boolean focusOnMyLocation, int renderMode); @Override void focusOnUserLocation(boolean focusOnMyLocation, Float radius); @Override void focusOnUserLocation(boolean focusOnMyLocation, Float radius, int renderMode); @Override void setBoundsChangeListener(@Nullable BoundsChangeListener boundsChangeListener); @Override void addFeaturePoints(FeatureCollection featureCollection); @Override void updateFeaturePointProperties(FeatureCollection featureCollection); void initializePrimaryGeoJsonSource(String sourceId, boolean isFetchSourceFromStyle, String geoJsonSource); CameraPosition getCameraPosition(); void setCameraPosition(CameraPosition cameraPosition); GeoJsonSource getPrimaryGeoJsonSource(); Layer getPrimaryLayer(); void setPrimaryLayer(Layer layer); String getPrimaryGeoJsonSourceId(); void setPrimaryGeoJsonSourceId(String primaryGeoJsonSourceId); String getGeoJsonSourceString(); void setGeoJsonSourceString(String geoJsonSourceString); @Override void onPause(); @Override void onResume(); @Override boolean onMapClick(@NonNull LatLng point); @Override boolean onMapLongClick(@NonNull LatLng point); boolean isWarmGps(); void setWarmGps(boolean warmGps); void setWarmGps(boolean warmGps, @Nullable String rejectionDialogTitle, @Nullable String rejectionDialogMessage); void setWarmGps(boolean warmGps, @Nullable String rejectionDialogTitle, @Nullable String rejectionDialogMessage, OnLocationServicesEnabledCallBack onLocationServicesEnabledCallBack); @Nullable @Override ILocationClient getLocationClient(); void setLocationBufferRadius(float locationBufferRadius); @Override void getLocationClient(@Nullable LocationClientStartedCallback locationClientStartedCallback); @Override void addLayer(@NonNull KujakuLayer kujakuLayer); @Override void disableLayer(@NonNull KujakuLayer kujakuLayer); @Override boolean changeLocationUpdates(long updateInterval, long fastestUpdateInterval, int accuracyLevel); @Override boolean isKujakuLayerAdded(@NonNull KujakuLayer kujakuLayer); @Override void removeLayer(@NonNull KujakuLayer kujakuLayer); MapboxLocationComponentWrapper getMapboxLocationComponentWrapper(); void initTrackingService(@NonNull TrackingServiceListener trackingServiceListener,
                                    TrackingServiceUIConfiguration uiConfiguration,
                                    TrackingServiceOptions options); boolean resumeTrackingService(Context context); void startTrackingService(@NonNull Context context,
                                     @NonNull Class<?> cls); List<KujakuLocation> stopTrackingService(@NonNull Context context); boolean setTag(long tag); void trackingServiceTakeLocation(long tag); void trackingServiceTakeLocation(); List<KujakuLocation> getTrackingServiceRecordedKujakuLocations(); @Override void setDisableMyLocationOnMapMove(boolean disableMyLocationOnMapMove); MBTilesHelper getMbTilesHelper(); @Override void onDestroy(); }
KujakuMapView extends MapView implements IKujakuMapView, MapboxMap.OnMapClickListener, MapboxMap.OnMapLongClickListener { @Override public boolean changeLocationUpdates(long updateInterval, long fastestUpdateInterval, int accuracyLevel) { ILocationClient locationClient = getLocationClient(); if (updateInterval > -1 && fastestUpdateInterval > -1 && (accuracyLevel == LocationRequest.PRIORITY_HIGH_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY || accuracyLevel == LocationRequest.PRIORITY_LOW_POWER || accuracyLevel == LocationRequest.PRIORITY_NO_POWER) && locationClient != null) { LocationRequest locationRequest = new LocationRequest(); locationRequest.setInterval(updateInterval); locationRequest.setFastestInterval(fastestUpdateInterval); locationRequest.setPriority(accuracyLevel); for (LocationListener locationListener : locationClient.getLocationListeners()) { ((GoogleLocationClient)locationClient) .requestLocationUpdates(locationListener, locationRequest); } return locationClient.getLocationListeners().size() > 0; } return false; } KujakuMapView(@NonNull Context context);  KujakuMapView(@NonNull Context context, @Nullable AttributeSet attrs);  KujakuMapView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr);  KujakuMapView(@NonNull Context context, @Nullable MapboxMapOptions options); @Override void addPoint(boolean useGPS, @NonNull final AddPointCallback addPointCallback); @Override void addPoint(boolean useGPS, @NonNull AddPointCallback addPointCallback, @Nullable MarkerOptions markerOptions); @Override void addPoint(boolean useGPS, @NonNull AddPointCallback addPointCallback, @DrawableRes int markerResourceId); @Override void enableAddPoint(boolean canAddPoint); void setViewVisibility(View view, boolean isVisible); @Override void enableAddPoint(boolean canAddPoint, @Nullable final OnLocationChanged onLocationChanged); @Override @Nullable JSONObject dropPoint(); @Nullable @Override JSONObject dropPoint(@DrawableRes int markerResourceId); @Override @Nullable JSONObject dropPoint(@Nullable LatLng latLng); @Nullable @Override JSONObject dropPoint(@Nullable MarkerOptions markerOptions); @Nullable @Override JSONObject dropPoint(@Nullable LatLng latLng, @DrawableRes int markerResourceId); Set<WmtsLayer> getWmtsLayers(); @Override void addWmtsLayer(@NonNull WmtsCapabilities capabilities); @Override void addWmtsLayer(@NonNull WmtsCapabilities capabilities, @Nullable String layerIdentifier); @Override void addWmtsLayer(@NonNull WmtsCapabilities capabilities, @Nullable String layerIdentifier, @Nullable String styleIdentifier); @Override void addWmtsLayer(@NonNull WmtsCapabilities capabilities, @Nullable String layerIdentifier, @Nullable String styleIdentifier, @Nullable String tileMatrixSetLinkIdentifier); boolean isCanAddPoint(); void centerMap(@NonNull LatLng point, int animateToNewTargetDuration, double newZoom); void centerMap(@NonNull LatLng point, int animateToNewTargetDuration); @Override void onStop(); @Override void showCurrentLocationBtn(boolean isVisible); void setVisibility(View view, boolean isVisible); Set<io.ona.kujaku.domain.Point> getDroppedPoints(); void updateDroppedPoints(List<io.ona.kujaku.domain.Point> droppedPoints); @Override void setOnFeatureClickListener(@NonNull OnFeatureClickListener onFeatureClickListener, @Nullable String... layerIds); @Override void setOnFeatureClickListener(@NonNull OnFeatureClickListener onFeatureClickListener, @Nullable Expression expressionFilter, @Nullable String... layerIds); @Override void setOnFeatureLongClickListener(@NonNull OnFeatureLongClickListener onFeatureLongClickListener, @Nullable String... layerIds); @Override void setOnFeatureLongClickListener(@NonNull OnFeatureLongClickListener onFeatureLongClickListener, @Nullable Expression expressionFilter, @Nullable String... layerIds); void setOnKujakuLayerClickListener(@NonNull OnKujakuLayerClickListener onKujakuLayerClickListener); void setOnKujakuLayerLongClickListener(@NonNull OnKujakuLayerLongClickListener onKujakuLayerLongClickListener); @Override void focusOnUserLocation(boolean focusOnMyLocation); @Override void focusOnUserLocation(boolean focusOnMyLocation, int renderMode); @Override void focusOnUserLocation(boolean focusOnMyLocation, Float radius); @Override void focusOnUserLocation(boolean focusOnMyLocation, Float radius, int renderMode); @Override void setBoundsChangeListener(@Nullable BoundsChangeListener boundsChangeListener); @Override void addFeaturePoints(FeatureCollection featureCollection); @Override void updateFeaturePointProperties(FeatureCollection featureCollection); void initializePrimaryGeoJsonSource(String sourceId, boolean isFetchSourceFromStyle, String geoJsonSource); CameraPosition getCameraPosition(); void setCameraPosition(CameraPosition cameraPosition); GeoJsonSource getPrimaryGeoJsonSource(); Layer getPrimaryLayer(); void setPrimaryLayer(Layer layer); String getPrimaryGeoJsonSourceId(); void setPrimaryGeoJsonSourceId(String primaryGeoJsonSourceId); String getGeoJsonSourceString(); void setGeoJsonSourceString(String geoJsonSourceString); @Override void onPause(); @Override void onResume(); @Override boolean onMapClick(@NonNull LatLng point); @Override boolean onMapLongClick(@NonNull LatLng point); boolean isWarmGps(); void setWarmGps(boolean warmGps); void setWarmGps(boolean warmGps, @Nullable String rejectionDialogTitle, @Nullable String rejectionDialogMessage); void setWarmGps(boolean warmGps, @Nullable String rejectionDialogTitle, @Nullable String rejectionDialogMessage, OnLocationServicesEnabledCallBack onLocationServicesEnabledCallBack); @Nullable @Override ILocationClient getLocationClient(); void setLocationBufferRadius(float locationBufferRadius); @Override void getLocationClient(@Nullable LocationClientStartedCallback locationClientStartedCallback); @Override void addLayer(@NonNull KujakuLayer kujakuLayer); @Override void disableLayer(@NonNull KujakuLayer kujakuLayer); @Override boolean changeLocationUpdates(long updateInterval, long fastestUpdateInterval, int accuracyLevel); @Override boolean isKujakuLayerAdded(@NonNull KujakuLayer kujakuLayer); @Override void removeLayer(@NonNull KujakuLayer kujakuLayer); MapboxLocationComponentWrapper getMapboxLocationComponentWrapper(); void initTrackingService(@NonNull TrackingServiceListener trackingServiceListener,
                                    TrackingServiceUIConfiguration uiConfiguration,
                                    TrackingServiceOptions options); boolean resumeTrackingService(Context context); void startTrackingService(@NonNull Context context,
                                     @NonNull Class<?> cls); List<KujakuLocation> stopTrackingService(@NonNull Context context); boolean setTag(long tag); void trackingServiceTakeLocation(long tag); void trackingServiceTakeLocation(); List<KujakuLocation> getTrackingServiceRecordedKujakuLocations(); @Override void setDisableMyLocationOnMapMove(boolean disableMyLocationOnMapMove); MBTilesHelper getMbTilesHelper(); @Override void onDestroy(); static final double LOCATION_FOCUS_ZOOM; }