diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FilterDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FilterDialog.java index 82bdfaafe..a5d024545 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/FilterDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/FilterDialog.java @@ -50,9 +50,7 @@ public abstract class FilterDialog { for (String filterId : filterValues) { if (!TextUtils.isEmpty(filterId)) { - if (layout.findViewWithTag(filterId) != null) { - ((RadioButton) layout.findViewWithTag(filterId)).setChecked(true); - } + ((RadioButton) layout.findViewWithTag(filterId)).setChecked(true); } } @@ -67,6 +65,9 @@ public abstract class FilterDialog { filterValues.add((String) group.getCheckedButton().getTag()); } } + if (filterValues.contains(null)) { + filterValues.clear(); + } updateFilter(filterValues); }); diff --git a/app/src/main/res/layout/filter_dialog_row.xml b/app/src/main/res/layout/filter_dialog_row.xml index 5a92ae8d9..ff26a58cb 100644 --- a/app/src/main/res/layout/filter_dialog_row.xml +++ b/app/src/main/res/layout/filter_dialog_row.xml @@ -30,7 +30,7 @@ android:button="@android:color/transparent" android:checked="false" android:gravity="center" - android:textColor="@drawable/filter_dialog_button_text_light" /> + android:textColor="@color/filter_dialog_button_text" /> + android:textColor="@color/filter_dialog_button_text" /> @@ -49,7 +49,7 @@ android:id="@+id/filter_dialog_clear" android:layout_width="48dp" android:layout_height="48dp" - android:background="?attr/filter_dialog_button_clear" + android:background="@drawable/ic_filter_close" android:button="@android:color/transparent" android:checked="true" /> diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java index 7c707da38..d34e23506 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItemFilter.java @@ -35,10 +35,9 @@ public class FeedItemFilter { public FeedItemFilter(String[] properties) { this.mProperties = properties; - Log.d("***xxx***", Arrays.toString(properties)); for (String property : properties) { // see R.arrays.feed_filter_values - switch ("" + property) { + switch (property) { case "unplayed": showUnplayed = true; break; @@ -76,7 +75,7 @@ public class FeedItemFilter { showNotFavorite = true; break; default: - return; + break; } } } @@ -85,7 +84,7 @@ public class FeedItemFilter { * Run a list of feed items through the filter. */ public List filter(List items) { - if (mProperties.length == 0) return items; + if(mProperties.length == 0) return items; List result = new ArrayList<>(); diff --git a/core/src/main/res/color/filter_dialog_button_text.xml b/core/src/main/res/color/filter_dialog_button_text.xml new file mode 100644 index 000000000..674365424 --- /dev/null +++ b/core/src/main/res/color/filter_dialog_button_text.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/src/main/res/color/filter_dialog_close.xml b/core/src/main/res/color/filter_dialog_close.xml new file mode 100644 index 000000000..1b059c818 --- /dev/null +++ b/core/src/main/res/color/filter_dialog_close.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/core/src/main/res/drawable-hdpi/x_custom_off.png b/core/src/main/res/drawable-hdpi/x_custom_off.png deleted file mode 100644 index 2450d2e89..000000000 Binary files a/core/src/main/res/drawable-hdpi/x_custom_off.png and /dev/null 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 deleted file mode 100644 index 07525f925..000000000 Binary files a/core/src/main/res/drawable-hdpi/x_custom_on.png and /dev/null differ diff --git a/core/src/main/res/drawable/filter_dialog_button_clear.xml b/core/src/main/res/drawable/filter_dialog_button_clear.xml deleted file mode 100644 index 33e3888b9..000000000 --- a/core/src/main/res/drawable/filter_dialog_button_clear.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/core/src/main/res/drawable/ic_filter_close_dark.xml b/core/src/main/res/drawable/ic_filter_close.xml similarity index 84% rename from core/src/main/res/drawable/ic_filter_close_dark.xml rename to core/src/main/res/drawable/ic_filter_close.xml index fb2c5cf81..0cfbbf3f5 100644 --- a/core/src/main/res/drawable/ic_filter_close_dark.xml +++ b/core/src/main/res/drawable/ic_filter_close.xml @@ -10,9 +10,8 @@ + android:color="?attr/filter_dialog_close" /> - @@ -29,7 +28,7 @@ + android:color="?attr/filter_dialog_close" /> @@ -47,7 +46,7 @@ + android:color="?attr/filter_dialog_close" /> diff --git a/core/src/main/res/drawable/ic_filter_close_light.xml b/core/src/main/res/drawable/ic_filter_close_light.xml deleted file mode 100644 index 63e9a29b9..000000000 --- a/core/src/main/res/drawable/ic_filter_close_light.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 998b086c6..5b80840ac 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -1,7 +1,9 @@ + + + - diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 148919db7..bd542a05c 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -40,4 +40,7 @@ #757575 #46C6C6C6 + #FFFFFF + #000000 + diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 1aaa67e2d..adeb7573a 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -9,9 +9,6 @@ @drawable/filter_dialog_button_background_light - @drawable/filter_dialog_button_clear - @color/dialog_filter_clear_active_light - @color/dialog_filter_clear_inactive_light @color/accent_light @color/accent_light @color/accent_light @@ -79,6 +76,12 @@ @drawable/ic_key_black @drawable/ic_volume_adaption_black @drawable/scrollbar_thumb_light + + @color/dialog_filter_text_active + @color/dialog_filter_text_inactive + @color/dialog_filter_clear_active_light + @color/dialog_filter_clear_inactive_light + @color/filter_dialog_close