use of com.marshalchen.ultimaterecyclerview.itemTouchHelper.ItemTouchHelperViewHolder in project MyDiary by erttyy8821.
the class MemoItemTouchHelperCallback method onSelectedChanged.
@Override
public void onSelectedChanged(RecyclerView.ViewHolder viewHolder, int actionState) {
// We only want the active item to change
if (actionState != ItemTouchHelper.ACTION_STATE_IDLE) {
if (viewHolder instanceof ItemTouchHelperViewHolder) {
// Let the view holder know that this item is being moved or dragged
ItemTouchHelperViewHolder itemViewHolder = (ItemTouchHelperViewHolder) viewHolder;
itemViewHolder.onItemSelected();
}
}
super.onSelectedChanged(viewHolder, actionState);
}
use of com.marshalchen.ultimaterecyclerview.itemTouchHelper.ItemTouchHelperViewHolder in project MyDiary by erttyy8821.
the class MemoItemTouchHelperCallback method clearView.
@Override
public void clearView(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
super.clearView(recyclerView, viewHolder);
viewHolder.itemView.setAlpha(ALPHA_FULL);
//Save db & modify adapter sort first
mAdapter.onItemMoveFinish();
if (viewHolder instanceof ItemTouchHelperViewHolder) {
// Tell the view holder it's time to restore the idle state
ItemTouchHelperViewHolder itemViewHolder = (ItemTouchHelperViewHolder) viewHolder;
itemViewHolder.onItemClear();
}
}
Aggregations