forked from organicmaps/organicmaps
[android] Reimplements Track Deletion
Signed-off-by: kavikhalique <kavikhalique3@gmail.com>
This commit is contained in:
parent
2f8f9ded88
commit
bdf9616a87
2 changed files with 5 additions and 4 deletions
|
@ -410,6 +410,7 @@ public class BookmarkListAdapter extends RecyclerView.Adapter<Holders.BaseBookma
|
|||
new Holders.TrackViewHolder(inflater.inflate(R.layout.item_track, parent,
|
||||
false));
|
||||
trackHolder.setOnClickListener(mClickListener);
|
||||
trackHolder.setOnLongClickListener(mLongClickListener);
|
||||
holder = trackHolder;
|
||||
break;
|
||||
case TYPE_BOOKMARK:
|
||||
|
|
|
@ -600,11 +600,11 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
|
|||
}
|
||||
}
|
||||
|
||||
private boolean onTrackMenuItemClicked(long trackId)
|
||||
private void onDeleteTrackSelected(long trackId)
|
||||
{
|
||||
BookmarkManager.INSTANCE.deleteTrack(trackId);
|
||||
getAdapter().notifyDataSetChanged();
|
||||
return false;
|
||||
getBookmarkListAdapter().onDelete(mSelectedPosition);
|
||||
getBookmarkListAdapter().notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -735,7 +735,7 @@ public class BookmarksListFragment extends BaseMwmRecyclerFragment<ConcatAdapter
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue