[android] bumped gestures library version to 0.1.0 (#11483)

This commit is contained in:
Łukasz Paczos
2018-03-20 13:03:06 +01:00
committed by GitHub
parent ef1dcc0d5b
commit a2250098f5
5 changed files with 44 additions and 51 deletions

View File

@@ -58,7 +58,6 @@ public class GestureDetectorActivity extends AppCompatActivity {
private Marker marker;
@Nullable
private LatLng focalPointLatLng;
private boolean animationsEnabled = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -198,9 +197,7 @@ public class GestureDetectorActivity extends AppCompatActivity {
if (focalPointLatLng != null) {
gestureAlertsAdapter.addAlert(new GestureAlert(GestureAlert.TYPE_OTHER, "REVERTING MOVE THRESHOLD"));
gesturesManager.getMoveGestureDetector().setMoveThreshold(
gesturesManager.getMoveGestureDetector().getDefaultMoveThreshold()
);
gesturesManager.getMoveGestureDetector().setMoveThreshold(0f);
}
}
});
@@ -242,8 +239,7 @@ public class GestureDetectorActivity extends AppCompatActivity {
mapboxMap.getUiSettings().setFocalPoint(mapboxMap.getProjection().toScreenLocation(focalPointLatLng));
return true;
case R.id.menu_gesture_animation:
animationsEnabled = !animationsEnabled;
mapboxMap.getUiSettings().setAllVelocityAnimationsEnabled(animationsEnabled);
mapboxMap.getUiSettings().setAllVelocityAnimationsEnabled(false);
}
return super.onOptionsItemSelected(item);
}
@@ -251,10 +247,8 @@ public class GestureDetectorActivity extends AppCompatActivity {
private void resetModes() {
focalPointLatLng = null;
mapboxMap.getUiSettings().setFocalPoint(null);
gesturesManager.getMoveGestureDetector().setMoveThreshold(
gesturesManager.getMoveGestureDetector().getDefaultMoveThreshold()
);
gesturesManager.getMoveGestureDetector().setMoveThreshold(0f);
mapboxMap.getUiSettings().setAllVelocityAnimationsEnabled(true);
if (marker != null) {
mapboxMap.removeMarker(marker);

View File

@@ -8,5 +8,5 @@
android:title="Focus on a point" />
<item
android:id="@+id/menu_gesture_animation"
android:title="Toggle velocity animations" />
android:title="Turn off velocity animations" />
</menu>