Skip to content

Commit

Permalink
Working on Remove from playing queue
Browse files Browse the repository at this point in the history
(cherry picked from commit 357f5a4)
  • Loading branch information
EthanArmbrust committed Jan 17, 2018
1 parent 908668b commit 1f6900a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
Expand All @@ -41,6 +42,7 @@
import java.util.List;

public class PlayingQueueAdapter extends RecyclerView.Adapter<PlayingQueueAdapter.ItemHolder> {
private static final String TAG = "PlayingQueueAdapter";

public int currentlyPlayingPosition;
private List<Song> arraylist;
Expand Down Expand Up @@ -97,6 +99,12 @@ public void onClick(View v) {
@Override
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()) {
case R.id.popup_song_remove_queue:
Log.v(TAG,"Removing " + position);
removeSongAt(position);
Log.v(TAG,"arraylist after remove: " + arraylist);
Log.v(TAG,"Queue Size: " + getItemCount());
break;
case R.id.popup_song_play:
MusicPlayer.playAll(mContext, getSongIds(), position, -1, TimberUtils.IdType.NA, false);
break;
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/menu/popup_playing_queue.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<item
android:id="@+id/popup_song_play"
android:title="@string/play" />
<item
android:id="@+id/popup_song_remove_queue"
android:title="Remove from queue"
/>

<item
android:id="@+id/popup_song_addto_playlist"
Expand Down

0 comments on commit 1f6900a

Please sign in to comment.