diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 57236adfa..d94ecd64c 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -397,6 +397,8 @@ public class StatusAdapter extends RecyclerView.Adapter boolean displayCounters = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_COUNTER_FAV_BOOST), false); boolean removeLeftMargin = sharedpreferences.getBoolean(context.getString(R.string.SET_REMOVE_LEFT_MARGIN), false); boolean extraFeatures = sharedpreferences.getBoolean(context.getString(R.string.SET_EXTAND_EXTRA_FEATURES) + MainActivity.currentUserID + MainActivity.currentInstance, false); + boolean displayQuote = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_QUOTES) + MainActivity.currentUserID + MainActivity.currentInstance, true); + boolean displayReactions = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_REACTIONS) + MainActivity.currentUserID + MainActivity.currentInstance, true); if (removeLeftMargin) { LinearLayoutCompat.MarginLayoutParams p = (LinearLayoutCompat.MarginLayoutParams) holder.binding.spoiler.getLayoutParams(); @@ -609,9 +611,20 @@ public class StatusAdapter extends RecyclerView.Adapter int truncate_toots_size = sharedpreferences.getInt(context.getString(R.string.SET_TRUNCATE_TOOTS_SIZE), 0); if (extraFeatures) { - holder.binding.statusAddCustomEmoji.setVisibility(View.VISIBLE); - holder.binding.statusEmoji.setVisibility(View.VISIBLE); - holder.binding.actionButtonQuote.setVisibility(View.VISIBLE); + if (displayQuote) { + holder.binding.actionButtonQuote.setVisibility(View.VISIBLE); + } else { + holder.binding.actionButtonQuote.setVisibility(View.GONE); + } + if (displayReactions) { + holder.binding.statusAddCustomEmoji.setVisibility(View.VISIBLE); + holder.binding.statusEmoji.setVisibility(View.VISIBLE); + } else { + holder.binding.statusAddCustomEmoji.setVisibility(View.GONE); + holder.binding.statusEmoji.setVisibility(View.GONE); + } + + } holder.binding.actionButtonFavorite.pressOnTouch(false); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java index a0af3556e..985faf95e 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/settings/FragmentExtraFeaturesSettings.java @@ -58,6 +58,18 @@ public class FragmentExtraFeaturesSettings extends PreferenceFragmentCompat impl SET_DISPLAY_TRANSLATE.setChecked(checked); } + SwitchPreferenceCompat SET_DISPLAY_QUOTES = findPreference(getString(R.string.SET_DISPLAY_QUOTES)); + if (SET_DISPLAY_QUOTES != null) { + boolean checked = sharedpreferences.getBoolean(getString(R.string.SET_DISPLAY_QUOTES) + MainActivity.currentUserID + MainActivity.currentInstance, true); + SET_DISPLAY_QUOTES.setChecked(checked); + } + + SwitchPreferenceCompat SET_DISPLAY_REACTIONS = findPreference(getString(R.string.SET_DISPLAY_REACTIONS)); + if (SET_DISPLAY_REACTIONS != null) { + boolean checked = sharedpreferences.getBoolean(getString(R.string.SET_DISPLAY_REACTIONS) + MainActivity.currentUserID + MainActivity.currentInstance, true); + SET_DISPLAY_REACTIONS.setChecked(checked); + } + ListPreference SET_POST_FORMAT = findPreference(getString(R.string.SET_POST_FORMAT)); if (SET_POST_FORMAT != null) { SET_POST_FORMAT.getContext().setTheme(Helper.dialogStyle()); @@ -89,6 +101,18 @@ public class FragmentExtraFeaturesSettings extends PreferenceFragmentCompat impl editor.putBoolean(getString(R.string.SET_DISPLAY_TRANSLATE) + MainActivity.currentUserID + MainActivity.currentInstance, SET_DISPLAY_TRANSLATE.isChecked()); } } + if (key.compareToIgnoreCase(getString(R.string.SET_DISPLAY_QUOTES)) == 0) { + SwitchPreferenceCompat SET_DISPLAY_QUOTES = findPreference(getString(R.string.SET_DISPLAY_QUOTES)); + if (SET_DISPLAY_QUOTES != null) { + editor.putBoolean(getString(R.string.SET_DISPLAY_QUOTES) + MainActivity.currentUserID + MainActivity.currentInstance, SET_DISPLAY_QUOTES.isChecked()); + } + } + if (key.compareToIgnoreCase(getString(R.string.SET_DISPLAY_REACTIONS)) == 0) { + SwitchPreferenceCompat SET_DISPLAY_REACTIONS = findPreference(getString(R.string.SET_DISPLAY_REACTIONS)); + if (SET_DISPLAY_REACTIONS != null) { + editor.putBoolean(getString(R.string.SET_DISPLAY_REACTIONS) + MainActivity.currentUserID + MainActivity.currentInstance, SET_DISPLAY_REACTIONS.isChecked()); + } + } if (key.compareToIgnoreCase(getString(R.string.SET_POST_FORMAT)) == 0) { ListPreference SET_POST_FORMAT = findPreference(getString(R.string.SET_POST_FORMAT)); if (SET_POST_FORMAT != null) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0e9741ef3..9e929584c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1428,6 +1428,9 @@ SET_FILTER_REGEX_PUBLIC SET_NOTIF_VALIDATION SET_DISPLAY_BOOKMARK + SET_DISPLAY_QUOTES + SET_DISPLAY_REACTIONS + SET_DISPLAY_TRANSLATE SET_POST_FORMAT @@ -2167,4 +2170,8 @@ You can safely hide these icons at the bottom to have more space. They are also in the submenu. Post format Post format + Icons for extra features + If your instance does not accept some extra features, you can hide these icons + Display the \"Quote\" button + Display \"Reactions\" buttons \ No newline at end of file diff --git a/app/src/main/res/xml/pref_extra_features.xml b/app/src/main/res/xml/pref_extra_features.xml index 3a1b6f025..91d0a2637 100644 --- a/app/src/main/res/xml/pref_extra_features.xml +++ b/app/src/main/res/xml/pref_extra_features.xml @@ -28,6 +28,27 @@ app:title="@string/set_display_translate_indication" /> + + + + + +