From 954399b2557eb43976dd344daee25b53d629811e Mon Sep 17 00:00:00 2001 From: Grady Clark <50427197+GradyClark@users.noreply.github.com> Date: Thu, 5 Mar 2020 07:49:04 -0600 Subject: [PATCH] Moved the 'Remove Watched' button to the three dot menu button. --- .../local/playlist/LocalPlaylistFragment.java | 49 +++++++++++++------ .../res/layout/local_playlist_control.xml | 33 ++----------- app/src/main/res/menu/menu_local_playlist.xml | 10 ++++ 3 files changed, 47 insertions(+), 45 deletions(-) create mode 100644 app/src/main/res/menu/menu_local_playlist.xml diff --git a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java index a3611fa85..c68cd2f55 100644 --- a/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java +++ b/app/src/main/java/org/schabi/newpipe/local/playlist/LocalPlaylistFragment.java @@ -8,6 +8,9 @@ import android.os.Parcelable; import android.text.TextUtils; import android.util.Log; import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuInflater; +import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; @@ -76,7 +79,6 @@ public class LocalPlaylistFragment extends BaseLocalListFragment result) { super.handleResult(result); @@ -369,13 +389,6 @@ public class LocalPlaylistFragment extends BaseLocalListFragment NavigationHelper.playOnBackgroundPlayer(activity, getPlayQueue(), false)); - headerRemoveWatchedButton.setOnClickListener( - view -> { - //Solution, Scorched Earth, Copy non duplicates, clear playlist, then copy back over - //Other options didn't work as intended, or crashed. Like deleteItem(playlist_item) crashes when called in this function. - new RemoveWatchedStreams().execute(); - } - ); headerPopupButton.setOnLongClickListener(view -> { NavigationHelper.enqueueOnPopupPlayer(activity, getPlayQueue(), true); @@ -706,7 +719,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment { List localItems = new ArrayList<>(); Long RemovedItemCount = 0l; - boolean thumbNailVideoRemoved = false; + boolean thumbnailVideoRemoved = false; @Override protected void onPreExecute() { @@ -749,7 +762,7 @@ public class LocalPlaylistFragment extends BaseLocalListFragment + + + - - - - - - - - diff --git a/app/src/main/res/menu/menu_local_playlist.xml b/app/src/main/res/menu/menu_local_playlist.xml new file mode 100644 index 000000000..4c499a51d --- /dev/null +++ b/app/src/main/res/menu/menu_local_playlist.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file