Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map + Location Animators #293

Merged
merged 41 commits into from
Mar 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6f79da7
Add initial animators
danesfeder Feb 19, 2018
d25dafa
Add Camera and Tracking Modes (#294)
danesfeder Feb 21, 2018
5031e32
Update with Render / Camera Modes (#297)
danesfeder Feb 21, 2018
b66d653
Add animator class (#302)
danesfeder Feb 22, 2018
4588147
Cleanup stale runnable (#304)
Feb 23, 2018
612f227
only update the location layer accuracy when not in RenderMode.GPS (#…
tobrun Feb 23, 2018
44a6602
Improve enabling/disabling location layer plugin (#308)
Feb 27, 2018
ce02ede
LocationLayerPlugin Javadoc (#309)
danesfeder Feb 27, 2018
a5f2dc9
LocationEngine listening to updates after resetting (#307)
Feb 27, 2018
999d19d
Add max / min zoom and padding APIs (#313)
danesfeder Feb 27, 2018
62a0e1c
Gestures logic for camera tracking, new telemetry library (#327)
Mar 1, 2018
ca7b10a
Update dependencies
danesfeder Mar 6, 2018
1b0e98d
Add missing long click listener
danesfeder Mar 7, 2018
94520b5
[location-layer] - fix crash on startup
tobrun Mar 7, 2018
2d40ff2
Add initial animators
danesfeder Feb 19, 2018
b835ece
Add Camera and Tracking Modes (#294)
danesfeder Feb 21, 2018
5b6e458
Update with Render / Camera Modes (#297)
danesfeder Feb 21, 2018
3c80c7c
Add animator class (#302)
danesfeder Feb 22, 2018
c1ec59a
Cleanup stale runnable (#304)
Feb 23, 2018
76cb80c
only update the location layer accuracy when not in RenderMode.GPS (#…
tobrun Feb 23, 2018
c44a596
Improve enabling/disabling location layer plugin (#308)
Feb 27, 2018
9a28ae5
LocationLayerPlugin Javadoc (#309)
danesfeder Feb 27, 2018
5ad4a96
LocationEngine listening to updates after resetting (#307)
Feb 27, 2018
a29e25b
Add max / min zoom and padding APIs (#313)
danesfeder Feb 27, 2018
c149689
Gestures logic for camera tracking, new telemetry library (#327)
Mar 1, 2018
704c902
Update dependencies
danesfeder Mar 6, 2018
54100a9
Add missing long click listener
danesfeder Mar 7, 2018
697b524
[location-layer] - fix crash on startup
tobrun Mar 7, 2018
ace099b
updated branch to latest on master
Mar 12, 2018
bfe40e9
Fixed checkstyle error
Mar 12, 2018
a540a87
fixed up ui test
Mar 12, 2018
1ccb76c
use old mas lib for geojson plugin
Mar 12, 2018
cf665f1
Merge branch 'map-location-animators' of github.com:mapbox/mapbox-plu…
danesfeder Mar 21, 2018
e001cf4
Animator Updates (#349)
danesfeder Mar 28, 2018
a2ac807
Gestures thresholds adjustments (#386)
Mar 28, 2018
7bd0c88
Fix order of interpolator expression (#388)
tobrun Mar 28, 2018
34a88e1
Merge branch 'map-location-animators' of github.com:mapbox/mapbox-plu…
danesfeder Mar 28, 2018
77dd29a
Merge branch 'master' into map-location-animators
danesfeder Mar 28, 2018
10f2900
Update feature import
danesfeder Mar 28, 2018
f80d879
fixup geojson
tobrun Mar 28, 2018
ebab085
fixup checkstyle
tobrun Mar 28, 2018
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
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ android {

buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testCoverageEnabled true
}
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
import com.mapbox.mapboxsdk.constants.Style;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.plugins.locationlayer.modes.RenderMode;
import com.mapbox.mapboxsdk.plugins.testapp.activity.location.LocationLayerModesActivity;
import com.mapbox.mapboxsdk.style.layers.Property;
import com.mapbox.mapboxsdk.style.layers.SymbolLayer;
Expand All @@ -38,7 +39,6 @@
import static com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerConstants.FOREGROUND_LAYER;
import static com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerConstants.FOREGROUND_STALE_ICON;
import static com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerConstants.LOCATION_SOURCE;
import static com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerConstants.NAVIGATION_LAYER;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertEquals;
Expand Down Expand Up @@ -91,7 +91,7 @@ public void locationSourceAdded() throws Exception {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
locationLayerPlugin.setRenderMode(RenderMode.NORMAL);
assertTrue(mapboxMap.getSource(LOCATION_SOURCE) != null);
}
});
Expand All @@ -103,7 +103,7 @@ public void locationTrackingLayersAdded() throws Exception {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
locationLayerPlugin.setRenderMode(RenderMode.NORMAL);
assertTrue(mapboxMap.getLayer(ACCURACY_LAYER) != null);
assertTrue(mapboxMap.getLayer(BACKGROUND_LAYER) != null);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER) != null);
Expand All @@ -117,7 +117,7 @@ public void locationBearingLayersAdded() throws Exception {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.COMPASS);
locationLayerPlugin.setRenderMode(RenderMode.COMPASS);
assertTrue(mapboxMap.getLayer(ACCURACY_LAYER) != null);
assertTrue(mapboxMap.getLayer(BACKGROUND_LAYER) != null);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER) != null);
Expand All @@ -132,8 +132,8 @@ public void locationNavigationLayersAdded() throws Exception {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.COMPASS);
assertTrue(mapboxMap.getLayer(NAVIGATION_LAYER) != null);
locationLayerPlugin.setRenderMode(RenderMode.COMPASS);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER) != null);
}
});
}
Expand All @@ -144,9 +144,9 @@ public void locationLayerModeCorrectlySetToNone() throws Exception {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
locationLayerPlugin.setRenderMode(RenderMode.NORMAL);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER) != null);
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.NONE);
locationLayerPlugin.setLocationLayerEnabled(false);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER).getVisibility().getValue()
.equals(Property.NONE));
}
Expand All @@ -159,11 +159,11 @@ public void onMapChangeLocationLayerRedrawn() throws Exception {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
locationLayerPlugin.setRenderMode(RenderMode.NORMAL);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER) != null);
mapboxMap.setStyleUrl(Style.SATELLITE);
uiController.loopMainThreadForAtLeast(500);
assertEquals(locationLayerPlugin.getLocationLayerMode(), LocationLayerMode.TRACKING);
assertEquals(locationLayerPlugin.getRenderMode(), RenderMode.NORMAL);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER) != null);
assertTrue(mapboxMap.getLayer(FOREGROUND_LAYER).getVisibility().getValue()
.equals(Property.VISIBLE));
Expand All @@ -181,11 +181,11 @@ public void whenStaleTimeSet_iconsDoChangeAtAppropriateTime() throws Exception {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
locationLayerPlugin.setRenderMode(RenderMode.NORMAL);
SymbolLayer symbolLayer = mapboxMap.getLayerAs(FOREGROUND_LAYER);
assert symbolLayer != null;
assertThat(symbolLayer.getIconImage().getValue(), equalTo(FOREGROUND_ICON));
locationLayerPlugin.applyStyle(LocationLayerOptions.builder(context).staleStateDelay(400).build());
locationLayerPlugin.applyStyle(LocationLayerOptions.builder(context).staleStateTimeout(400).build());
locationLayerPlugin.forceLocationUpdate(location);
uiController.loopMainThreadForAtLeast(500);
assertThat(symbolLayer.getIconImage().getValue(), equalTo(FOREGROUND_STALE_ICON));
Expand All @@ -199,8 +199,8 @@ public void whenDrawableChanged_continuesUsingStaleIcons() throws Exception {
@Override
public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, MapboxMap mapboxMap,
UiController uiController, Context context) {
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
locationLayerPlugin.applyStyle(LocationLayerOptions.builder(context).staleStateDelay(100).build());
locationLayerPlugin.setRenderMode(RenderMode.NORMAL);
locationLayerPlugin.applyStyle(LocationLayerOptions.builder(context).staleStateTimeout(100).build());
locationLayerPlugin.forceLocationUpdate(location);
uiController.loopMainThreadForAtLeast(200);
rule.getActivity().toggleStyle();
Expand All @@ -215,9 +215,10 @@ public void onLocationLayerAction(LocationLayerPlugin locationLayerPlugin, Mapbo
public void whenMapCameraInitializesTilted_iconsGetPlacedWithCorrectOffset() throws Exception {
executeLocationLayerTest((locationLayerPlugin, mapboxMap, uiController, context) -> {
mapboxMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition.Builder().tilt(60).build()));
locationLayerPlugin.setLocationLayerEnabled(LocationLayerMode.TRACKING);
locationLayerPlugin.setRenderMode(RenderMode.NORMAL);
locationLayerPlugin.forceLocationUpdate(location);
SymbolLayer layer = mapboxMap.getLayerAs(FOREGROUND_LAYER);
uiController.loopMainThreadForAtLeast(200);
Float[] value = layer.getIconOffset().getValue();
Assert.assertEquals((-0.05 * 60), value[1], 0.1);
});
Expand Down
Loading