From 2fafdcc4f818acd8a9a9f34ae4861dfb30bbed5a Mon Sep 17 00:00:00 2001 From: sk Date: Sun, 27 Aug 2023 14:33:57 +0200 Subject: [PATCH] fix unifiedpush settings item closes sk22#770 --- .../fragments/settings/SettingsNotificationsFragment.java | 5 +++-- .../res/drawable/ic_fluent_alert_arrow_up_24_regular.xml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsNotificationsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsNotificationsFragment.java index e64e1054f..5192b9fc1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsNotificationsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsNotificationsFragment.java @@ -98,6 +98,7 @@ public class SettingsNotificationsFragment extends BaseSettingsFragment{ typeItems=List.of(mentionsItem, boostsItem, favoritesItem, followersItem, pollsItem, updateItem, postsItem); pauseItem.checkedChangeListener=checked->onPauseNotificationsClick(true); + unifiedPushItem.checkedChangeListener=checked->onUnifiedPush(); updatePolicyItem(null); updatePauseItem(); } @@ -347,7 +348,7 @@ public class SettingsNotificationsFragment extends BaseSettingsFragment{ private void showUnifiedPushRegisterDialog(List distributors){ new M3AlertDialogBuilder(getContext()).setTitle(R.string.sk_settings_unifiedpush_choose).setItems(distributors.toArray(String[]::new), - (dialog, which) ->{ + (dialog, which)->{ String userDistrib = distributors.get(which); UnifiedPush.saveDistributor(getContext(), userDistrib); UnifiedPush.registerApp( @@ -358,6 +359,6 @@ public class SettingsNotificationsFragment extends BaseSettingsFragment{ ); unifiedPushItem.toggle(); rebindItem(unifiedPushItem); - }).show(); + }).setOnCancelListener(d->rebindItem(unifiedPushItem)).show(); } } \ No newline at end of file diff --git a/mastodon/src/main/res/drawable/ic_fluent_alert_arrow_up_24_regular.xml b/mastodon/src/main/res/drawable/ic_fluent_alert_arrow_up_24_regular.xml index b6cca5760..e5fdceaf0 100644 --- a/mastodon/src/main/res/drawable/ic_fluent_alert_arrow_up_24_regular.xml +++ b/mastodon/src/main/res/drawable/ic_fluent_alert_arrow_up_24_regular.xml @@ -5,8 +5,8 @@ android:viewportHeight="24"> + android:fillColor="@color/fluent_default_icon_tint"/> + android:fillColor="@color/fluent_default_icon_tint"/>