From 6d085ae6f04effbc931a296c1223a804c152f37c Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:03:17 +0200 Subject: [PATCH] fix: show multiline poll options (#837) * fix: show multiline poll options * fix resources not found exception * don't force height on poll options --------- Co-authored-by: sk --- .../android/PushNotificationReceiver.java | 2 +- .../ui/displayitems/PollOptionStatusDisplayItem.java | 2 +- .../main/res/drawable/bg_poll_option_clickable.xml | 4 ++-- .../res/drawable/bg_poll_option_clickable_inset.xml | 4 ++-- .../src/main/res/drawable/bg_poll_option_voted.xml | 4 ++-- .../main/res/drawable/bg_poll_option_voted_inset.xml | 6 +++--- .../src/main/res/layout/display_item_poll_option.xml | 11 ++++++----- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java index 2d988fe4a..86135f975 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java +++ b/mastodon/src/main/java/org/joinmastodon/android/PushNotificationReceiver.java @@ -207,7 +207,7 @@ public class PushNotificationReceiver extends BroadcastReceiver{ .setShowWhen(true) .setCategory(Notification.CATEGORY_SOCIAL) .setAutoCancel(true) - .setLights(context.getColor(android.R.attr.colorAccent), 500, 1000) + .setLights(UiUtils.getThemeColor(context, android.R.attr.colorAccent), 500, 1000) .setColor(UiUtils.getThemeColor(context, android.R.attr.colorAccent)); if (!GlobalUserPreferences.uniformNotificationIcon) { diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java index 330af7921..ee3357e66 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/PollOptionStatusDisplayItem.java @@ -79,7 +79,7 @@ public class PollOptionStatusDisplayItem extends StatusDisplayItem{ progressBg=activity.getResources().getDrawable(R.drawable.bg_poll_option_voted, activity.getTheme()).mutate(); progressBgInset=activity.getResources().getDrawable(R.drawable.bg_poll_option_voted_inset, activity.getTheme()).mutate(); itemView.setOnClickListener(this::onButtonClick); - button.setOutlineProvider(OutlineProviders.M3_BUTTON); + button.setOutlineProvider(OutlineProviders.roundedRect(20)); button.setClipToOutline(true); } diff --git a/mastodon/src/main/res/drawable/bg_poll_option_clickable.xml b/mastodon/src/main/res/drawable/bg_poll_option_clickable.xml index bff5fa24e..cc3187a95 100644 --- a/mastodon/src/main/res/drawable/bg_poll_option_clickable.xml +++ b/mastodon/src/main/res/drawable/bg_poll_option_clickable.xml @@ -1,12 +1,12 @@ - + - + diff --git a/mastodon/src/main/res/drawable/bg_poll_option_clickable_inset.xml b/mastodon/src/main/res/drawable/bg_poll_option_clickable_inset.xml index b17570609..29dd2b1fc 100644 --- a/mastodon/src/main/res/drawable/bg_poll_option_clickable_inset.xml +++ b/mastodon/src/main/res/drawable/bg_poll_option_clickable_inset.xml @@ -1,13 +1,13 @@ - + - + diff --git a/mastodon/src/main/res/drawable/bg_poll_option_voted.xml b/mastodon/src/main/res/drawable/bg_poll_option_voted.xml index 63979af91..ba14e45d2 100644 --- a/mastodon/src/main/res/drawable/bg_poll_option_voted.xml +++ b/mastodon/src/main/res/drawable/bg_poll_option_voted.xml @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + diff --git a/mastodon/src/main/res/drawable/bg_poll_option_voted_inset.xml b/mastodon/src/main/res/drawable/bg_poll_option_voted_inset.xml index f149fbdfb..1bc8c099b 100644 --- a/mastodon/src/main/res/drawable/bg_poll_option_voted_inset.xml +++ b/mastodon/src/main/res/drawable/bg_poll_option_voted_inset.xml @@ -1,12 +1,12 @@ - + - + @@ -14,7 +14,7 @@ - + diff --git a/mastodon/src/main/res/layout/display_item_poll_option.xml b/mastodon/src/main/res/layout/display_item_poll_option.xml index 298dea04c..1c9289c60 100644 --- a/mastodon/src/main/res/layout/display_item_poll_option.xml +++ b/mastodon/src/main/res/layout/display_item_poll_option.xml @@ -5,28 +5,30 @@ android:layout_height="wrap_content" android:paddingLeft="16dp" android:paddingRight="16dp" - android:paddingBottom="4dp" + android:paddingVertical="4dp" android:clipToPadding="false">