public class SimpleFloatViewManager extends java.lang.Object implements DragSortListView.FloatViewManager
Constructor and Description |
---|
SimpleFloatViewManager(android.widget.ListView lv) |
Modifier and Type | Method and Description |
---|---|
android.view.View |
onCreateFloatView(int position)
This simple implementation creates a Bitmap copy of the
list item currently shown at ListView
position . |
void |
onDestroyFloatView(android.view.View floatView)
Removes the Bitmap from the ImageView created in
onCreateFloatView() and tells the system to recycle it.
|
void |
onDragFloatView(android.view.View floatView,
android.graphics.Point position,
android.graphics.Point touch)
Called whenever the floating View is dragged.
|
void |
setBackgroundColor(int color) |
public void setBackgroundColor(int color)
public android.view.View onCreateFloatView(int position)
position
.onCreateFloatView
in interface DragSortListView.FloatViewManager
position
- Position of item to drag (NOTE:
position
excludes header Views; thus, if you
want to call ViewGroup.getChildAt(int)
, you will need
to add ListView.getHeaderViewsCount()
to the index).public void onDragFloatView(android.view.View floatView, android.graphics.Point position, android.graphics.Point touch)
DragSortListView.FloatViewManager
location.x
and location.y
.onDragFloatView
in interface DragSortListView.FloatViewManager
floatView
- The floating View.position
- The location (top-left; relative to DSLV
top-left) at which the float
View would like to appear, given the current touch location
and the offset provided in DragSortListView.startDrag(int, int, int, int)
.touch
- The current touch location (relative to DSLV
top-left).public void onDestroyFloatView(android.view.View floatView)
onDestroyFloatView
in interface DragSortListView.FloatViewManager
floatView
- The floating View passed to
DragSortListView.FloatViewManager.onCreateFloatView(int)
.