Loading api/current.xml +37 −1 Original line number Diff line number Diff line Loading @@ -203876,6 +203876,19 @@ <parameter name="l" type="android.view.View.OnCreateContextMenuListener"> </parameter> </method> <method name="setOnDragListener" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="l" type="android.view.View.OnDragListener"> </parameter> </method> <method name="setOnFocusChangeListener" return="void" abstract="false" Loading Loading @@ -205285,6 +205298,29 @@ </parameter> </method> </interface> <interface name="View.OnDragListener" abstract="true" static="true" final="false" deprecated="not deprecated" visibility="public" > <method name="onDrag" return="boolean" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="v" type="android.view.View"> </parameter> <parameter name="event" type="android.view.DragEvent"> </parameter> </method> </interface> <interface name="View.OnFocusChangeListener" abstract="true" static="true" Loading Loading @@ -244067,7 +244103,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="arg0" type="T"> <parameter name="t" type="T"> </parameter> </method> </interface> core/java/android/view/View.java +35 −2 Original line number Diff line number Diff line Loading @@ -1943,6 +1943,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility private OnTouchListener mOnTouchListener; private OnDragListener mOnDragListener; /** * The application environment this view lives in. * This field should be made private, so it is hidden from the SDK. Loading Loading @@ -2738,6 +2740,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mOnTouchListener = l; } /** * Register a callback to be invoked when a drag event is sent to this view. * @param l The drag listener to attach to this view */ public void setOnDragListener(OnDragListener l) { mOnDragListener = l; } /** * Give this view focus. This will cause {@link #onFocusChanged} to be called. * Loading Loading @@ -9994,10 +10004,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * Views typically don't need to override dispatchDragEvent(); it just calls * onDragEvent(what, event) and passes the result up appropriately. * * onDragEvent(event) and passes the result up appropriately. */ public boolean dispatchDragEvent(DragEvent event) { if (mOnDragListener != null && (mViewFlags & ENABLED_MASK) == ENABLED && mOnDragListener.onDrag(this, event)) { return true; } return onDragEvent(event); } Loading Loading @@ -10287,6 +10300,26 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility boolean onLongClick(View v); } /** * Interface definition for a callback to be invoked when a drag is being dispatched * to this view. The callback will be invoked before the hosting view's own * onDrag(event) method. If the listener wants to fall back to the hosting view's * onDrag(event) behavior, it should return 'false' from this callback. */ public interface OnDragListener { /** * Called when a drag event is dispatched to a view. This allows listeners * to get a chance to override base View behavior. * * @param v The view the drag has been dispatched to. * @param event The DragEvent object containing full information * about the event. * @return true if the listener consumed the DragEvent, false in order to fall * back to the view's default handling. */ boolean onDrag(View v, DragEvent event); } /** * Interface definition for a callback to be invoked when the focus state of * a view changed. Loading core/java/android/view/ViewGroup.java +2 −1 Original line number Diff line number Diff line Loading @@ -954,7 +954,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // If none of our children could handle the event, try here if (!retval) { retval = onDragEvent(event); // Call up to the View implementation that dispatches to installed listeners retval = super.dispatchDragEvent(event); } return retval; } Loading Loading
api/current.xml +37 −1 Original line number Diff line number Diff line Loading @@ -203876,6 +203876,19 @@ <parameter name="l" type="android.view.View.OnCreateContextMenuListener"> </parameter> </method> <method name="setOnDragListener" return="void" abstract="false" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="l" type="android.view.View.OnDragListener"> </parameter> </method> <method name="setOnFocusChangeListener" return="void" abstract="false" Loading Loading @@ -205285,6 +205298,29 @@ </parameter> </method> </interface> <interface name="View.OnDragListener" abstract="true" static="true" final="false" deprecated="not deprecated" visibility="public" > <method name="onDrag" return="boolean" abstract="true" native="false" synchronized="false" static="false" final="false" deprecated="not deprecated" visibility="public" > <parameter name="v" type="android.view.View"> </parameter> <parameter name="event" type="android.view.DragEvent"> </parameter> </method> </interface> <interface name="View.OnFocusChangeListener" abstract="true" static="true" Loading Loading @@ -244067,7 +244103,7 @@ deprecated="not deprecated" visibility="public" > <parameter name="arg0" type="T"> <parameter name="t" type="T"> </parameter> </method> </interface>
core/java/android/view/View.java +35 −2 Original line number Diff line number Diff line Loading @@ -1943,6 +1943,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility private OnTouchListener mOnTouchListener; private OnDragListener mOnDragListener; /** * The application environment this view lives in. * This field should be made private, so it is hidden from the SDK. Loading Loading @@ -2738,6 +2740,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mOnTouchListener = l; } /** * Register a callback to be invoked when a drag event is sent to this view. * @param l The drag listener to attach to this view */ public void setOnDragListener(OnDragListener l) { mOnDragListener = l; } /** * Give this view focus. This will cause {@link #onFocusChanged} to be called. * Loading Loading @@ -9994,10 +10004,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * Views typically don't need to override dispatchDragEvent(); it just calls * onDragEvent(what, event) and passes the result up appropriately. * * onDragEvent(event) and passes the result up appropriately. */ public boolean dispatchDragEvent(DragEvent event) { if (mOnDragListener != null && (mViewFlags & ENABLED_MASK) == ENABLED && mOnDragListener.onDrag(this, event)) { return true; } return onDragEvent(event); } Loading Loading @@ -10287,6 +10300,26 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility boolean onLongClick(View v); } /** * Interface definition for a callback to be invoked when a drag is being dispatched * to this view. The callback will be invoked before the hosting view's own * onDrag(event) method. If the listener wants to fall back to the hosting view's * onDrag(event) behavior, it should return 'false' from this callback. */ public interface OnDragListener { /** * Called when a drag event is dispatched to a view. This allows listeners * to get a chance to override base View behavior. * * @param v The view the drag has been dispatched to. * @param event The DragEvent object containing full information * about the event. * @return true if the listener consumed the DragEvent, false in order to fall * back to the view's default handling. */ boolean onDrag(View v, DragEvent event); } /** * Interface definition for a callback to be invoked when the focus state of * a view changed. Loading
core/java/android/view/ViewGroup.java +2 −1 Original line number Diff line number Diff line Loading @@ -954,7 +954,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager // If none of our children could handle the event, try here if (!retval) { retval = onDragEvent(event); // Call up to the View implementation that dispatches to installed listeners retval = super.dispatchDragEvent(event); } return retval; } Loading