|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object FrameLayout com.doffman.dragarea.DragArea
public class DragArea
The DragArea is a standard FrameLayout that also provides Drag and Drop
functionality.
This class deals with drawing the drag shadow on top of its child views
and handling data transfer and events for the drag operation.
The drag shadow is a visualisation of the drag operation, an image placed
beneath the users finger while dragging.
Children of the DragArea may start a drag operation by calling the
startDrag
method.
Once a drag operation has begun OnDragListener
objects that have registered themselves with the
addDragListener(View, com.doffman.dragarea.OnDragListener)
method will be called with drag events that
are relevent to them.
Constructor Summary | |
---|---|
DragArea(Context context)
|
|
DragArea(Context context,
AttributeSet attrs)
|
|
DragArea(Context context,
AttributeSet attrs,
int defStyle)
|
Method Summary | |
---|---|
void |
addDragListener(View view,
OnDragListener listener)
Adds a drag listener to the drag area. |
void |
dispatchDraw(Canvas canvas)
|
boolean |
onInterceptTouchEvent(MotionEvent event)
|
boolean |
onTouchEvent(MotionEvent event)
|
void |
removeDragListener(OnDragListener listener)
Removes a drag listener. |
void |
startDrag(Bundle dragBundle,
DragShadowBuilder shadowBuilder)
Called to start a drag operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DragArea(Context context)
public DragArea(Context context, AttributeSet attrs)
public DragArea(Context context, AttributeSet attrs, int defStyle)
Method Detail |
---|
public void startDrag(Bundle dragBundle, DragShadowBuilder shadowBuilder)
dragBundle
- Used to pass information between the object starting the drag
and the object on which the drop operation occurs.shadowBuilder
- Used to create a visualization of the drag operation called
a drag shadow.public void addDragListener(View view, OnDragListener listener)
listener
- A drag listener to be added to this drag area.view
- The view associated with this drag listener.public void removeDragListener(OnDragListener listener)
listener
- The drag listener object to be removed.public boolean onInterceptTouchEvent(MotionEvent event)
public boolean onTouchEvent(MotionEvent event)
public void dispatchDraw(Canvas canvas)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |