diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java index aaaa578e6..facaec09a 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/drawers/StatusListAdapter.java @@ -366,7 +366,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct LinearLayout status_peertube_container; TextView status_peertube_reply, status_peertube_delete, show_more_content; - ImageView cached_status; + ImageView cached_status, status_account_bot; //Poll LinearLayout poll_container, single_choice, multiple_choice, rated; @@ -474,6 +474,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct submit_vote = itemView.findViewById(R.id.submit_vote); refresh_poll = itemView.findViewById(R.id.refresh_poll); cached_status = itemView.findViewById(R.id.cached_status); + status_account_bot = itemView.findViewById(R.id.status_account_bot); } } @@ -539,6 +540,20 @@ 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); boolean isCompactMode = sharedpreferences.getBoolean(Helper.SET_COMPACT_MODE, false); diff --git a/app/src/main/res/drawable/ic_bot.xml b/app/src/main/res/drawable/ic_bot.xml new file mode 100644 index 000000000..16419d19d --- /dev/null +++ b/app/src/main/res/drawable/ic_bot.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/drawer_status.xml b/app/src/main/res/layout/drawer_status.xml index 312f11ad6..0a78a86e4 100644 --- a/app/src/main/res/layout/drawer_status.xml +++ b/app/src/main/res/layout/drawer_status.xml @@ -38,6 +38,16 @@ android:layout_height="wrap_content" android:layout_width="match_parent" > + + + +