Java Code Examples for androidx.recyclerview.widget.ItemTouchHelper#START

The following examples show how to use androidx.recyclerview.widget.ItemTouchHelper#START . 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: RemovableItemTouchHelperCallback.java    From Android-nRF-Mesh-Library with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
    if (viewHolder instanceof RemovableViewHolder) {
        final RemovableViewHolder vHolder = ((RemovableViewHolder) viewHolder);
        if (!(vHolder).isRemovable())
            return 0;
        int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
        return makeMovementFlags(0, swipeFlags);
    } else
        return 0;
}
 
Example 2
Source File: DynamicTouchListener.java    From dynamic-support with Apache License 2.0 5 votes vote down vote up
@Override
public int getMovementFlags(@NonNull RecyclerView recyclerView,
        @NonNull RecyclerView.ViewHolder viewHolder) {
    int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;

    return makeMovementFlags(dragFlags, swipeFlags);
}
 
Example 3
Source File: TouchHelperCallback.java    From SimplicityBrowser with MIT License 5 votes vote down vote up
@Override
public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
    int position = viewHolder.getAdapterPosition();
    final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    int swipeFlags = position == 0 ? 0 : ItemTouchHelper.START | ItemTouchHelper.END;
    return makeMovementFlags(dragFlags, swipeFlags);
}
 
Example 4
Source File: SimpleItemTouchHelperCallback.java    From UltimateRecyclerView with Apache License 2.0 5 votes vote down vote up
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
    // Enable drag and swipe in both directions
    final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    final int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
    return makeMovementFlags(dragFlags, swipeFlags);
}
 
Example 5
Source File: ItemTouchHelperCallback.java    From Android-Keyboard with Apache License 2.0 4 votes vote down vote up
@Override
public int getMovementFlags(@NotNull RecyclerView recyclerView, @NotNull RecyclerView.ViewHolder viewHolder) {
    int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
    return makeMovementFlags(dragFlags, swipeFlags);
}
 
Example 6
Source File: SimpleItemTouchHelperCallback.java    From call_manage with MIT License 4 votes vote down vote up
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
    int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
    return makeMovementFlags(dragFlags, swipeFlags);
}
 
Example 7
Source File: EventTouchHelperCallback.java    From Deadline with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
    int swipeFlags = ItemTouchHelper.START;
    return makeMovementFlags(0, swipeFlags);
}
 
Example 8
Source File: ContactFragment.java    From CrazyDaily with Apache License 2.0 4 votes vote down vote up
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
    final int swipeFlags = viewHolder.getItemViewType() == 0 ? ItemTouchHelper.START : 0;
    return makeMovementFlags(0, swipeFlags);
}
 
Example 9
Source File: ContactActivity.java    From CrazyDaily with Apache License 2.0 4 votes vote down vote up
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
    final int swipeFlags = viewHolder.getItemViewType() == 0 ? ItemTouchHelper.START : 0;
    return makeMovementFlags(0, swipeFlags);
}
 
Example 10
Source File: SimpleItemTouchHelperCallback.java    From financisto with GNU General Public License v2.0 4 votes vote down vote up
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
    final int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    final int swipeFlags = ItemTouchHelper.END | ItemTouchHelper.START;
    return makeMovementFlags(dragFlags, swipeFlags);
}
 
Example 11
Source File: SavedColorListAdapter.java    From revolution-irc with GNU General Public License v3.0 4 votes vote down vote up
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
    int dragFlags = ItemTouchHelper.START | ItemTouchHelper.END;
    int swipeFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    return makeMovementFlags(dragFlags, swipeFlags);
}
 
Example 12
Source File: ItemTouchHelperCallback.java    From PhoneProfilesPlus with Apache License 2.0 4 votes vote down vote up
@Override
public int getMovementFlags(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) {
    int dragFlags = ItemTouchHelper.UP | ItemTouchHelper.DOWN;
    int swipeFlags = ItemTouchHelper.START | ItemTouchHelper.END;
    return makeMovementFlags(dragFlags, swipeFlags);
}