From c69b224c65a7960c640b80ad98792ef8f85b4a0a Mon Sep 17 00:00:00 2001 From: Akash Agarwal Date: Sat, 1 Dec 2018 00:35:27 +0530 Subject: [PATCH 1/3] Issue 1505: Delete on right swipe --- .../org/schabi/newpipe/player/MainVideoPlayer.java | 5 +++++ .../schabi/newpipe/player/ServicePlayerActivity.java | 5 +++++ .../player/playqueue/PlayQueueItemTouchCallback.java | 10 +++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java index 07a9ac71c..f4fea5165 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java @@ -900,6 +900,11 @@ public final class MainVideoPlayer extends AppCompatActivity public void onMove(int sourceIndex, int targetIndex) { if (playQueue != null) playQueue.move(sourceIndex, targetIndex); } + + @Override + public void onSwiped(int index) { + if(index != -1) playQueue.remove(index); + } }; } diff --git a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java index 94305e6c4..2ec4275fc 100644 --- a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java +++ b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java @@ -375,6 +375,11 @@ public abstract class ServicePlayerActivity extends AppCompatActivity public void onMove(int sourceIndex, int targetIndex) { if (player != null) player.getPlayQueue().move(sourceIndex, targetIndex); } + + @Override + public void onSwiped(int index) { + if (index != -1) player.getPlayQueue().remove(index); + } }; } diff --git a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueueItemTouchCallback.java b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueueItemTouchCallback.java index 6edeff670..26be83b98 100644 --- a/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueueItemTouchCallback.java +++ b/app/src/main/java/org/schabi/newpipe/player/playqueue/PlayQueueItemTouchCallback.java @@ -8,11 +8,13 @@ public abstract class PlayQueueItemTouchCallback extends ItemTouchHelper.SimpleC private static final int MAXIMUM_INITIAL_DRAG_VELOCITY = 25; public PlayQueueItemTouchCallback() { - super(ItemTouchHelper.UP | ItemTouchHelper.DOWN, 0); + super(ItemTouchHelper.UP | ItemTouchHelper.DOWN, ItemTouchHelper.RIGHT); } public abstract void onMove(final int sourceIndex, final int targetIndex); + public abstract void onSwiped(int index); + @Override public int interpolateOutOfBoundsScroll(RecyclerView recyclerView, int viewSize, int viewSizeOutOfBounds, int totalSize, @@ -44,9 +46,11 @@ public abstract class PlayQueueItemTouchCallback extends ItemTouchHelper.SimpleC @Override public boolean isItemViewSwipeEnabled() { - return false; + return true; } @Override - public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) {} + public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) { + onSwiped(viewHolder.getAdapterPosition()); + } } From c1168693fa0fd9eec729db6ac025960a7c0a04d7 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sat, 1 Dec 2018 09:35:42 +0100 Subject: [PATCH 2/3] add stalebot confic --- .github/stale.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 000000000..e556fa985 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,17 @@ +# Number of days of inactivity before an issue becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale issue is closed +daysUntilClose: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: stale +# Comment to post when marking an issue as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false From ea4e8805b7c74755c73ae998bfc8d405048233be Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Mon, 3 Dec 2018 23:30:28 +0100 Subject: [PATCH 3/3] disable stalebot again --- .github/stale.yml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index e556fa985..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 60 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false