summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilterGroup.java98
-rw-r--r--core/src/main/res/color/filter_dialog_button_background_light.xml5
-rw-r--r--core/src/main/res/color/filter_dialog_button_clear.xml5
-rw-r--r--core/src/main/res/color/filter_dialog_button_text_light.xml5
-rw-r--r--core/src/main/res/drawable/filter_dialog_x_off.xml56
-rw-r--r--core/src/main/res/drawable/ic_filter_close_light.xml (renamed from core/src/main/res/drawable/filter_dialog_x_on.xml)8
-rw-r--r--core/src/main/res/values/arrays.xml12
7 files changed, 43 insertions, 146 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
index 18c1c186d..7a0eac2e3 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilterGroup.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilterGroup.java
@@ -2,83 +2,35 @@ 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 {
+public enum FeedItemFilterGroup {
+ PLAYED(new ItemProperties(R.string.hide_played_episodes_label, "played"),
+ new ItemProperties(R.string.not_played, "unplayed")),
+ PAUSED(new ItemProperties(R.string.hide_paused_episodes_label, "paused"),
+ new ItemProperties(R.string.not_paused, "")),
+ FAVORITE(new ItemProperties(R.string.hide_is_favorite_label, "is_favorite"),
+ new ItemProperties(R.string.not_favorite, "")),
+ MEDIA(new ItemProperties(R.string.has_media, ""),
+ new ItemProperties(R.string.no_media, "no_media")),
+ QUEUED(new ItemProperties(R.string.queued_label, "queued"),
+ new ItemProperties(R.string.not_queued_label, "not_queued")),
+ DOWNLOADED(new ItemProperties(R.string.hide_downloaded_episodes_label, "downloaded"),
+ new ItemProperties(R.string.hide_not_downloaded_episodes_label, "not_downloaded"));
+
+ public final ItemProperties[] values;
+
+ FeedItemFilterGroup(ItemProperties... values) {
+ this.values = values;
+ }
- 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 static class ItemProperties {
- public final ItemProperties[] values;
+ public final int displayName;
+ public final String filterId;
- FeedItemEnum(ItemProperties... values) {
- this.values = values;
+ public ItemProperties(int displayName, String filterId) {
+ this.displayName = displayName;
+ this.filterId = filterId;
}
- 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/color/filter_dialog_button_background_light.xml b/core/src/main/res/color/filter_dialog_button_background_light.xml
new file mode 100644
index 000000000..c6dd0d6cb
--- /dev/null
+++ b/core/src/main/res/color/filter_dialog_button_background_light.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_checked="true" android:color="@color/accent_light" />
+ <item android:color="@color/master_switch_background_light" />
+</selector>
diff --git a/core/src/main/res/color/filter_dialog_button_clear.xml b/core/src/main/res/color/filter_dialog_button_clear.xml
new file mode 100644
index 000000000..1ef3e3e57
--- /dev/null
+++ b/core/src/main/res/color/filter_dialog_button_clear.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_checked="true" android:color="@color/grey" />
+ <item android:color="@color/master_switch_background_light" />
+</selector>
diff --git a/core/src/main/res/color/filter_dialog_button_text_light.xml b/core/src/main/res/color/filter_dialog_button_text_light.xml
new file mode 100644
index 000000000..0a5388eb9
--- /dev/null
+++ b/core/src/main/res/color/filter_dialog_button_text_light.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_checked="true" android:color="@color/white" />
+ <item android:color="@color/black" />
+</selector>
diff --git a/core/src/main/res/drawable/filter_dialog_x_off.xml b/core/src/main/res/drawable/filter_dialog_x_off.xml
deleted file mode 100644
index 8368ffa51..000000000
--- a/core/src/main/res/drawable/filter_dialog_x_off.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?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/ic_filter_close_light.xml
index b25b42df3..1d695cd0f 100644
--- a/core/src/main/res/drawable/filter_dialog_x_on.xml
+++ b/core/src/main/res/drawable/ic_filter_close_light.xml
@@ -10,9 +10,8 @@
<shape android:shape="oval">
<stroke
android:width="4dp"
- android:color="@color/grey" />
+ android:color="@color/filter_dialog_button_clear" />
</shape>
-
</item>
<!-- x -->
@@ -29,7 +28,7 @@
<shape android:shape="line">
<stroke
android:width="4dp"
- android:color="@color/grey" />
+ android:color="@color/filter_dialog_button_clear" />
</shape>
</rotate>
</item>
@@ -47,9 +46,8 @@
<shape android:shape="line">
<stroke
android:width="4dp"
- android:color="@color/grey" />
+ android:color="@color/filter_dialog_button_clear" />
</shape>
-
</rotate>
</item>
diff --git a/core/src/main/res/values/arrays.xml b/core/src/main/res/values/arrays.xml
index 8e8d70525..13ff092b0 100644
--- a/core/src/main/res/values/arrays.xml
+++ b/core/src/main/res/values/arrays.xml
@@ -245,18 +245,6 @@
<item>exoplayer</item>
</string-array>
- <string-array name="episode_filter_options">
- <item>@string/hide_unplayed_episodes_label</item>
- <item>@string/hide_paused_episodes_label</item>
- <item>@string/hide_played_episodes_label</item>
- <item>@string/hide_queued_episodes_label</item>
- <item>@string/hide_not_queued_episodes_label</item>
- <item>@string/hide_downloaded_episodes_label</item>
- <item>@string/hide_not_downloaded_episodes_label</item>
- <item>@string/hide_has_media_label</item>
- <item>@string/hide_is_favorite_label</item>
- </string-array>
-
<!-- sort for podcast screen, not for queue -->
<string-array name="feed_episodes_sort_options">
<item>@string/sort_date_new_old</item>