Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, Mapbo
SymbolLayer symbolLayer = mapboxMap.getLayerAs(FOREGROUND_LAYER);
assert symbolLayer != null;
assertThat(symbolLayer.getIconImage().getValue(), equalTo(FOREGROUND_ICON));
locationLayerPlugin.applyStyle(context, LocationLayerOptions.builder(context).staleStateDelay(400).build());
locationLayerPlugin.applyStyle(context, LocationLayerOptions.builder(context).staleStateTimeout(400).build());
locationLayerPlugin.forceLocationUpdate(location);
uiController.loopMainThreadForAtLeast(500);
assertThat(symbolLayer.getIconImage().getValue(), equalTo(FOREGROUND_STALE_ICON));
Expand All @@ -195,7 +195,7 @@ public void whenDrawableChanged_continuesUsingStaleIcons() throws Exception {
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerMode(RenderMode.NORMAL);
locationLayerPlugin.applyStyle(context, LocationLayerOptions.builder(context).staleStateDelay(100).build());
locationLayerPlugin.applyStyle(context, LocationLayerOptions.builder(context).staleStateTimeout(100).build());
locationLayerPlugin.forceLocationUpdate(location);
uiController.loopMainThreadForAtLeast(200);
rule.getActivity().toggleStyle();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ public static LocationLayerOptions createFromAttributes(@NonNull Context context
builder.enableStaleState(typedArray.getBoolean(
R.styleable.LocationLayer_enableStaleState, true));
}
if (typedArray.hasValue(R.styleable.LocationLayer_staleStateDelay)) {
builder.staleStateDelay(typedArray.getInteger(
R.styleable.LocationLayer_staleStateDelay, (int) STALE_STATE_DELAY_MS));
if (typedArray.hasValue(R.styleable.LocationLayer_staleStateTimeout)) {
builder.staleStateTimeout(typedArray.getInteger(
R.styleable.LocationLayer_staleStateTimeout, (int) STALE_STATE_DELAY_MS));
}
builder.gpsDrawable(typedArray.getResourceId(
R.styleable.LocationLayer_navigationDrawable, -1));
Expand Down Expand Up @@ -148,7 +148,7 @@ public static Builder builder(Context context) {
private static Builder builder() {
return new AutoValue_LocationLayerOptions.Builder()
.enableStaleState(true)
.staleStateDelay(STALE_STATE_DELAY_MS);
.staleStateTimeout(STALE_STATE_DELAY_MS);
}

/**
Expand Down Expand Up @@ -317,7 +317,7 @@ private static Builder builder() {
* @attr ref R.styleable#LocationLayer_staleStateDelay
* @since 0.4.0
*/
public abstract long staleStateDelay();
public abstract long staleStateTimeout();

/**
* Builder class for constructing a new instance of {@link LocationLayerOptions}.
Expand Down Expand Up @@ -481,17 +481,17 @@ public abstract static class Builder {
public abstract Builder enableStaleState(boolean enabled);

/**
* Set the delay before the location icon becomes stale. The timer begins approximately when a
* Set the timeout before the location icon becomes stale. The timer begins approximately when a
* new location update comes in and using this defined time, if an update hasn't occurred by the
* end, the location is considered stale.
*
* @param delay the duration in milliseconds which it should take before the location layer is
* considered stale
* @param timeout the duration in milliseconds which it should take before the location layer is
* considered stale
* @return this builder for chaining options together
* @attr ref R.styleable#LocationLayer_staleStateDelay
* @attr ref R.styleable#LocationLayer_staleStateTimeout
* @since 0.4.0
*/
public abstract Builder staleStateDelay(long delay);
public abstract Builder staleStateTimeout(long timeout);


abstract LocationLayerOptions autoBuild();
Expand Down
Loading