Skip to content

Commit

Permalink
[android] Reimplements Track Deletion
Browse files Browse the repository at this point in the history
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
  • Loading branch information
kavikhalique authored Jul 25, 2024
1 parent 2f8f9de commit bdf9616
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ public Holders.BaseBookmarkHolder onCreateViewHolder(@NonNull ViewGroup parent,
new Holders.TrackViewHolder(inflater.inflate(R.layout.item_track, parent,
false));
trackHolder.setOnClickListener(mClickListener);
trackHolder.setOnLongClickListener(mLongClickListener);
holder = trackHolder;
break;
case TYPE_BOOKMARK:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,11 @@ public void onItemMore(int position)
}
}

private boolean onTrackMenuItemClicked(long trackId)
private void onDeleteTrackSelected(long trackId)
{
BookmarkManager.INSTANCE.deleteTrack(trackId);
getAdapter().notifyDataSetChanged();
return false;
getBookmarkListAdapter().onDelete(mSelectedPosition);
getBookmarkListAdapter().notifyDataSetChanged();
}

@Override
Expand Down Expand Up @@ -735,7 +735,7 @@ private ArrayList<MenuBottomSheetItem> getBookmarkMenuItems()
private ArrayList<MenuBottomSheetItem> getTrackMenuItems(final Track track)
{
ArrayList<MenuBottomSheetItem> items = new ArrayList<>();
items.add(new MenuBottomSheetItem(R.string.delete, R.drawable.ic_delete, () -> onTrackMenuItemClicked(track.getTrackId())));
items.add(new MenuBottomSheetItem(R.string.delete, R.drawable.ic_delete, () -> onDeleteTrackSelected(track.getTrackId())));
return items;
}

Expand Down

0 comments on commit bdf9616

Please sign in to comment.