Reverted changes to DSLV to keep consistency with upstream DSLV source

This commit is contained in:
Xiao Bao Clark 2015-08-22 07:48:43 +10:00
parent be43b4501d
commit b9ad4c8a80
5 changed files with 29 additions and 28 deletions

View File

@ -15,8 +15,8 @@ import android.widget.AdapterView;
* creation.
*
* An instance of this class is meant to be passed to the methods
* {@link DragSortListView#setOnTouchListener(View.OnTouchListener)} and
* {@link DragSortListView#setFloatViewManager(DragSortListView.FloatViewManager)} of your
* {@link DragSortListView#setTouchListener()} and
* {@link DragSortListView#setFloatViewManager()} of your
* {@link DragSortListView} instance.
*/
public class DragSortController extends SimpleFloatViewManager implements View.OnTouchListener, GestureDetector.OnGestureListener {
@ -82,7 +82,7 @@ public class DragSortController extends SimpleFloatViewManager implements View.O
private int mPositionX;
/**
* Calls {@link #DragSortController(DragSortListView, int, int, int)} with a
* Calls {@link #DragSortController(DragSortListView, int)} with a
* 0 drag handle id, FLING_RIGHT_REMOVE remove mode,
* and ON_DOWN drag init. By default, sorting is enabled, and
* removal is disabled.
@ -130,7 +130,7 @@ public class DragSortController extends SimpleFloatViewManager implements View.O
/**
* Set how a drag is initiated. Needs to be one of
* {@link #ON_DOWN}, {@link #ON_DRAG}, or {@link #ON_LONG_PRESS}.
* {@link ON_DOWN}, {@link ON_DRAG}, or {@link ON_LONG_PRESS}.
*
* @param mode The drag init mode.
*/
@ -154,7 +154,9 @@ public class DragSortController extends SimpleFloatViewManager implements View.O
}
/**
* One of {@link #CLICK_REMOVE}, {@link #FLING_REMOVE}
* One of {@link CLICK_REMOVE}, {@link FLING_RIGHT_REMOVE},
* {@link FLING_LEFT_REMOVE},
* {@link SLIDE_RIGHT_REMOVE}, or {@link SLIDE_LEFT_REMOVE}.
*/
public void setRemoveMode(int mode) {
mRemoveMode = mode;

View File

@ -8,7 +8,6 @@ import android.util.SparseIntArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CursorAdapter;
import android.widget.ListAdapter;
/**
@ -108,7 +107,7 @@ public abstract class DragSortCursorAdapter extends CursorAdapter implements Dra
/**
* On drop, this updates the mapping between Cursor positions
* and ListView positions. The Cursor is unchanged. Retrieve
* the current mapping with {@link #getCursorPositions()}.
* the current mapping with {@link getCursorPositions()}.
*
* @see DragSortListView.DropListener#drop(int, int)
*/
@ -136,7 +135,7 @@ public abstract class DragSortCursorAdapter extends CursorAdapter implements Dra
/**
* On remove, this updates the mapping between Cursor positions
* and ListView positions. The Cursor is unchanged. Retrieve
* the current mapping with {@link #getCursorPositions()}.
* the current mapping with {@link getCursorPositions()}.
*
* @see DragSortListView.RemoveListener#remove(int)
*/

View File

@ -630,7 +630,7 @@ public class DragSortListView extends ListView {
* a heavily wrapped ListAdapter (DragSortListView wraps the
* input ListAdapter {\emph and} ListView wraps the wrapped one).
*
* @return The ListAdapter set as the argument of {@link #setAdapter(ListAdapter)}
* @return The ListAdapter set as the argument of {@link setAdapter()}
*/
public ListAdapter getInputAdapter() {
if (mAdapterWrapper == null) {
@ -903,6 +903,8 @@ public class DragSortListView extends ListView {
*
* @param position
* @param top
* @param height Height of item at position. If -1, this function
* calculates this height.
*
* @return Shuffle line between position-1 and position (for
* the given view of the list; that is, for when top of item at
@ -1466,7 +1468,7 @@ public class DragSortListView extends ListView {
}
/**
* Cancel a drag. Calls {@link DragScroller#stopScrolling(boolean)} with
* Cancel a drag. Calls {@link #stopDrag(boolean, boolean)} with
* <code>true</code> as the first argument.
*/
public void cancelDrag() {
@ -2453,6 +2455,7 @@ public class DragSortListView extends ListView {
* and the offset provided in {@link DragSortListView#startDrag}.
* @param touch The current touch location (relative to DSLV
* top-left).
* @param pendingScroll
*/
public void onDragFloatView(View floatView, Point location, Point touch);
@ -2479,7 +2482,7 @@ public class DragSortListView extends ListView {
* Allows for easy toggling between a DragSortListView
* and a regular old ListView. If enabled, items are
* draggable, where the drag init mode determines how
* items are lifted (see {@link DragSortController#setDragInitMode(int)}).
* items are lifted (see {@link setDragInitMode(int)}).
* If disabled, items cannot be dragged.
*
* @param enabled Set <code>true</code> to enable list

View File

@ -21,7 +21,6 @@ import android.database.Cursor;
import android.view.View;
import android.view.ViewGroup;
import android.view.LayoutInflater;
import android.widget.CursorAdapter;
// taken from v4 rev. 10 ResourceCursorAdapter.java
@ -62,7 +61,7 @@ public abstract class ResourceDragSortCursorAdapter extends DragSortCursorAdapte
/**
* Constructor with default behavior as per
* {@link CursorAdapter#CursorAdapter(Context, Cursor, boolean)}; it is recommended
* you not use this, but instead {@link #ResourceDragSortCursorAdapter(Context, int, Cursor, int)}.
* you not use this, but instead {@link #ResourceCursorAdapter(Context, int, Cursor, int)}.
* When using this constructor, {@link #FLAG_REGISTER_CONTENT_OBSERVER}
* will always be set.
*
@ -101,7 +100,7 @@ public abstract class ResourceDragSortCursorAdapter extends DragSortCursorAdapte
/**
* Inflates view(s) from the specified XML file.
*
* @see CursorAdapter#newView(android.content.Context,
* @see android.widget.CursorAdapter#newView(android.content.Context,
* android.database.Cursor, ViewGroup)
*/
@Override

View File

@ -22,8 +22,6 @@ import android.net.Uri;
import android.view.View;
import android.widget.TextView;
import android.widget.ImageView;
import android.widget.CursorAdapter;
import android.widget.SimpleCursorAdapter;
// taken from sdk/sources/android-16/android/widget/SimpleCursorAdapter.java
@ -130,10 +128,10 @@ public class SimpleDragSortCursorAdapter extends ResourceDragSortCursorAdapter {
*
* @throws IllegalStateException if binding cannot occur
*
* @see CursorAdapter#bindView(android.view.View,
* @see android.widget.CursorAdapter#bindView(android.view.View,
* android.content.Context, android.database.Cursor)
* @see #getViewBinder()
* @see #setViewBinder(ViewBinder)
* @see #setViewBinder(android.widget.SimpleCursorAdapter.ViewBinder)
* @see #setViewImage(ImageView, String)
* @see #setViewText(TextView, String)
*/
@ -177,7 +175,7 @@ public class SimpleDragSortCursorAdapter extends ResourceDragSortCursorAdapter {
* @return a ViewBinder or null if the binder does not exist
*
* @see #bindView(android.view.View, android.content.Context, android.database.Cursor)
* @see #setViewBinder(ViewBinder)
* @see #setViewBinder(android.widget.SimpleCursorAdapter.ViewBinder)
*/
public ViewBinder getViewBinder() {
return mViewBinder;
@ -240,9 +238,9 @@ public class SimpleDragSortCursorAdapter extends ResourceDragSortCursorAdapter {
*
* @return a valid index in the current Cursor or -1
*
* @see CursorAdapter#convertToString(android.database.Cursor)
* @see android.widget.CursorAdapter#convertToString(android.database.Cursor)
* @see #setStringConversionColumn(int)
* @see #setCursorToStringConverter(CursorToStringConverter)
* @see #setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter)
* @see #getCursorToStringConverter()
*/
public int getStringConversionColumn() {
@ -258,9 +256,9 @@ public class SimpleDragSortCursorAdapter extends ResourceDragSortCursorAdapter {
* @param stringConversionColumn a valid index in the current Cursor or -1 to use the default
* conversion mechanism
*
* @see CursorAdapter#convertToString(android.database.Cursor)
* @see android.widget.CursorAdapter#convertToString(android.database.Cursor)
* @see #getStringConversionColumn()
* @see #setCursorToStringConverter(CursorToStringConverter)
* @see #setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter)
* @see #getCursorToStringConverter()
*/
public void setStringConversionColumn(int stringConversionColumn) {
@ -274,10 +272,10 @@ public class SimpleDragSortCursorAdapter extends ResourceDragSortCursorAdapter {
* @return null if the converter does not exist or an instance of
* {@link android.widget.SimpleCursorAdapter.CursorToStringConverter}
*
* @see #setCursorToStringConverter(CursorToStringConverter)
* @see #setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter)
* @see #getStringConversionColumn()
* @see #setStringConversionColumn(int)
* @see CursorAdapter#convertToString(android.database.Cursor)
* @see android.widget.CursorAdapter#convertToString(android.database.Cursor)
*/
public CursorToStringConverter getCursorToStringConverter() {
return mCursorToStringConverter;
@ -290,10 +288,10 @@ public class SimpleDragSortCursorAdapter extends ResourceDragSortCursorAdapter {
* @param cursorToStringConverter the Cursor to String converter, or
* null to remove the converter
*
* @see #setCursorToStringConverter(CursorToStringConverter)
* @see #setCursorToStringConverter(android.widget.SimpleCursorAdapter.CursorToStringConverter)
* @see #getStringConversionColumn()
* @see #setStringConversionColumn(int)
* @see CursorAdapter#convertToString(android.database.Cursor)
* @see android.widget.CursorAdapter#convertToString(android.database.Cursor)
*/
public void setCursorToStringConverter(CursorToStringConverter cursorToStringConverter) {
mCursorToStringConverter = cursorToStringConverter;
@ -407,7 +405,7 @@ public class SimpleDragSortCursorAdapter extends ResourceDragSortCursorAdapter {
* This class can be used by external clients of SimpleCursorAdapter
* to define how the Cursor should be converted to a String.
*
* @see CursorAdapter#convertToString(android.database.Cursor)
* @see android.widget.CursorAdapter#convertToString(android.database.Cursor)
*/
public static interface CursorToStringConverter {
/**