diff --git a/app/src/main/java/app/fedilab/android/drawers/StatusListAdapter.java b/app/src/main/java/app/fedilab/android/drawers/StatusListAdapter.java index d784f1b9e..e9870a4a4 100644 --- a/app/src/main/java/app/fedilab/android/drawers/StatusListAdapter.java +++ b/app/src/main/java/app/fedilab/android/drawers/StatusListAdapter.java @@ -538,19 +538,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct } status.setItemViewType(viewHolder.getItemViewType()); - if( status.getReblog() == null){ - if( status.getAccount().isBot()){ - holder.status_account_bot.setVisibility(View.VISIBLE); - }else { - holder.status_account_bot.setVisibility(View.GONE); - } - }else{ - if( status.getReblog().getAccount().isBot()){ - holder.status_account_bot.setVisibility(View.VISIBLE); - }else { - holder.status_account_bot.setVisibility(View.GONE); - } - } boolean displayBookmarkButton = sharedpreferences.getBoolean(Helper.SET_SHOW_BOOKMARK, false); boolean fullAttachement = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false); @@ -573,8 +560,26 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct boolean isModerator = sharedpreferences.getBoolean(Helper.PREF_IS_MODERATOR, false); boolean isAdmin = sharedpreferences.getBoolean(Helper.PREF_IS_ADMINISTRATOR, false); + boolean new_badge = sharedpreferences.getBoolean(Helper.SET_DISPLAY_NEW_BADGE, true); + boolean bot_icon = sharedpreferences.getBoolean(Helper.SET_DISPLAY_BOT_ICON, true); + int translator = sharedpreferences.getInt(Helper.SET_TRANSLATOR, Helper.TRANS_YANDEX); int behaviorWithAttachments = sharedpreferences.getInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ALWAYS); + + if (status.getReblog() == null) { + if (bot_icon && status.getAccount().isBot()) { + holder.status_account_bot.setVisibility(View.VISIBLE); + } else { + holder.status_account_bot.setVisibility(View.GONE); + } + } else { + if (bot_icon && status.getReblog().getAccount().isBot()) { + holder.status_account_bot.setVisibility(View.VISIBLE); + } else { + holder.status_account_bot.setVisibility(View.GONE); + } + } + if (type != RetrieveFeedsAsyncTask.Type.REMOTE_INSTANCE && !isCompactMode && !isConsoleMode && displayBookmarkButton) holder.status_bookmark.setVisibility(View.VISIBLE); else @@ -781,7 +786,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct }); } - boolean new_badge = sharedpreferences.getBoolean(Helper.SET_DISPLAY_NEW_BADGE, true); + if (status.isNew() && new_badge) holder.new_element.setVisibility(View.VISIBLE); else diff --git a/app/src/main/java/app/fedilab/android/fragments/SettingsFragment.java b/app/src/main/java/app/fedilab/android/fragments/SettingsFragment.java index 8334eba48..3277466cc 100644 --- a/app/src/main/java/app/fedilab/android/fragments/SettingsFragment.java +++ b/app/src/main/java/app/fedilab/android/fragments/SettingsFragment.java @@ -591,6 +591,19 @@ public class SettingsFragment extends Fragment { } }); + boolean bot_icon = sharedpreferences.getBoolean(Helper.SET_DISPLAY_BOT_ICON, true); + final CheckBox set_bot_icon = rootView.findViewById(R.id.set_display_bot_icon); + set_bot_icon.setChecked(bot_icon); + + set_bot_icon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + SharedPreferences.Editor editor = sharedpreferences.edit(); + editor.putBoolean(Helper.SET_DISPLAY_BOT_ICON, set_bot_icon.isChecked()); + editor.apply(); + } + }); + boolean fit_preview = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false); final CheckBox set_fit_preview = rootView.findViewById(R.id.set_fit_preview); set_fit_preview.setChecked(fit_preview); diff --git a/app/src/main/java/app/fedilab/android/helper/Helper.java b/app/src/main/java/app/fedilab/android/helper/Helper.java index 85fc03034..e333e68a0 100644 --- a/app/src/main/java/app/fedilab/android/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/helper/Helper.java @@ -385,6 +385,7 @@ public class Helper { public static final String SET_EXPAND_MEDIA = "set_expand_media"; public static final String SET_DISPLAY_FOLLOW_INSTANCE = "set_display_follow_instance"; public static final String SET_DISPLAY_NEW_BADGE = "set_display_new_badge"; + public static final String SET_DISPLAY_BOT_ICON = "set_display_bot_icon"; public static final String SET_EMBEDDED_BROWSER = "set_embedded_browser"; public static final String SET_CUSTOM_TABS = "set_custom_tabs"; public static final String SET_JAVASCRIPT = "set_javascript"; diff --git a/app/src/main/res/layout-sw600dp/fragment_settings.xml b/app/src/main/res/layout-sw600dp/fragment_settings.xml index b604630cb..6b5fe4c6b 100644 --- a/app/src/main/res/layout-sw600dp/fragment_settings.xml +++ b/app/src/main/res/layout-sw600dp/fragment_settings.xml @@ -251,6 +251,15 @@ android:text="@string/set_display_bookmark_button" android:layout_height="wrap_content" /> + + + + + + Blur sensitive media Display timelines in a list Display timelines + Mark bot accounts in toots %d vote