summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorbws9000 <armorsoft@gmail.com>2020-06-21 12:52:15 +0200
committerByteHamster <info@bytehamster.com>2020-06-21 12:59:05 +0200
commitf243bcd4cce1f3af9449c74fa38f6c90f2ea9d22 (patch)
tree66917ea84f00e0e327cbe3371f06cad5931c201a /core
parent65ec9e5f458e1d3c9003f79c21abb217a81d1910 (diff)
downloadAntennaPod-f243bcd4cce1f3af9449c74fa38f6c90f2ea9d22.zip
Redesign filter dialog
Diffstat (limited to 'core')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilterGroup.java84
-rw-r--r--core/src/main/res/drawable-hdpi/x_custom_off.pngbin0 -> 1062 bytes
-rw-r--r--core/src/main/res/drawable-hdpi/x_custom_on.pngbin0 -> 1093 bytes
-rw-r--r--core/src/main/res/drawable/filter_dialog_x_off.xml56
-rw-r--r--core/src/main/res/drawable/filter_dialog_x_on.xml56
-rw-r--r--core/src/main/res/values/arrays.xml12
-rw-r--r--core/src/main/res/values/strings.xml21
7 files changed, 209 insertions, 20 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilterGroup.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilterGroup.java
new file mode 100644
index 000000000..18c1c186d
--- /dev/null
+++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilterGroup.java
@@ -0,0 +1,84 @@
+package de.danoeh.antennapod.core.feed;
+
+import de.danoeh.antennapod.core.R;
+
+public class FeedItemFilterGroup {
+
+ private static boolean DEFAULT_SELECTED_STATE = false;
+
+ private static final String NO_FILTERID = "";
+ private static final int HASMEDIA_LABEL = R.string.has_media;
+ private static final int NOTPAUSED_LABEL = R.string.not_paused;
+ private static final int NOTFAVORITE_LABEL = R.string.not_favorite;
+
+ private static final int UNPLAYED_LABEL = R.string.not_played;
+ private static final String UNPLAYED_FILTERID = "unplayed";
+
+ private static final int PLAYED_LABEL = R.string.hide_played_episodes_label;
+ private static final String PLAYED_FILTERID = "played";
+
+ private static final int PAUSED_LABEL = R.string.hide_paused_episodes_label;
+ private static final String PAUSED_FILTERID = "paused";
+
+ private static final int ISFAVORITE_LABEL = R.string.hide_is_favorite_label;
+ private static final String ISFAVORITE_FILTERID = "is_favorite";
+
+ private static final int NOMEDIA_LABEL = R.string.no_media;
+ private static final String NOMEDIA_FILTERID = "no_media";
+
+ private static final int QUEUED_LABEL = R.string.queue_label;
+ private static final String QUEUED_FILTERID = "queued";
+
+ private static final int NOTQUEUED_LABEL = R.string.not_queued_label;
+ private static final String NOTQUEUED_FILTERID = "not_queued";
+
+ private static final int NOTDOWNLOADED_LABEL = R.string.hide_downloaded_episodes_label;
+ private static final String NOTDOWNLOADED_FILTERID = "not_downloaded";
+
+ private static final int DOWNLOADED_LABEL = R.string.hide_downloaded_episodes_label;
+ private static final String DOWNLOADED_FILTERID = "downloaded";
+
+ public enum FeedItemEnum {
+
+ PLAYED(new ItemProperties(DEFAULT_SELECTED_STATE, UNPLAYED_LABEL, UNPLAYED_FILTERID),
+ new ItemProperties(DEFAULT_SELECTED_STATE, PLAYED_LABEL, PLAYED_FILTERID)),
+ PAUSED(new ItemProperties(DEFAULT_SELECTED_STATE, NOTPAUSED_LABEL, NO_FILTERID),
+ new ItemProperties(DEFAULT_SELECTED_STATE, PAUSED_LABEL, PAUSED_FILTERID)),
+ FAVORITE(new ItemProperties(DEFAULT_SELECTED_STATE, NOTFAVORITE_LABEL, NO_FILTERID),
+ new ItemProperties(DEFAULT_SELECTED_STATE, ISFAVORITE_LABEL, ISFAVORITE_FILTERID)),
+ MEDIA(new ItemProperties(DEFAULT_SELECTED_STATE, NOMEDIA_LABEL, NOMEDIA_FILTERID),
+ new ItemProperties(DEFAULT_SELECTED_STATE, HASMEDIA_LABEL, NO_FILTERID)),
+ QUEUED(new ItemProperties(DEFAULT_SELECTED_STATE, NOTQUEUED_LABEL, NOTQUEUED_FILTERID),
+ new ItemProperties(DEFAULT_SELECTED_STATE, QUEUED_LABEL, QUEUED_FILTERID)),
+ DOWNLOADED(new ItemProperties(DEFAULT_SELECTED_STATE, NOTDOWNLOADED_LABEL, NOTDOWNLOADED_FILTERID),
+ new ItemProperties(DEFAULT_SELECTED_STATE, DOWNLOADED_LABEL, DOWNLOADED_FILTERID));
+
+ public final ItemProperties[] values;
+
+ FeedItemEnum(ItemProperties... values) {
+ this.values = values;
+ }
+
+ public static class ItemProperties {
+
+ public final int displayName;
+ public boolean selected;
+ public final String filterId;
+
+ public void setSelected(boolean value) {
+ this.selected = value;
+ }
+
+ public boolean getSelected() {
+ return this.selected;
+ }
+
+ public ItemProperties(boolean selected, int displayName, String filterId) {
+ this.selected = selected;
+ this.displayName = displayName;
+ this.filterId = filterId;
+ }
+
+ }
+ }
+}
diff --git a/core/src/main/res/drawable-hdpi/x_custom_off.png b/core/src/main/res/drawable-hdpi/x_custom_off.png
new file mode 100644
index 000000000..2450d2e89
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/x_custom_off.png
Binary files differ
diff --git a/core/src/main/res/drawable-hdpi/x_custom_on.png b/core/src/main/res/drawable-hdpi/x_custom_on.png
new file mode 100644
index 000000000..07525f925
--- /dev/null
+++ b/core/src/main/res/drawable-hdpi/x_custom_on.png
Binary files differ
diff --git a/core/src/main/res/drawable/filter_dialog_x_off.xml b/core/src/main/res/drawable/filter_dialog_x_off.xml
new file mode 100644
index 000000000..8368ffa51
--- /dev/null
+++ b/core/src/main/res/drawable/filter_dialog_x_off.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:bottom="5dp"
+ android:left="5dp"
+ android:right="5dp"
+ android:top="5dp">
+
+ <shape android:shape="oval">
+ <stroke
+ android:width="4dp"
+ android:color="@color/master_switch_background_light" />
+ </shape>
+
+ </item>
+
+ <!-- x -->
+ <item
+ android:bottom="12dp"
+ android:left="12dp"
+ android:right="12dp"
+ android:top="12dp">
+ <rotate
+ android:fromDegrees="135"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:toDegrees="135">
+ <shape android:shape="line">
+ <stroke
+ android:width="4dp"
+ android:color="@color/master_switch_background_light" />
+ </shape>
+ </rotate>
+ </item>
+
+ <item
+ android:bottom="12dp"
+ android:left="12dp"
+ android:right="12dp"
+ android:top="12dp">
+ <rotate
+ android:fromDegrees="45"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:toDegrees="45">
+ <shape android:shape="line">
+ <stroke
+ android:width="4dp"
+ android:color="@color/master_switch_background_light" />
+ </shape>
+
+ </rotate>
+ </item>
+
+</layer-list> \ No newline at end of file
diff --git a/core/src/main/res/drawable/filter_dialog_x_on.xml b/core/src/main/res/drawable/filter_dialog_x_on.xml
new file mode 100644
index 000000000..b25b42df3
--- /dev/null
+++ b/core/src/main/res/drawable/filter_dialog_x_on.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:bottom="5dp"
+ android:left="5dp"
+ android:right="5dp"
+ android:top="5dp">
+
+ <shape android:shape="oval">
+ <stroke
+ android:width="4dp"
+ android:color="@color/grey" />
+ </shape>
+
+ </item>
+
+ <!-- x -->
+ <item
+ android:bottom="12dp"
+ android:left="12dp"
+ android:right="12dp"
+ android:top="12dp">
+ <rotate
+ android:fromDegrees="135"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:toDegrees="135">
+ <shape android:shape="line">
+ <stroke
+ android:width="4dp"
+ android:color="@color/grey" />
+ </shape>
+ </rotate>
+ </item>
+
+ <item
+ android:bottom="12dp"
+ android:left="12dp"
+ android:right="12dp"
+ android:top="12dp">
+ <rotate
+ android:fromDegrees="45"
+ android:pivotX="50%"
+ android:pivotY="50%"
+ android:toDegrees="45">
+ <shape android:shape="line">
+ <stroke
+ android:width="4dp"
+ android:color="@color/grey" />
+ </shape>
+
+ </rotate>
+ </item>
+
+</layer-list> \ No newline at end of file
diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml
index dc79905cd..8e8d70525 100644
--- a/core/src/main/res/values/arrays.xml
+++ b/core/src/main/res/values/arrays.xml
@@ -257,18 +257,6 @@
<item>@string/hide_is_favorite_label</item>
</string-array>
- <string-array name="episode_filter_values">
- <item>unplayed</item>
- <item>paused</item>
- <item>played</item>
- <item>queued</item>
- <item>not_queued</item>
- <item>downloaded</item>
- <item>not_downloaded</item>
- <item>has_media</item>
- <item>is_favorite</item>
- </string-array>
-
<!-- sort for podcast screen, not for queue -->
<string-array name="feed_episodes_sort_options">
<item>@string/sort_date_new_old</item>
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index 93a21ef13..e46004664 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -151,14 +151,9 @@
<string name="select_all_above">Select all above</string>
<string name="select_all_below">Select all below</string>
<string name="hide_unplayed_episodes_label">Unplayed</string>
- <string name="hide_paused_episodes_label">Paused</string>
- <string name="hide_played_episodes_label">Played</string>
<string name="hide_queued_episodes_label">Queued</string>
<string name="hide_not_queued_episodes_label">Not queued</string>
- <string name="hide_downloaded_episodes_label">Downloaded</string>
- <string name="hide_not_downloaded_episodes_label">Not downloaded</string>
<string name="hide_has_media_label">Has media</string>
- <string name="hide_is_favorite_label">Is favorite</string>
<string name="filtered_label">Filtered</string>
<string name="refresh_failed_msg">{fa-exclamation-circle} Last Refresh failed</string>
<string name="open_podcast">Open Podcast</string>
@@ -736,13 +731,23 @@
<string name="selected_downloaded_label">Selected downloaded Episodes</string>
<string name="not_downloaded_label">Not downloaded</string>
<string name="selected_not_downloaded_label">Selected not downloaded Episodes</string>
- <string name="queued_label">Queued</string>
<string name="selected_queued_label">Selected queued Episodes</string>
- <string name="not_queued_label">Not queued</string>
<string name="selected_not_queued_label">Selected not queued Episodes</string>
- <string name="has_media">Has media</string>
<string name="selected_has_media_label">Selected episodes with media</string>
+ <string name="hide_is_favorite_label">Is favorite</string>
+ <string name="not_favorite">Not favorite</string>
+ <string name="hide_downloaded_episodes_label">Downloaded</string>
+ <string name="hide_not_downloaded_episodes_label">Not downloaded</string>
+ <string name="queued_label">Queued</string>
+ <string name="not_queued_label">Not queued</string>
+ <string name="has_media">Has media</string>
+ <string name="no_media">No media</string>
+ <string name="hide_paused_episodes_label">Paused</string>
+ <string name="not_paused">Not paused</string>
+ <string name="hide_played_episodes_label">Played</string>
+ <string name="not_played">Not played</string>
+
<!-- Sort -->
<string name="sort_title_a_z">Title (A \u2192 Z)</string>
<string name="sort_title_z_a">Title (Z \u2192 A)</string>