Added a drag view to playlist songs for easier rearrangement
This commit is contained in:
parent
a83e54c37f
commit
29f91b6969
11 changed files with 34 additions and 2 deletions
|
|
@ -49,6 +49,10 @@ public abstract class MediaEntryViewHolder extends RecyclerView.ViewHolder imple
|
|||
@Bind(R.id.selected_indicator)
|
||||
public View selectedIndicator;
|
||||
|
||||
@Nullable
|
||||
@Bind(R.id.drag_view)
|
||||
public View dragView;
|
||||
|
||||
@Nullable
|
||||
@Bind(R.id.palette_color_container)
|
||||
public View paletteColorContainer;
|
||||
|
|
|
|||
|
|
@ -48,6 +48,9 @@ public class PlaylistSongAdapter extends SongAdapter {
|
|||
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
if (dragView != null) {
|
||||
dragView.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ public class PlaylistDetailActivity extends AbsSlidingMusicPanelActivity impleme
|
|||
adapter = new PlaylistSongAdapter(this, loadPlaylistDataSet(), R.layout.item_list, false, this);
|
||||
|
||||
DragSortRecycler dragSortRecycler = new DragSortRecycler();
|
||||
dragSortRecycler.setViewHandleId(R.id.image);
|
||||
dragSortRecycler.setViewHandleId(R.id.drag_view);
|
||||
dragSortRecycler.setOnItemMovedListener(new DragSortRecycler.OnItemMovedListener() {
|
||||
@Override
|
||||
public void onItemMoved(int from, int to) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue