diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2018-10-21 11:05:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-21 11:05:43 +0200 |
commit | a8fdf88b74e60236d234dfde7cb81f6e467bfe77 (patch) | |
tree | cfedbbdb52168094459b6535896800e7be8ee6b8 /app/src/main/java/de/danoeh/antennapod/dialog | |
parent | f1710cae47e43ec6f638622f508f6bd17a970afb (diff) | |
parent | 8ebb9854e6b371c8b8d6a013d13cb583040ac64a (diff) | |
download | AntennaPod-a8fdf88b74e60236d234dfde7cb81f6e467bfe77.zip |
Merge pull request #2863 from ByteHamster/mark-all-below
Allow to select all above/below in batch editor
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/dialog')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index d1ee926ac..7f054f5dd 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.dialog; +import android.app.AlertDialog; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -95,6 +96,28 @@ public class EpisodesApplyActionFragment extends Fragment { } refreshCheckboxes(); }); + mListView.setOnItemLongClickListener((adapterView, view12, position, id) -> { + new AlertDialog.Builder(getActivity()) + .setItems(R.array.batch_long_press_options, (dialogInterface, item) -> { + int direction; + if (item == 0) { + direction = -1; + } else { + direction = 1; + } + + int currentPosition = position + direction; + while (currentPosition >= 0 && currentPosition < episodes.size()) { + long id1 = episodes.get(currentPosition).getId(); + if (!checkedIds.contains(id1)) { + checkedIds.add(id1); + } + currentPosition += direction; + } + refreshCheckboxes(); + }).show(); + return true; + }); for(FeedItem episode : episodes) { titles.add(episode.getTitle()); |