diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountLocalPreferences.java b/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountLocalPreferences.java index 4589ec4ed..6b41c41f3 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountLocalPreferences.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountLocalPreferences.java @@ -39,7 +39,7 @@ public class AccountLocalPreferences{ public boolean keepOnlyLatestNotification; public boolean emojiReactionsEnabled; - public boolean showEmojiReactionsInLists; + public boolean emojiReactionsInTimelines; private final static Type recentLanguagesType = new TypeToken>() {}.getType(); private final static Type timelinesType = new TypeToken>() {}.getType(); @@ -66,7 +66,7 @@ public class AccountLocalPreferences{ timelineReplyVisibility=prefs.getString("timelineReplyVisibility", null); keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false); emojiReactionsEnabled=prefs.getBoolean("emojiReactionsEnabled", session.getInstance().isPresent() && session.getInstance().get().isAkkoma()); - showEmojiReactionsInLists=prefs.getBoolean("showEmojiReactionsInLists", false); + emojiReactionsInTimelines=prefs.getBoolean("emojiReactionsInTimelines", true); } public long getNotificationsPauseEndTime(){ @@ -99,7 +99,7 @@ public class AccountLocalPreferences{ .putString("timelineReplyVisibility", timelineReplyVisibility) .putBoolean("keepOnlyLatestNotification", keepOnlyLatestNotification) .putBoolean("emojiReactionsEnabled", emojiReactionsEnabled) - .putBoolean("showEmojiReactionsInLists", showEmojiReactionsInLists) + .putBoolean("emojiReactionsInTimelines", emojiReactionsInTimelines) .apply(); } } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java index 35e76ac72..23f61edd0 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java @@ -101,8 +101,6 @@ public class NotificationsListFragment extends BaseStatusListFragment items=StatusDisplayItem.buildItems(this, n.status, accountID, n, knownAccounts, null, flags); if(titleItem!=null) items.add(0, titleItem); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java index 701b8959e..47b299819 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java @@ -38,7 +38,7 @@ public abstract class StatusListFragment extends BaseStatusListFragment int flags = 0; if (GlobalUserPreferences.spectatorMode) flags |= StatusDisplayItem.FLAG_NO_FOOTER; - if (!getLocalPrefs().showEmojiReactionsInLists) + if (!getLocalPrefs().emojiReactionsInTimelines) flags |= StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS; return StatusDisplayItem.buildItems(this, s, accountID, s, knownAccounts, getFilterContext(), isMainThreadStatus ? 0 : flags); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsInstanceFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsInstanceFragment.java index 6d6bdd5d2..e7b28d398 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsInstanceFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/settings/SettingsInstanceFragment.java @@ -19,7 +19,7 @@ import java.util.List; import me.grishka.appkit.Nav; public class SettingsInstanceFragment extends BaseSettingsFragment implements HasAccountID{ - private CheckableListItem contentTypesItem, emojiReactionsItem, emojiReactionsInListsItem, localOnlyItem, glitchModeItem; + private CheckableListItem contentTypesItem, emojiReactionsItem, emojiReactionsInTimelinesItem, localOnlyItem, glitchModeItem; private ListItem defaultContentTypeItem; private AccountLocalPreferences lp; @@ -35,16 +35,16 @@ public class SettingsInstanceFragment extends BaseSettingsFragment impleme new ListItem<>(R.string.sk_settings_posting, 0, R.drawable.ic_fluent_open_24_regular, ()->UiUtils.launchWebBrowser(getActivity(), "https://"+s.domain+"/settings/preferences/other")), new ListItem<>(R.string.sk_settings_auth, 0, R.drawable.ic_fluent_open_24_regular, ()->UiUtils.launchWebBrowser(getActivity(), "https://"+s.domain+"/auth/edit"), 0, true), contentTypesItem=new CheckableListItem<>(R.string.sk_settings_content_types, R.string.sk_settings_content_types_explanation, CheckableListItem.Style.SWITCH, lp.contentTypesEnabled, R.drawable.ic_fluent_text_edit_style_24_regular, this::onContentTypeClick), - defaultContentTypeItem=new ListItem<>(R.string.sk_settings_default_content_type, lp.defaultContentType.getName(), R.drawable.ic_fluent_text_bold_24_regular, this::onDefaultContentTypeClick), + defaultContentTypeItem=new ListItem<>(R.string.sk_settings_default_content_type, lp.defaultContentType.getName(), R.drawable.ic_fluent_text_bold_24_regular, this::onDefaultContentTypeClick, 0, true), emojiReactionsItem=new CheckableListItem<>(R.string.sk_settings_emoji_reactions, R.string.sk_settings_emoji_reactions_explanation, CheckableListItem.Style.SWITCH, lp.emojiReactionsEnabled, R.drawable.ic_fluent_emoji_laugh_24_regular, this::onEmojiReactionsClick), - emojiReactionsInListsItem=new CheckableListItem<>(R.string.sk_settings_emoji_reactions_in_lists, R.string.sk_settings_emoji_reactions_in_lists_explanation, CheckableListItem.Style.SWITCH, lp.showEmojiReactionsInLists, R.drawable.ic_fluent_emoji_24_regular, ()->toggleCheckableItem(emojiReactionsInListsItem)), + emojiReactionsInTimelinesItem=new CheckableListItem<>(R.string.sk_settings_emoji_reactions_in_lists, R.string.sk_settings_emoji_reactions_in_lists_explanation, CheckableListItem.Style.SWITCH, lp.emojiReactionsInTimelines, R.drawable.ic_fluent_emoji_24_regular, ()->toggleCheckableItem(emojiReactionsInTimelinesItem), true), localOnlyItem=new CheckableListItem<>(R.string.sk_settings_support_local_only, R.string.sk_settings_local_only_explanation, CheckableListItem.Style.SWITCH, lp.localOnlySupported, R.drawable.ic_fluent_eye_24_regular, this::onLocalOnlyClick), glitchModeItem=new CheckableListItem<>(R.string.sk_settings_glitch_instance, R.string.sk_settings_glitch_mode_explanation, CheckableListItem.Style.SWITCH, lp.glitchInstance, R.drawable.ic_fluent_eye_24_filled, ()->toggleCheckableItem(glitchModeItem)) )); contentTypesItem.checkedChangeListener=checked->onContentTypeClick(); defaultContentTypeItem.isEnabled=contentTypesItem.checked; emojiReactionsItem.checkedChangeListener=checked->onEmojiReactionsClick(); - emojiReactionsInListsItem.isEnabled=emojiReactionsItem.checked; + emojiReactionsInTimelinesItem.isEnabled=emojiReactionsItem.checked; localOnlyItem.checkedChangeListener=checked->onLocalOnlyClick(); glitchModeItem.isEnabled=localOnlyItem.checked; } @@ -57,7 +57,7 @@ public class SettingsInstanceFragment extends BaseSettingsFragment impleme super.onHidden(); lp.contentTypesEnabled=contentTypesItem.checked; lp.emojiReactionsEnabled=emojiReactionsItem.checked; - lp.showEmojiReactionsInLists=emojiReactionsInListsItem.checked; + lp.emojiReactionsInTimelines=emojiReactionsInTimelinesItem.checked; lp.localOnlySupported=localOnlyItem.checked; lp.glitchInstance=glitchModeItem.checked; lp.save(); @@ -109,9 +109,8 @@ public class SettingsInstanceFragment extends BaseSettingsFragment impleme private void onEmojiReactionsClick(){ toggleCheckableItem(emojiReactionsItem); - emojiReactionsInListsItem.checked=false; - emojiReactionsInListsItem.isEnabled=emojiReactionsItem.checked; - rebindItem(emojiReactionsInListsItem); + emojiReactionsInTimelinesItem.checked=emojiReactionsInTimelinesItem.isEnabled=emojiReactionsItem.checked; + rebindItem(emojiReactionsInTimelinesItem); } private void onLocalOnlyClick(){ diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java index 6cb969954..2e81f0735 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java @@ -278,7 +278,7 @@ public abstract class StatusDisplayItem{ items.addAll(contentItems); } if((flags & FLAG_NO_EMOJI_REACTIONS)==0 && fragment.getLocalPrefs().emojiReactionsEnabled && - (fragment.getLocalPrefs().showEmojiReactionsInLists || fragment instanceof ThreadFragment)){ + (fragment.getLocalPrefs().emojiReactionsInTimelines || fragment instanceof ThreadFragment)){ boolean isMainStatus=fragment instanceof ThreadFragment t && t.getMainStatus().id.equals(statusForContent.id); items.add(new EmojiReactionsStatusDisplayItem(parentID, fragment, statusForContent, accountID, !isMainStatus, false)); }