fix #29 - Allow to display bookmark button on each toot

This commit is contained in:
Thomas 2022-05-06 07:39:22 +02:00
parent cf9ecb9adf
commit 9d11ccc382
3 changed files with 10 additions and 1 deletions

View File

@ -173,6 +173,8 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
boolean confirmFav = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION_FAV), false); boolean confirmFav = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION_FAV), false);
boolean confirmBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION), true); boolean confirmBoost = sharedpreferences.getBoolean(context.getString(R.string.SET_NOTIF_VALIDATION), true);
boolean fullAttachement = sharedpreferences.getBoolean(context.getString(R.string.SET_FULL_PREVIEW), false); boolean fullAttachement = sharedpreferences.getBoolean(context.getString(R.string.SET_FULL_PREVIEW), false);
boolean displayBookmark = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_BOOKMARK), false);
int truncate_toots_size = sharedpreferences.getInt(context.getString(R.string.SET_TRUNCATE_TOOTS_SIZE), 0); int truncate_toots_size = sharedpreferences.getInt(context.getString(R.string.SET_TRUNCATE_TOOTS_SIZE), 0);
boolean display_video_preview = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_VIDEO_PREVIEWS), true); boolean display_video_preview = sharedpreferences.getBoolean(context.getString(R.string.SET_DISPLAY_VIDEO_PREVIEWS), true);
boolean isModerator = sharedpreferences.getBoolean(Helper.PREF_IS_MODERATOR, false); boolean isModerator = sharedpreferences.getBoolean(Helper.PREF_IS_MODERATOR, false);
@ -316,7 +318,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
} else { } else {
holder.binding.actionButtons.setVisibility(View.VISIBLE); holder.binding.actionButtons.setVisibility(View.VISIBLE);
//Hide or display bookmark button when status is focused //Hide or display bookmark button when status is focused
if (status.isFocused) { if (status.isFocused || displayBookmark) {
holder.binding.actionButtonBookmark.setVisibility(View.VISIBLE); holder.binding.actionButtonBookmark.setVisibility(View.VISIBLE);
} else { } else {
holder.binding.actionButtonBookmark.setVisibility(View.GONE); holder.binding.actionButtonBookmark.setVisibility(View.GONE);

View File

@ -1507,6 +1507,7 @@
<string name="SET_FILTER_REGEX_LOCAL" translatable="false">SET_FILTER_REGEX_LOCAL</string> <string name="SET_FILTER_REGEX_LOCAL" translatable="false">SET_FILTER_REGEX_LOCAL</string>
<string name="SET_FILTER_REGEX_PUBLIC" translatable="false">SET_FILTER_REGEX_PUBLIC</string> <string name="SET_FILTER_REGEX_PUBLIC" translatable="false">SET_FILTER_REGEX_PUBLIC</string>
<string name="SET_NOTIF_VALIDATION" translatable="false">SET_NOTIF_VALIDATION</string> <string name="SET_NOTIF_VALIDATION" translatable="false">SET_NOTIF_VALIDATION</string>
<string name="SET_DISPLAY_BOOKMARK" translatable="false">SET_DISPLAY_BOOKMARK</string>
<string name="SET_NOTIF_VALIDATION_FAV" translatable="false">SET_NOTIF_VALIDATION_FAV</string> <string name="SET_NOTIF_VALIDATION_FAV" translatable="false">SET_NOTIF_VALIDATION_FAV</string>
<string name="SET_WIFI_ONLY" translatable="false">SET_WIFI_ONLY</string> <string name="SET_WIFI_ONLY" translatable="false">SET_WIFI_ONLY</string>
<string name="SET_NOTIF_SILENT" translatable="false">SET_NOTIF_SILENT</string> <string name="SET_NOTIF_SILENT" translatable="false">SET_NOTIF_SILENT</string>
@ -1590,6 +1591,7 @@
<string name="message_has_been_sent">Message has been sent!</string> <string name="message_has_been_sent">Message has been sent!</string>
<string name="poll_type">Poll type:</string> <string name="poll_type">Poll type:</string>
<string name="poll_duration">Poll duration:</string> <string name="poll_duration">Poll duration:</string>
<string name="set_display_bookmark_indication">Always display bookmark button</string>
</resources> </resources>

View File

@ -16,6 +16,11 @@
android:defaultValue="true" android:defaultValue="true"
app:key="@string/SET_NOTIF_VALIDATION" app:key="@string/SET_NOTIF_VALIDATION"
app:title="@string/set_share_validation" /> app:title="@string/set_share_validation" />
<androidx.preference.SwitchPreference
android:defaultValue="false"
app:iconSpaceReserved="false"
app:key="@string/SET_DISPLAY_BOOKMARK"
app:title="@string/set_display_bookmark_indication" />
<androidx.preference.SwitchPreference <androidx.preference.SwitchPreference
app:iconSpaceReserved="false" app:iconSpaceReserved="false"
android:defaultValue="false" android:defaultValue="false"