diff options
author | ByteHamster <info@bytehamster.com> | 2018-10-16 14:31:49 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2018-10-16 14:31:49 +0200 |
commit | 8ebb9854e6b371c8b8d6a013d13cb583040ac64a (patch) | |
tree | 23eeeadcfa31a918b058525775c6a30a63e8b1dd /app/src/main/java/de/danoeh/antennapod/dialog | |
parent | 2d4739bd843bf522b06b128308c3284029b4a46c (diff) | |
download | AntennaPod-8ebb9854e6b371c8b8d6a013d13cb583040ac64a.zip |
Allow to select all above 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()); |