com.h6ah4i.android.widget.advrecyclerview.draggable.ItemDraggableRange Java Examples

The following examples show how to use com.h6ah4i.android.widget.advrecyclerview.draggable.ItemDraggableRange. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractPersonSelectionListAdapter.java    From arcusandroid with Apache License 2.0 6 votes vote down vote up
/**
 * Some items in the list may not be reorderable; this list allows items that are reorderable to
 * to be dragged dragged withing the range of adjacent items which are also reorderable.
 *
 * That is, non-reorderable items create a barrier that prevent other items from crossing. This
 * lets such non-reorderable items remain pinned/fixed into their original location in the
 * list.
 *
 * @param holder
 * @param position
 * @return
 */
@Nullable
@Override
public ItemDraggableRange onGetItemDraggableRange(PersonListItemViewHolder holder, int position) {
    int firstDraggablePosition = 0;
    int lastDraggablePosition = items.size();

    for (int index = position; index >= 0; index--) {
        if (items.get(index).isReorderable()) {
            firstDraggablePosition = index;
        } else {
            break;
        }
    }

    for (int index = position; index < items.size(); index++) {
        if (items.get(index).isReorderable()) {
            lastDraggablePosition = index;
        } else {
            break;
        }
    }

    // Any item can be dragged to any position; no range restrictions.
    return new ItemDraggableRange(firstDraggablePosition, lastDraggablePosition);
}
 
Example #2
Source File: PlayingQueueAdapter.java    From RetroMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return null;
}
 
Example #3
Source File: DownloadLabelsScene.java    From EhViewer with Apache License 2.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(LabelHolder holder, int position) {
    return null;
}
 
Example #4
Source File: QuickSearchScene.java    From EhViewer with Apache License 2.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(QuickSearchHolder holder, int position) {
    return null;
}
 
Example #5
Source File: MyTaskAdapter.java    From Conquer with Apache License 2.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(TaskViewHolder holder, int position) {
    // no drag-sortable range specified
    return null;
}
 
Example #6
Source File: OrderablePlaylistSongAdapter.java    From Phonograph with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return new ItemDraggableRange(1, dataSet.size());
}
 
Example #7
Source File: PlayingQueueAdapter.java    From Phonograph with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return null;
}
 
Example #8
Source File: SortForumsActivity.java    From Nimingban with Apache License 2.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ForumHolder holder, int position) {
    return new ItemDraggableRange(1, mLazyList.size());
}
 
Example #9
Source File: OrderablePlaylistSongAdapter.java    From VinylMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return new ItemDraggableRange(1, dataSet.size());
}
 
Example #10
Source File: PlayingQueueAdapter.java    From VinylMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return null;
}
 
Example #11
Source File: OrderablePlaylistSongAdapter.java    From RetroMusicPlayer with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return new ItemDraggableRange(1, dataSet.size());
}
 
Example #12
Source File: PlaylistSongAdapter.java    From Orin with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return null;
}
 
Example #13
Source File: PlayingQueueAdapter.java    From Orin with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return null;
}
 
Example #14
Source File: DragItemAdapter.java    From PLDroidShortVideo with Apache License 2.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(FrameItemViewHolder holder, int position) {
    return null;
}
 
Example #15
Source File: OrderablePlaylistSongAdapter.java    From Music-Player with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return new ItemDraggableRange(1, dataSet.size());
}
 
Example #16
Source File: PlayingQueueAdapter.java    From Music-Player with GNU General Public License v3.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(ViewHolder holder, int position) {
    return null;
}
 
Example #17
Source File: DownloadLabelsScene.java    From MHViewer with Apache License 2.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(LabelHolder holder, int position) {
    return null;
}
 
Example #18
Source File: QuickSearchScene.java    From MHViewer with Apache License 2.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(QuickSearchHolder holder, int position) {
    return null;
}
 
Example #19
Source File: LightsNSwitchesDeviceControlAdapter.java    From arcusandroid with Apache License 2.0 4 votes vote down vote up
@Override
public ItemDraggableRange onGetItemDraggableRange(LightsNSwitchesDeviceControlViewHolder holder, int position) {
    // Any item can be dragged to any position; no range restrictions.
    return null;
}
 
Example #20
Source File: IrrigationZoneCardListAdapter.java    From arcusandroid with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
public ItemDraggableRange onGetItemDraggableRange(IrrigationZoneListItemViewHolder holder, int position) {
    // Any item can be dragged to any position; no range restrictions.
    return null;
}