summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorBrad Leege <bleege@gmail.com>2015-02-25 13:21:23 -0600
committerBrad Leege <bleege@gmail.com>2015-02-25 13:21:23 -0600
commit77cf66d91f9cefabb9f598c463def5ab35fb68cc (patch)
tree1a6a8155b91a11633764f3f6f1986650800bad10 /android
parent837248d80f5f9798f68905f2fca0cd1fabb62b86 (diff)
downloadqtlocation-mapboxgl-77cf66d91f9cefabb9f598c463def5ab35fb68cc.tar.gz
#895 - Fixing missing JavaDoc warnings.
Diffstat (limited to 'android')
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/BaseGestureDetector.java62
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/TwoFingerGestureDetector.java68
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/BaseGestureDetector.java32
-rw-r--r--android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/TwoFingerGestureDetector.java38
4 files changed, 100 insertions, 100 deletions
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/BaseGestureDetector.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/BaseGestureDetector.java
index dafac2a1ab..8c0c544983 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/BaseGestureDetector.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/BaseGestureDetector.java
@@ -12,15 +12,15 @@ import android.view.MotionEvent;
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
public abstract class BaseGestureDetector {
@@ -29,12 +29,12 @@ public abstract class BaseGestureDetector {
protected MotionEvent mPrevEvent;
protected MotionEvent mCurrEvent;
-
+
protected float mCurrPressure;
protected float mPrevPressure;
protected long mTimeDelta;
-
-
+
+
/**
* This value is the threshold ratio between the previous combined pressure
* and the current combined pressure. When pressure decreases rapidly
@@ -44,19 +44,19 @@ public abstract class BaseGestureDetector {
*/
protected static final float PRESSURE_THRESHOLD = 0.67f;
-
+
public BaseGestureDetector(Context context) {
- mContext = context;
+ mContext = context;
}
-
+
/**
* All gesture detectors need to be called through this method to be able to
* detect gestures. This method delegates work to handler methods
* (handleStartProgressEvent, handleInProgressEvent) implemented in
* extending classes.
- *
- * @param event
- * @return
+ *
+ * @param event MotionEvent
+ * @return true
*/
public boolean onTouchEvent(MotionEvent event){
final int actionCode = event.getAction() & MotionEvent.ACTION_MASK;
@@ -67,37 +67,37 @@ public abstract class BaseGestureDetector {
}
return true;
}
-
+
/**
* Called when the current event occurred when NO gesture is in progress
* yet. The handling in this implementation may set the gesture in progress
* (via mGestureInProgress) or out of progress
- * @param actionCode
- * @param event
+ * @param actionCode Action Code from MotionEvent
+ * @param event MotionEvent
*/
protected abstract void handleStartProgressEvent(int actionCode, MotionEvent event);
-
+
/**
* Called when the current event occurred when a gesture IS in progress. The
* handling in this implementation may set the gesture out of progress (via
* mGestureInProgress).
- * @param actionCode
- * @param event
+ * @param actionCode Action Code from MotionEvent
+ * @param event MotionEvent
*/
protected abstract void handleInProgressEvent(int actionCode, MotionEvent event);
-
-
+
+
protected void updateStateByEvent(MotionEvent curr){
final MotionEvent prev = mPrevEvent;
-
+
// Reset mCurrEvent
if (mCurrEvent != null) {
mCurrEvent.recycle();
mCurrEvent = null;
}
mCurrEvent = MotionEvent.obtain(curr);
-
-
+
+
// Delta time
mTimeDelta = curr.getEventTime() - prev.getEventTime();
@@ -105,7 +105,7 @@ public abstract class BaseGestureDetector {
mCurrPressure = curr.getPressure(curr.getActionIndex());
mPrevPressure = prev.getPressure(prev.getActionIndex());
}
-
+
protected void resetState() {
if (mPrevEvent != null) {
mPrevEvent.recycle();
@@ -130,7 +130,7 @@ public abstract class BaseGestureDetector {
/**
* Return the time difference in milliseconds between the previous accepted
* GestureDetector event and the current GestureDetector event.
- *
+ *
* @return Time difference since the last move event in milliseconds.
*/
public long getTimeDelta() {
@@ -140,11 +140,11 @@ public abstract class BaseGestureDetector {
/**
* Return the event time of the current GestureDetector event being
* processed.
- *
+ *
* @return Current GestureDetector event time in milliseconds.
*/
public long getEventTime() {
return mCurrEvent.getEventTime();
}
-
+
}
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/TwoFingerGestureDetector.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/TwoFingerGestureDetector.java
index 57e4e21d2d..6c6a0e4bfa 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/TwoFingerGestureDetector.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/TwoFingerGestureDetector.java
@@ -14,15 +14,15 @@ import android.view.ViewConfiguration;
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
- * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*/
public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
@@ -30,33 +30,33 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
private final float mEdgeSlop;
private float mRightSlopEdge;
private float mBottomSlopEdge;
-
+
protected float mPrevFingerDiffX;
protected float mPrevFingerDiffY;
protected float mCurrFingerDiffX;
protected float mCurrFingerDiffY;
-
+
private float mCurrLen;
private float mPrevLen;
-
+
public TwoFingerGestureDetector(Context context) {
super(context);
-
+
ViewConfiguration config = ViewConfiguration.get(context);
- mEdgeSlop = config.getScaledEdgeSlop();
+ mEdgeSlop = config.getScaledEdgeSlop();
}
-
+
@Override
protected abstract void handleStartProgressEvent(int actionCode, MotionEvent event);
@Override
protected abstract void handleInProgressEvent(int actionCode, MotionEvent event);
-
+
protected void updateStateByEvent(MotionEvent curr){
super.updateStateByEvent(curr);
-
+
final MotionEvent prev = mPrevEvent;
-
+
mCurrLen = -1;
mPrevLen = -1;
@@ -69,7 +69,7 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
final float pvy = py1 - py0;
mPrevFingerDiffX = pvx;
mPrevFingerDiffY = pvy;
-
+
// Current
final float cx0 = curr.getX(0);
final float cy0 = curr.getY(0);
@@ -80,11 +80,11 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
mCurrFingerDiffX = cvx;
mCurrFingerDiffY = cvy;
}
-
+
/**
* Return the current distance between the two pointers forming the
* gesture in progress.
- *
+ *
* @return Distance between pointers in pixels.
*/
public float getCurrentSpan() {
@@ -99,7 +99,7 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
/**
* Return the previous distance between the two pointers forming the
* gesture in progress.
- *
+ *
* @return Previous distance between pointers in pixels.
*/
public float getPreviousSpan() {
@@ -110,52 +110,52 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
}
return mPrevLen;
}
-
+
/**
- * MotionEvent has no getRawX(int) method; simulate it pending future API approval.
+ * MotionEvent has no getRawX(int) method; simulate it pending future API approval.
* @param event
* @param pointerIndex
- * @return
+ * @return Raw X value or 0
*/
protected static float getRawX(MotionEvent event, int pointerIndex) {
float offset = event.getX() - event.getRawX();
if(pointerIndex < event.getPointerCount()){
return event.getX(pointerIndex) + offset;
- }
+ }
return 0f;
}
/**
- * MotionEvent has no getRawY(int) method; simulate it pending future API approval.
+ * MotionEvent has no getRawY(int) method; simulate it pending future API approval.
* @param event
* @param pointerIndex
- * @return
+ * @return Raw Y value or 0
*/
protected static float getRawY(MotionEvent event, int pointerIndex) {
float offset = event.getY() - event.getRawY();
if(pointerIndex < event.getPointerCount()){
return event.getY(pointerIndex) + offset;
- }
+ }
return 0f;
}
/**
* Check if we have a sloppy gesture. Sloppy gestures can happen if the edge
* of the user's hand is touching the screen, for example.
- *
- * @param event
- * @return
+ *
+ * @param event MotionEvent
+ * @return {@code true} if is a sloppy gesture, {@code false} if not
*/
protected boolean isSloppyGesture(MotionEvent event){
// As orientation can change, query the metrics in touch down
DisplayMetrics metrics = mContext.getResources().getDisplayMetrics();
mRightSlopEdge = metrics.widthPixels - mEdgeSlop;
mBottomSlopEdge = metrics.heightPixels - mEdgeSlop;
-
+
final float edgeSlop = mEdgeSlop;
final float rightSlop = mRightSlopEdge;
final float bottomSlop = mBottomSlopEdge;
-
+
final float x0 = event.getRawX();
final float y0 = event.getRawY();
final float x1 = getRawX(event, 1);
@@ -172,8 +172,8 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
return true;
} else if (p1sloppy) {
return true;
- }
+ }
return false;
- }
+ }
}
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/BaseGestureDetector.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/BaseGestureDetector.java
index 720a1f541b..622e8f759c 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/BaseGestureDetector.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/BaseGestureDetector.java
@@ -6,19 +6,19 @@ import android.view.MotionEvent;
/**
* @author Almer Thie (code.almeros.com) Copyright (c) 2013, Almer Thie
* (code.almeros.com)
- *
+ *
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -61,9 +61,9 @@ public abstract class BaseGestureDetector {
* detect gestures. This method delegates work to handler methods
* (handleStartProgressEvent, handleInProgressEvent) implemented in
* extending classes.
- *
- * @param event
- * @return
+ *
+ * @param event MotionEvent
+ * @return {@code true} as handled
*/
public boolean onTouchEvent(MotionEvent event) {
final int actionCode = event.getAction() & MotionEvent.ACTION_MASK;
@@ -79,9 +79,9 @@ public abstract class BaseGestureDetector {
* Called when the current event occurred when NO gesture is in progress
* yet. The handling in this implementation may set the gesture in progress
* (via mGestureInProgress) or out of progress
- *
- * @param actionCode
- * @param event
+ *
+ * @param actionCode Action Code from MotionEvent
+ * @param event MotionEvent
*/
protected abstract void handleStartProgressEvent(int actionCode,
MotionEvent event);
@@ -90,10 +90,10 @@ public abstract class BaseGestureDetector {
* Called when the current event occurred when a gesture IS in progress. The
* handling in this implementation may set the gesture out of progress (via
* mGestureInProgress).
- *
*
- * @param actionCode
- * @param event
+ *
+ * @param actionCode Action Code from MotionEvent
+ * @param event MotionEvent
*/
protected abstract void handleInProgressEvent(int actionCode,
MotionEvent event);
@@ -130,7 +130,7 @@ public abstract class BaseGestureDetector {
/**
* Returns {@code true} if a gesture is currently in progress.
- *
+ *
* @return {@code true} if a gesture is currently in progress, {@code false}
* otherwise.
*/
@@ -141,7 +141,7 @@ public abstract class BaseGestureDetector {
/**
* Return the time difference in milliseconds between the previous accepted
* GestureDetector event and the current GestureDetector event.
- *
+ *
* @return Time difference since the last move event in milliseconds.
*/
public long getTimeDelta() {
@@ -151,7 +151,7 @@ public abstract class BaseGestureDetector {
/**
* Return the event time of the current GestureDetector event being
* processed.
- *
+ *
* @return Current GestureDetector event time in milliseconds.
*/
public long getEventTime() {
diff --git a/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/TwoFingerGestureDetector.java b/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/TwoFingerGestureDetector.java
index e26d6b5ae4..91e5ef13c8 100644
--- a/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/TwoFingerGestureDetector.java
+++ b/android/java/MapboxGLAndroidSDK/src/main/java/com/almeros/android/multitouch/gesturedetectors/TwoFingerGestureDetector.java
@@ -9,19 +9,19 @@ import android.view.ViewConfiguration;
/**
* @author Almer Thie (code.almeros.com) Copyright (c) 2013, Almer Thie
* (code.almeros.com)
- *
+ *
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -97,7 +97,7 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
/**
* Return the current distance between the two pointers forming the gesture
* in progress.
- *
+ *
* @return Distance between pointers in pixels.
*/
public float getCurrentSpan() {
@@ -112,7 +112,7 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
/**
* Return the previous distance between the two pointers forming the gesture
* in progress.
- *
+ *
* @return Previous distance between pointers in pixels.
*/
public float getPreviousSpan() {
@@ -127,10 +127,10 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
/**
* MotionEvent has no getRawX(int) method; simulate it pending future API
* approval.
- *
- * @param event
- * @param pointerIndex
- * @return
+ *
+ * @param event Motion Event
+ * @param pointerIndex Pointer Index
+ * @return Raw x value or 0
*/
protected static float getRawX(MotionEvent event, int pointerIndex) {
float offset = event.getX() - event.getRawX();
@@ -143,10 +143,10 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
/**
* MotionEvent has no getRawY(int) method; simulate it pending future API
* approval.
- *
- * @param event
- * @param pointerIndex
- * @return
+ *
+ * @param event Motion Event
+ * @param pointerIndex Pointer Index
+ * @return Raw y value or 0
*/
protected static float getRawY(MotionEvent event, int pointerIndex) {
float offset = event.getY() - event.getRawY();
@@ -159,9 +159,9 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
/**
* Check if we have a sloppy gesture. Sloppy gestures can happen if the edge
* of the user's hand is touching the screen, for example.
- *
- * @param event
- * @return
+ *
+ * @param event Motion Event
+ * @return {@code true} if is sloppy gesture, {@code false} if not
*/
protected boolean isSloppyGesture(MotionEvent event) {
// As orientation can change, query the metrics in touch down
@@ -194,8 +194,8 @@ public abstract class TwoFingerGestureDetector extends BaseGestureDetector {
/**
* Determine (multi)finger focal point (a.k.a. center point between all
* fingers)
- *
- * @param e
+ *
+ * @param e Motion Event
* @return PointF focal point
*/
public static PointF determineFocalPoint(MotionEvent e) {