public static interface

DragSortListView.FloatViewManager

com.mobeta.android.dslv.DragSortListView.FloatViewManager
Known Indirect Subclasses

Class Overview

Interface for customization of the floating View appearance and dragging behavior. Implement your own and pass it to setFloatViewManager(DragSortListView.FloatViewManager). If your own is not passed, the default SimpleFloatViewManager implementation is used.

Summary

Public Methods
abstract View onCreateFloatView(int position)
Return the floating View for item at position.
abstract void onDestroyFloatView(View floatView)
Called when the float View is dropped; lets you perform any necessary cleanup.
abstract void onDragFloatView(View floatView, Point location, Point touch)
Called whenever the floating View is dragged.

Public Methods

public abstract View onCreateFloatView (int position)

Return the floating View for item at position. DragSortListView will measure and layout this View for you, so feel free to just inflate it. You can help DSLV by setting some ViewGroup.LayoutParams on this View; otherwise it will set some for you (with a width of FILL_PARENT and a height of WRAP_CONTENT).

Parameters
position Position of item to drag (NOTE: position excludes header Views; thus, if you want to call getChildAt(int), you will need to add getHeaderViewsCount() to the index).
Returns
  • The View you wish to display as the floating View.

public abstract void onDestroyFloatView (View floatView)

Called when the float View is dropped; lets you perform any necessary cleanup. The internal DSLV floating View reference is set to null immediately after this is called.

Parameters
floatView The floating View passed to onCreateFloatView(int).

public abstract void onDragFloatView (View floatView, Point location, Point touch)

Called whenever the floating View is dragged. Float View properties can be changed here. Also, the upcoming location of the float View can be altered by setting location.x and location.y.

Parameters
floatView The floating View.
location 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 startDrag(int, View, int, int, int).
touch The current touch location (relative to DSLV top-left).