package com.loopeer.codereader.ui.adapter;
import android.graphics.Canvas;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
import com.loopeer.itemtouchhelperextension.ItemTouchHelperExtension;
public class ItemTouchHelperCallback extends ItemTouchHelperExtension.Callback {
@Override
public int getMovementFlags(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
return makeMovementFlags(0, ItemTouchHelper.START);
}
@Override
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) {
return false;
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
}
@Override
public void onChildDraw(Canvas c, RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) {
if (viewHolder instanceof MainLatestAdapter.RepoViewHolder)
((MainLatestAdapter.RepoViewHolder) viewHolder).mProgressRelativeLayout.setTranslationX(dX);
}
}