summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2023-05-07 11:28:41 +0200
committerGitHub <noreply@github.com>2023-05-07 11:28:41 +0200
commitb8a1c1f49ac57a6c0cee9ccab45f565e6bf6b67f (patch)
treec94b8e1806e9148a96e21285d60b9b4950f671f7
parentda16f13e8bcaa92333557823eef23f7c15636555 (diff)
downloadAntennaPod-b8a1c1f49ac57a6c0cee9ccab45f565e6bf6b67f.zip
Let filter button height grow (#6477)
Also, make it easier to see what option is selected
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java4
-rw-r--r--app/src/main/res/layout/filter_dialog_row.xml8
-rw-r--r--core/src/main/res/color/button_bg_selector.xml6
-rw-r--r--core/src/main/res/values/styles.xml4
5 files changed, 22 insertions, 4 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java
index a122a7cec..92c143992 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java
@@ -47,6 +47,10 @@ public abstract class ItemFilterDialog extends BottomSheetDialogFragment {
binding.filterButton1.setTag(item.values[0].filterId);
binding.filterButton2.setText(item.values[1].displayName);
binding.filterButton2.setTag(item.values[1].filterId);
+ binding.filterButton1.setMaxLines(3);
+ binding.filterButton1.setSingleLine(false);
+ binding.filterButton2.setMaxLines(3);
+ binding.filterButton2.setSingleLine(false);
rows.addView(binding.getRoot());
}
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java
index 1aedfcf8b..cf77c2838 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/SubscriptionsFilterDialog.java
@@ -46,6 +46,10 @@ public class SubscriptionsFilterDialog {
} else {
binding.filterButton2.setVisibility(View.GONE);
}
+ binding.filterButton1.setMaxLines(3);
+ binding.filterButton1.setSingleLine(false);
+ binding.filterButton2.setMaxLines(3);
+ binding.filterButton2.setSingleLine(false);
rows.addView(binding.getRoot());
}
diff --git a/app/src/main/res/layout/filter_dialog_row.xml b/app/src/main/res/layout/filter_dialog_row.xml
index cc397df02..81185a1de 100644
--- a/app/src/main/res/layout/filter_dialog_row.xml
+++ b/app/src/main/res/layout/filter_dialog_row.xml
@@ -11,15 +11,15 @@
<Button
android:id="@+id/filterButton1"
android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_weight="1"
- style="?attr/materialButtonOutlinedStyle" />
+ style="@style/OutlinedButtonBetterContrast" />
<Button
android:id="@+id/filterButton2"
android:layout_width="0dp"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
android:layout_weight="1"
- style="?attr/materialButtonOutlinedStyle" />
+ style="@style/OutlinedButtonBetterContrast" />
</com.google.android.material.button.MaterialButtonToggleGroup>
diff --git a/core/src/main/res/color/button_bg_selector.xml b/core/src/main/res/color/button_bg_selector.xml
new file mode 100644
index 000000000..f416daa72
--- /dev/null
+++ b/core/src/main/res/color/button_bg_selector.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <!-- Difference to Material Components: alpha is 0.3 instead of 0.08 -->
+ <item android:alpha="0.3" android:color="?attr/colorPrimary" android:state_checked="true"/>
+ <item android:color="@android:color/transparent" android:state_checked="false"/>
+</selector> \ No newline at end of file
diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml
index 6e1335706..0ebf2aaf7 100644
--- a/core/src/main/res/values/styles.xml
+++ b/core/src/main/res/values/styles.xml
@@ -253,6 +253,10 @@
<item name="android:ellipsize">end</item>
</style>
+ <style name="OutlinedButtonBetterContrast" parent="Widget.Material3.Button.OutlinedButton">
+ <item name="backgroundTint">@color/button_bg_selector</item>
+ </style>
+
<style name="ProgressBarLight">
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@drawable/progress_bar_horizontal_light</item>