use of io.github.hidroh.materialistic.MenuTintDelegate in project materialistic by hidroh.
the class FavoriteRecyclerViewAdapter method onAttachedToRecyclerView.
@Override
public void onAttachedToRecyclerView(final RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
mMenuTintDelegate = new MenuTintDelegate();
mMenuTintDelegate.onActivityCreated(mContext);
mItemTouchHelper = new ItemTouchHelper(new ItemTouchHelperCallback(mContext) {
@Override
public int getSwipeDirs(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder) {
if (mActionModeDelegate != null && mActionModeDelegate.isInActionMode()) {
return 0;
}
return super.getSwipeDirs(recyclerView, viewHolder);
}
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int direction) {
dismiss(viewHolder.getAdapterPosition());
}
});
mItemTouchHelper.attachToRecyclerView(recyclerView);
}
Aggregations