use of io.github.hidroh.materialistic.data.Favorite in project materialistic by hidroh.
the class FavoriteRecyclerViewAdapter method dismiss.
@Synthetic
void dismiss(final int position) {
final Favorite item = getItem(position);
mSelected.put(position, item.getId());
mFavoriteManager.remove(mContext, mSelected.values());
Snackbar.make(mRecyclerView, R.string.toast_removed, Snackbar.LENGTH_LONG).setAction(R.string.undo, v -> {
mPendingAdd = position;
mFavoriteManager.add(mContext, item);
}).show();
}
use of io.github.hidroh.materialistic.data.Favorite in project materialistic by hidroh.
the class FavoriteRecyclerViewAdapter method bindItem.
@Override
protected void bindItem(final ItemViewHolder holder) {
final Favorite favorite = getItem(holder.getAdapterPosition());
holder.itemView.setOnLongClickListener(v -> {
if (mActionModeDelegate.startActionMode(mActionModeCallback)) {
toggle(favorite.getId(), holder.getAdapterPosition());
return true;
}
return false;
});
holder.mStoryView.getMoreOptions().setOnClickListener(v -> showMoreOptions(v, favorite));
}
Aggregations