use of com.simplecity.amp_library.model.AlbumArtist in project Shuttle by timusus.
the class SuggestedFragment method onOverflowClick.
@Override
public void onOverflowClick(View v, int position, Object item) {
if (item instanceof AlbumArtist) {
PopupMenu menu = new PopupMenu(SuggestedFragment.this.getActivity(), v);
MenuUtils.addAlbumArtistMenuOptions(getActivity(), menu);
MenuUtils.addClickHandler((AppCompatActivity) getActivity(), menu, (AlbumArtist) item);
menu.show();
} else if (item instanceof Album) {
PopupMenu menu = new PopupMenu(SuggestedFragment.this.getActivity(), v);
MenuUtils.addAlbumMenuOptions(getActivity(), menu);
MenuUtils.addClickHandler((AppCompatActivity) getActivity(), menu, (Album) item);
menu.show();
} else if (item instanceof Song) {
PopupMenu menu = new PopupMenu(SuggestedFragment.this.getActivity(), v);
MenuUtils.addSongMenuOptions(getActivity(), menu);
MenuUtils.addClickHandler((AppCompatActivity) getActivity(), menu, (Song) item, menuItem -> {
switch(menuItem.getItemId()) {
case BLACKLIST:
{
BlacklistHelper.addToBlacklist(((Song) item));
suggestedAdapter.removeItem(position);
return true;
}
}
return false;
});
menu.show();
}
}
Aggregations