Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Android Tilt Implementation #3158

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
36eb07a
[android] #2805 - Initial CameraPosition API
bleege Nov 30, 2015
339f806
[android] #2805 - Implementing Parcelable and adding Builder
bleege Dec 1, 2015
645e9ee
[android] #2805 - add sample tilt activity to test app
zugaldia Dec 1, 2015
d289f23
[android] #2805 - Adding Toolbar to TiltActivity for consistent navig…
bleege Dec 2, 2015
48f8bbf
[android] #2805 - CameraUpdate and animateCamera() API
bleege Dec 2, 2015
556ea6f
[android] #2805 - Adding processing of target, zoom, and bearing in a…
bleege Dec 2, 2015
b23caa7
[android] #2805 - Basic wiring up of Android Tilt methods to Core GL …
bleege Dec 3, 2015
f22c5f1
[android] #2805 - Create a target to keep both location values consis…
zugaldia Dec 3, 2015
4567d7d
[android] #2805 - Setting TiltActivity to test setPitch() directly. …
bleege Dec 3, 2015
3ce3656
[android] #2805 - Placeholder for a ShoveGestureListener
zugaldia Dec 3, 2015
038318c
[android] #2805 - public API to enable or disable tilt
zugaldia Dec 3, 2015
bd5bb94
[android] #2805 - add mShoveGestureDetector to the event chain
zugaldia Dec 3, 2015
57705ac
[android] #2805 - Updating Tilt API to support animation duration time
bleege Dec 3, 2015
56a4f57
[android] #2805 - basic tilt gesture working with ShoveGestureListener
zugaldia Dec 3, 2015
17cdc1c
Merge remote-tracking branch 'origin/2805-android-tilt' into 2805-and…
bleege Dec 3, 2015
9f8acf5
[android] #2805 - Integrating gesture with new get / set Tilt API ref…
bleege Dec 3, 2015
eede504
[android] #2805 - Removing Camera API for now
bleege Dec 3, 2015
ddf3a4b
[android] #2805 - scale and clamp values for pitch
zugaldia Dec 3, 2015
b20f5db
[android] #2805 - scale and clamp values for pitch
zugaldia Dec 3, 2015
4ac5f3d
[android] #2805 - Using MINIMUM_TILT and MAXIMUM_TILT constants for a…
bleege Dec 3, 2015
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
Prev Previous commit
Next Next commit
[android] #2805 - Placeholder for a ShoveGestureListener
  • Loading branch information
zugaldia committed Dec 3, 2015
commit 3ce3656eb54c0ecdb51b0823e6fca8202bd7c4cb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import android.widget.ZoomButtonsController;

import com.almeros.android.multitouch.gesturedetectors.RotateGestureDetector;
import com.almeros.android.multitouch.gesturedetectors.ShoveGestureDetector;
import com.almeros.android.multitouch.gesturedetectors.TwoFingerGestureDetector;
import com.mapbox.mapboxsdk.R;
import com.mapbox.mapboxsdk.annotations.Annotation;
Expand Down Expand Up @@ -180,6 +181,7 @@ public final class MapView extends FrameLayout {
private GestureDetectorCompat mGestureDetector;
private ScaleGestureDetector mScaleGestureDetector;
private RotateGestureDetector mRotateGestureDetector;
private ShoveGestureDetector mShoveGestureDetector;
private boolean mTwoTap = false;
private boolean mZoomStarted = false;
private boolean mQuickZoom = false;
Expand Down Expand Up @@ -682,6 +684,7 @@ private void initialize(Context context, AttributeSet attrs) {
mScaleGestureDetector = new ScaleGestureDetector(context, new ScaleGestureListener());
ScaleGestureDetectorCompat.setQuickScaleEnabled(mScaleGestureDetector, true);
mRotateGestureDetector = new RotateGestureDetector(context, new RotateGestureListener());
mShoveGestureDetector = new ShoveGestureDetector(context, new ShoveGestureListener());

// Shows the zoom controls
if (!context.getPackageManager()
Expand Down Expand Up @@ -2831,6 +2834,26 @@ public boolean onRotate(RotateGestureDetector detector) {
}
}

// This class handles a vertical two-finger shove. (If you place two fingers on screen with
// less than a 20 degree angle between them, this will detect movement on the Y-axis.)
private class ShoveGestureListener implements ShoveGestureDetector.OnShoveGestureListener {

@Override
public boolean onShove(ShoveGestureDetector detector) {
return false;
}

@Override
public boolean onShoveBegin(ShoveGestureDetector detector) {
return false;
}

@Override
public void onShoveEnd(ShoveGestureDetector detector) {

}
}

// This class handles input events from the zoom control buttons
// Zoom controls allow single touch only devices to zoom in and out
private class OnZoomListener implements ZoomButtonsController.OnZoomListener {
Expand Down