Loading api/current.xml +254 −0 Original line number Diff line number Diff line Loading @@ -110028,6 +110028,17 @@ visibility="public" > </field> <field name="FROYO" type="int" transient="false" volatile="false" value="8" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> </class> <class name="Bundle" extends="java.lang.Object" Loading Loading @@ -163140,6 +163151,22 @@ <parameter name="handler" type="android.os.Handler"> </parameter> </constructor> <constructor name="GestureDetector" type="android.view.GestureDetector" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="context" type="android.content.Context"> </parameter> <parameter name="listener" type="android.view.GestureDetector.OnGestureListener"> </parameter> <parameter name="handler" type="android.os.Handler"> </parameter> <parameter name="ignoreMultitouch" type="boolean"> </parameter> </constructor> <method name="isLongpressEnabled" return="boolean" abstract="false" Loading Loading @@ -168514,6 +168541,233 @@ > </field> </class> <class name="ScaleGestureDetector" extends="java.lang.Object" abstract="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <constructor name="ScaleGestureDetector" type="android.view.ScaleGestureDetector" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="context" type="android.content.Context"> </parameter> <parameter name="listener" type="android.view.ScaleGestureDetector.OnScaleGestureListener"> </parameter> </constructor> <method name="getCurrentSpan" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getEventTime" return="long" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getFocusX" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getFocusY" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getPreviousSpan" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getScaleFactor" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getTimeDelta" return="long" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="isInProgress" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="onTouchEvent" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="event" type="android.view.MotionEvent"> </parameter> </method> </class> <interface name="ScaleGestureDetector.OnScaleGestureListener" abstract="true" static="true" final="false" deprecated="not deprecated" visibility="public" > <method name="onScale" return="boolean" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> <method name="onScaleBegin" return="boolean" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> <method name="onScaleEnd" return="void" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> </interface> <class name="ScaleGestureDetector.SimpleOnScaleGestureListener" extends="java.lang.Object" abstract="false" static="true" final="false" deprecated="not deprecated" visibility="public" > <implements name="android.view.ScaleGestureDetector.OnScaleGestureListener"> </implements> <constructor name="ScaleGestureDetector.SimpleOnScaleGestureListener" type="android.view.ScaleGestureDetector.SimpleOnScaleGestureListener" static="false" final="false" deprecated="not deprecated" visibility="public" > </constructor> <method name="onScale" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> <method name="onScaleBegin" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> <method name="onScaleEnd" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> </class> <class name="SoundEffectConstants" extends="java.lang.Object" abstract="false" core/java/android/os/Build.java +2 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ public class Build { * January 2010: Android 2.1 */ public static final int ECLAIR_MR1 = 7; public static final int FROYO = 8; } /** The type of build, like "user" or "eng". */ Loading core/java/android/view/GestureDetector.java +67 −16 Original line number Diff line number Diff line Loading @@ -16,9 +16,10 @@ package android.view; import android.content.Context; import android.os.Build; import android.os.Handler; import android.os.Message; import android.content.Context; /** * Detects various gestures and events using the supplied {@link MotionEvent}s. Loading Loading @@ -232,6 +233,13 @@ public class GestureDetector { private boolean mIsLongpressEnabled; /** * True if we are at a target API level of >= Froyo or the developer can * explicitly set it. If true, input events with > 1 pointer will be ignored * so we can work side by side with multitouch gesture detectors. */ private boolean mIgnoreMultitouch; /** * Determines speed during touch scrolling */ Loading Loading @@ -336,6 +344,26 @@ public class GestureDetector { * @throws NullPointerException if {@code listener} is null. */ public GestureDetector(Context context, OnGestureListener listener, Handler handler) { this(context, listener, handler, context != null && context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.FROYO); } /** * Creates a GestureDetector with the supplied listener. * You may only use this constructor from a UI thread (this is the usual situation). * @see android.os.Handler#Handler() * * @param context the application's context * @param listener the listener invoked for all the callbacks, this must * not be null. * @param handler the handler to use * @param ignoreMultitouch whether events involving more than one pointer should * be ignored. * * @throws NullPointerException if {@code listener} is null. */ public GestureDetector(Context context, OnGestureListener listener, Handler handler, boolean ignoreMultitouch) { if (handler != null) { mHandler = new GestureHandler(handler); } else { Loading @@ -345,14 +373,15 @@ public class GestureDetector { if (listener instanceof OnDoubleTapListener) { setOnDoubleTapListener((OnDoubleTapListener) listener); } init(context); init(context, ignoreMultitouch); } private void init(Context context) { private void init(Context context, boolean ignoreMultitouch) { if (mListener == null) { throw new NullPointerException("OnGestureListener must not be null"); } mIsLongpressEnabled = true; mIgnoreMultitouch = ignoreMultitouch; // Fallback to support pre-donuts releases int touchSlop, doubleTapSlop; Loading Loading @@ -425,7 +454,26 @@ public class GestureDetector { boolean handled = false; switch (action) { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_POINTER_DOWN: if (mIgnoreMultitouch) { // Multitouch event - abort. cancel(); } break; case MotionEvent.ACTION_POINTER_UP: // Ending a multitouch gesture and going back to 1 finger if (mIgnoreMultitouch && ev.getPointerCount() == 2) { int id = (((action & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT) == 0) ? 1 : 0; mLastMotionX = ev.getX(id); mLastMotionY = ev.getY(id); mVelocityTracker.recycle(); mVelocityTracker = VelocityTracker.obtain(); } break; case MotionEvent.ACTION_DOWN: if (mDoubleTapListener != null) { boolean hadTapMessage = mHandler.hasMessages(TAP); Loading Loading @@ -462,7 +510,7 @@ public class GestureDetector { break; case MotionEvent.ACTION_MOVE: if (mInLongPress) { if (mInLongPress || (mIgnoreMultitouch && ev.getPointerCount() > 1)) { break; } final float scrollX = mLastMotionX - x; Loading Loading @@ -525,6 +573,12 @@ public class GestureDetector { mHandler.removeMessages(LONG_PRESS); break; case MotionEvent.ACTION_CANCEL: cancel(); } return handled; } private void cancel() { mHandler.removeMessages(SHOW_PRESS); mHandler.removeMessages(LONG_PRESS); mHandler.removeMessages(TAP); Loading @@ -534,11 +588,8 @@ public class GestureDetector { mStillDown = false; if (mInLongPress) { mInLongPress = false; break; } } return handled; } private boolean isConsideredDoubleTap(MotionEvent firstDown, MotionEvent firstUp, MotionEvent secondDown) { Loading core/java/android/view/ScaleGestureDetector.java +2 −5 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package android.view; import android.content.Context; import android.util.DisplayMetrics; import android.util.Log; /** * Detects transformation gestures involving more than one pointer ("multitouch") Loading @@ -34,7 +33,6 @@ import android.util.Log; * {@link #onTouchEvent(MotionEvent)}. The methods defined in your * callback will be executed when the events occur. * </ul> * @hide Pending API approval */ public class ScaleGestureDetector { /** Loading Loading @@ -82,8 +80,7 @@ public class ScaleGestureDetector { /** * Responds to the end of a scale gesture. Reported by existing * pointers going up. If the end of a gesture would result in a fling, * {@link onTransformFling()} is called instead. * pointers going up. * * Once a scale has ended, {@link ScaleGestureDetector#getFocusX()} * and {@link ScaleGestureDetector#getFocusY()} will return the location Loading @@ -103,7 +100,7 @@ public class ScaleGestureDetector { * {@link OnScaleGestureListener#onScaleBegin(ScaleGestureDetector)} return * {@code true}. */ public class SimpleOnScaleGestureListener implements OnScaleGestureListener { public static class SimpleOnScaleGestureListener implements OnScaleGestureListener { public boolean onScale(ScaleGestureDetector detector) { return true; Loading Loading
api/current.xml +254 −0 Original line number Diff line number Diff line Loading @@ -110028,6 +110028,17 @@ visibility="public" > </field> <field name="FROYO" type="int" transient="false" volatile="false" value="8" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> </class> <class name="Bundle" extends="java.lang.Object" Loading Loading @@ -163140,6 +163151,22 @@ <parameter name="handler" type="android.os.Handler"> </parameter> </constructor> <constructor name="GestureDetector" type="android.view.GestureDetector" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="context" type="android.content.Context"> </parameter> <parameter name="listener" type="android.view.GestureDetector.OnGestureListener"> </parameter> <parameter name="handler" type="android.os.Handler"> </parameter> <parameter name="ignoreMultitouch" type="boolean"> </parameter> </constructor> <method name="isLongpressEnabled" return="boolean" abstract="false" Loading Loading @@ -168514,6 +168541,233 @@ > </field> </class> <class name="ScaleGestureDetector" extends="java.lang.Object" abstract="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <constructor name="ScaleGestureDetector" type="android.view.ScaleGestureDetector" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="context" type="android.content.Context"> </parameter> <parameter name="listener" type="android.view.ScaleGestureDetector.OnScaleGestureListener"> </parameter> </constructor> <method name="getCurrentSpan" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getEventTime" return="long" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getFocusX" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getFocusY" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getPreviousSpan" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getScaleFactor" return="float" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="getTimeDelta" return="long" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="isInProgress" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > </method> <method name="onTouchEvent" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="event" type="android.view.MotionEvent"> </parameter> </method> </class> <interface name="ScaleGestureDetector.OnScaleGestureListener" abstract="true" static="true" final="false" deprecated="not deprecated" visibility="public" > <method name="onScale" return="boolean" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> <method name="onScaleBegin" return="boolean" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> <method name="onScaleEnd" return="void" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> </interface> <class name="ScaleGestureDetector.SimpleOnScaleGestureListener" extends="java.lang.Object" abstract="false" static="true" final="false" deprecated="not deprecated" visibility="public" > <implements name="android.view.ScaleGestureDetector.OnScaleGestureListener"> </implements> <constructor name="ScaleGestureDetector.SimpleOnScaleGestureListener" type="android.view.ScaleGestureDetector.SimpleOnScaleGestureListener" static="false" final="false" deprecated="not deprecated" visibility="public" > </constructor> <method name="onScale" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> <method name="onScaleBegin" return="boolean" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> <method name="onScaleEnd" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="detector" type="android.view.ScaleGestureDetector"> </parameter> </method> </class> <class name="SoundEffectConstants" extends="java.lang.Object" abstract="false"
core/java/android/os/Build.java +2 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,8 @@ public class Build { * January 2010: Android 2.1 */ public static final int ECLAIR_MR1 = 7; public static final int FROYO = 8; } /** The type of build, like "user" or "eng". */ Loading
core/java/android/view/GestureDetector.java +67 −16 Original line number Diff line number Diff line Loading @@ -16,9 +16,10 @@ package android.view; import android.content.Context; import android.os.Build; import android.os.Handler; import android.os.Message; import android.content.Context; /** * Detects various gestures and events using the supplied {@link MotionEvent}s. Loading Loading @@ -232,6 +233,13 @@ public class GestureDetector { private boolean mIsLongpressEnabled; /** * True if we are at a target API level of >= Froyo or the developer can * explicitly set it. If true, input events with > 1 pointer will be ignored * so we can work side by side with multitouch gesture detectors. */ private boolean mIgnoreMultitouch; /** * Determines speed during touch scrolling */ Loading Loading @@ -336,6 +344,26 @@ public class GestureDetector { * @throws NullPointerException if {@code listener} is null. */ public GestureDetector(Context context, OnGestureListener listener, Handler handler) { this(context, listener, handler, context != null && context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.FROYO); } /** * Creates a GestureDetector with the supplied listener. * You may only use this constructor from a UI thread (this is the usual situation). * @see android.os.Handler#Handler() * * @param context the application's context * @param listener the listener invoked for all the callbacks, this must * not be null. * @param handler the handler to use * @param ignoreMultitouch whether events involving more than one pointer should * be ignored. * * @throws NullPointerException if {@code listener} is null. */ public GestureDetector(Context context, OnGestureListener listener, Handler handler, boolean ignoreMultitouch) { if (handler != null) { mHandler = new GestureHandler(handler); } else { Loading @@ -345,14 +373,15 @@ public class GestureDetector { if (listener instanceof OnDoubleTapListener) { setOnDoubleTapListener((OnDoubleTapListener) listener); } init(context); init(context, ignoreMultitouch); } private void init(Context context) { private void init(Context context, boolean ignoreMultitouch) { if (mListener == null) { throw new NullPointerException("OnGestureListener must not be null"); } mIsLongpressEnabled = true; mIgnoreMultitouch = ignoreMultitouch; // Fallback to support pre-donuts releases int touchSlop, doubleTapSlop; Loading Loading @@ -425,7 +454,26 @@ public class GestureDetector { boolean handled = false; switch (action) { switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_POINTER_DOWN: if (mIgnoreMultitouch) { // Multitouch event - abort. cancel(); } break; case MotionEvent.ACTION_POINTER_UP: // Ending a multitouch gesture and going back to 1 finger if (mIgnoreMultitouch && ev.getPointerCount() == 2) { int id = (((action & MotionEvent.ACTION_POINTER_ID_MASK) >> MotionEvent.ACTION_POINTER_ID_SHIFT) == 0) ? 1 : 0; mLastMotionX = ev.getX(id); mLastMotionY = ev.getY(id); mVelocityTracker.recycle(); mVelocityTracker = VelocityTracker.obtain(); } break; case MotionEvent.ACTION_DOWN: if (mDoubleTapListener != null) { boolean hadTapMessage = mHandler.hasMessages(TAP); Loading Loading @@ -462,7 +510,7 @@ public class GestureDetector { break; case MotionEvent.ACTION_MOVE: if (mInLongPress) { if (mInLongPress || (mIgnoreMultitouch && ev.getPointerCount() > 1)) { break; } final float scrollX = mLastMotionX - x; Loading Loading @@ -525,6 +573,12 @@ public class GestureDetector { mHandler.removeMessages(LONG_PRESS); break; case MotionEvent.ACTION_CANCEL: cancel(); } return handled; } private void cancel() { mHandler.removeMessages(SHOW_PRESS); mHandler.removeMessages(LONG_PRESS); mHandler.removeMessages(TAP); Loading @@ -534,11 +588,8 @@ public class GestureDetector { mStillDown = false; if (mInLongPress) { mInLongPress = false; break; } } return handled; } private boolean isConsideredDoubleTap(MotionEvent firstDown, MotionEvent firstUp, MotionEvent secondDown) { Loading
core/java/android/view/ScaleGestureDetector.java +2 −5 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package android.view; import android.content.Context; import android.util.DisplayMetrics; import android.util.Log; /** * Detects transformation gestures involving more than one pointer ("multitouch") Loading @@ -34,7 +33,6 @@ import android.util.Log; * {@link #onTouchEvent(MotionEvent)}. The methods defined in your * callback will be executed when the events occur. * </ul> * @hide Pending API approval */ public class ScaleGestureDetector { /** Loading Loading @@ -82,8 +80,7 @@ public class ScaleGestureDetector { /** * Responds to the end of a scale gesture. Reported by existing * pointers going up. If the end of a gesture would result in a fling, * {@link onTransformFling()} is called instead. * pointers going up. * * Once a scale has ended, {@link ScaleGestureDetector#getFocusX()} * and {@link ScaleGestureDetector#getFocusY()} will return the location Loading @@ -103,7 +100,7 @@ public class ScaleGestureDetector { * {@link OnScaleGestureListener#onScaleBegin(ScaleGestureDetector)} return * {@code true}. */ public class SimpleOnScaleGestureListener implements OnScaleGestureListener { public static class SimpleOnScaleGestureListener implements OnScaleGestureListener { public boolean onScale(ScaleGestureDetector detector) { return true; Loading