enable emojiReactionsInTimelines by default
This commit is contained in:
parent
ea81c1fad6
commit
dd9237e9ca
|
@ -39,7 +39,7 @@ public class AccountLocalPreferences{
|
||||||
public boolean keepOnlyLatestNotification;
|
public boolean keepOnlyLatestNotification;
|
||||||
|
|
||||||
public boolean emojiReactionsEnabled;
|
public boolean emojiReactionsEnabled;
|
||||||
public boolean showEmojiReactionsInLists;
|
public boolean emojiReactionsInTimelines;
|
||||||
|
|
||||||
private final static Type recentLanguagesType = new TypeToken<ArrayList<String>>() {}.getType();
|
private final static Type recentLanguagesType = new TypeToken<ArrayList<String>>() {}.getType();
|
||||||
private final static Type timelinesType = new TypeToken<ArrayList<TimelineDefinition>>() {}.getType();
|
private final static Type timelinesType = new TypeToken<ArrayList<TimelineDefinition>>() {}.getType();
|
||||||
|
@ -66,7 +66,7 @@ public class AccountLocalPreferences{
|
||||||
timelineReplyVisibility=prefs.getString("timelineReplyVisibility", null);
|
timelineReplyVisibility=prefs.getString("timelineReplyVisibility", null);
|
||||||
keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false);
|
keepOnlyLatestNotification=prefs.getBoolean("keepOnlyLatestNotification", false);
|
||||||
emojiReactionsEnabled=prefs.getBoolean("emojiReactionsEnabled", session.getInstance().isPresent() && session.getInstance().get().isAkkoma());
|
emojiReactionsEnabled=prefs.getBoolean("emojiReactionsEnabled", session.getInstance().isPresent() && session.getInstance().get().isAkkoma());
|
||||||
showEmojiReactionsInLists=prefs.getBoolean("showEmojiReactionsInLists", false);
|
emojiReactionsInTimelines=prefs.getBoolean("emojiReactionsInTimelines", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getNotificationsPauseEndTime(){
|
public long getNotificationsPauseEndTime(){
|
||||||
|
@ -99,7 +99,7 @@ public class AccountLocalPreferences{
|
||||||
.putString("timelineReplyVisibility", timelineReplyVisibility)
|
.putString("timelineReplyVisibility", timelineReplyVisibility)
|
||||||
.putBoolean("keepOnlyLatestNotification", keepOnlyLatestNotification)
|
.putBoolean("keepOnlyLatestNotification", keepOnlyLatestNotification)
|
||||||
.putBoolean("emojiReactionsEnabled", emojiReactionsEnabled)
|
.putBoolean("emojiReactionsEnabled", emojiReactionsEnabled)
|
||||||
.putBoolean("showEmojiReactionsInLists", showEmojiReactionsInLists)
|
.putBoolean("emojiReactionsInTimelines", emojiReactionsInTimelines)
|
||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,8 +101,6 @@ public class NotificationsListFragment extends BaseStatusListFragment<Notificati
|
||||||
int flags=titleItem==null ? 0 : (StatusDisplayItem.FLAG_NO_FOOTER | StatusDisplayItem.FLAG_INSET | StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS); // | StatusDisplayItem.FLAG_NO_HEADER);
|
int flags=titleItem==null ? 0 : (StatusDisplayItem.FLAG_NO_FOOTER | StatusDisplayItem.FLAG_INSET | StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS); // | StatusDisplayItem.FLAG_NO_HEADER);
|
||||||
if (GlobalUserPreferences.spectatorMode)
|
if (GlobalUserPreferences.spectatorMode)
|
||||||
flags |= StatusDisplayItem.FLAG_NO_FOOTER;
|
flags |= StatusDisplayItem.FLAG_NO_FOOTER;
|
||||||
if (!getLocalPrefs().showEmojiReactionsInLists)
|
|
||||||
flags |= StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS;
|
|
||||||
ArrayList<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, n.status, accountID, n, knownAccounts, null, flags);
|
ArrayList<StatusDisplayItem> items=StatusDisplayItem.buildItems(this, n.status, accountID, n, knownAccounts, null, flags);
|
||||||
if(titleItem!=null)
|
if(titleItem!=null)
|
||||||
items.add(0, titleItem);
|
items.add(0, titleItem);
|
||||||
|
|
|
@ -38,7 +38,7 @@ public abstract class StatusListFragment extends BaseStatusListFragment<Status>
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
if (GlobalUserPreferences.spectatorMode)
|
if (GlobalUserPreferences.spectatorMode)
|
||||||
flags |= StatusDisplayItem.FLAG_NO_FOOTER;
|
flags |= StatusDisplayItem.FLAG_NO_FOOTER;
|
||||||
if (!getLocalPrefs().showEmojiReactionsInLists)
|
if (!getLocalPrefs().emojiReactionsInTimelines)
|
||||||
flags |= StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS;
|
flags |= StatusDisplayItem.FLAG_NO_EMOJI_REACTIONS;
|
||||||
return StatusDisplayItem.buildItems(this, s, accountID, s, knownAccounts, getFilterContext(), isMainThreadStatus ? 0 : flags);
|
return StatusDisplayItem.buildItems(this, s, accountID, s, knownAccounts, getFilterContext(), isMainThreadStatus ? 0 : flags);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ import java.util.List;
|
||||||
import me.grishka.appkit.Nav;
|
import me.grishka.appkit.Nav;
|
||||||
|
|
||||||
public class SettingsInstanceFragment extends BaseSettingsFragment<Void> implements HasAccountID{
|
public class SettingsInstanceFragment extends BaseSettingsFragment<Void> implements HasAccountID{
|
||||||
private CheckableListItem<Void> contentTypesItem, emojiReactionsItem, emojiReactionsInListsItem, localOnlyItem, glitchModeItem;
|
private CheckableListItem<Void> contentTypesItem, emojiReactionsItem, emojiReactionsInTimelinesItem, localOnlyItem, glitchModeItem;
|
||||||
private ListItem<Void> defaultContentTypeItem;
|
private ListItem<Void> defaultContentTypeItem;
|
||||||
private AccountLocalPreferences lp;
|
private AccountLocalPreferences lp;
|
||||||
|
|
||||||
|
@ -35,16 +35,16 @@ public class SettingsInstanceFragment extends BaseSettingsFragment<Void> 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_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),
|
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),
|
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),
|
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),
|
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))
|
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();
|
contentTypesItem.checkedChangeListener=checked->onContentTypeClick();
|
||||||
defaultContentTypeItem.isEnabled=contentTypesItem.checked;
|
defaultContentTypeItem.isEnabled=contentTypesItem.checked;
|
||||||
emojiReactionsItem.checkedChangeListener=checked->onEmojiReactionsClick();
|
emojiReactionsItem.checkedChangeListener=checked->onEmojiReactionsClick();
|
||||||
emojiReactionsInListsItem.isEnabled=emojiReactionsItem.checked;
|
emojiReactionsInTimelinesItem.isEnabled=emojiReactionsItem.checked;
|
||||||
localOnlyItem.checkedChangeListener=checked->onLocalOnlyClick();
|
localOnlyItem.checkedChangeListener=checked->onLocalOnlyClick();
|
||||||
glitchModeItem.isEnabled=localOnlyItem.checked;
|
glitchModeItem.isEnabled=localOnlyItem.checked;
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ public class SettingsInstanceFragment extends BaseSettingsFragment<Void> impleme
|
||||||
super.onHidden();
|
super.onHidden();
|
||||||
lp.contentTypesEnabled=contentTypesItem.checked;
|
lp.contentTypesEnabled=contentTypesItem.checked;
|
||||||
lp.emojiReactionsEnabled=emojiReactionsItem.checked;
|
lp.emojiReactionsEnabled=emojiReactionsItem.checked;
|
||||||
lp.showEmojiReactionsInLists=emojiReactionsInListsItem.checked;
|
lp.emojiReactionsInTimelines=emojiReactionsInTimelinesItem.checked;
|
||||||
lp.localOnlySupported=localOnlyItem.checked;
|
lp.localOnlySupported=localOnlyItem.checked;
|
||||||
lp.glitchInstance=glitchModeItem.checked;
|
lp.glitchInstance=glitchModeItem.checked;
|
||||||
lp.save();
|
lp.save();
|
||||||
|
@ -109,9 +109,8 @@ public class SettingsInstanceFragment extends BaseSettingsFragment<Void> impleme
|
||||||
|
|
||||||
private void onEmojiReactionsClick(){
|
private void onEmojiReactionsClick(){
|
||||||
toggleCheckableItem(emojiReactionsItem);
|
toggleCheckableItem(emojiReactionsItem);
|
||||||
emojiReactionsInListsItem.checked=false;
|
emojiReactionsInTimelinesItem.checked=emojiReactionsInTimelinesItem.isEnabled=emojiReactionsItem.checked;
|
||||||
emojiReactionsInListsItem.isEnabled=emojiReactionsItem.checked;
|
rebindItem(emojiReactionsInTimelinesItem);
|
||||||
rebindItem(emojiReactionsInListsItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onLocalOnlyClick(){
|
private void onLocalOnlyClick(){
|
||||||
|
|
|
@ -278,7 +278,7 @@ public abstract class StatusDisplayItem{
|
||||||
items.addAll(contentItems);
|
items.addAll(contentItems);
|
||||||
}
|
}
|
||||||
if((flags & FLAG_NO_EMOJI_REACTIONS)==0 && fragment.getLocalPrefs().emojiReactionsEnabled &&
|
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);
|
boolean isMainStatus=fragment instanceof ThreadFragment t && t.getMainStatus().id.equals(statusForContent.id);
|
||||||
items.add(new EmojiReactionsStatusDisplayItem(parentID, fragment, statusForContent, accountID, !isMainStatus, false));
|
items.add(new EmojiReactionsStatusDisplayItem(parentID, fragment, statusForContent, accountID, !isMainStatus, false));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue