fix: readds bot icon to timelines

This was accidentally removed during the great merge, but its back again
This commit is contained in:
LucasGGamerM 2023-09-02 21:02:11 -03:00
parent ce51fc3c0d
commit 677fb4e4da
2 changed files with 15 additions and 4 deletions

View File

@ -134,13 +134,11 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
public static class Holder extends StatusDisplayItem.Holder<HeaderStatusDisplayItem> implements ImageLoaderViewHolder{
private final TextView name, time, username, extraText, pronouns;
private final View collapseBtn, timeUsernameSeparator;
private final ImageView avatar, more, visibility, deleteNotification, unreadIndicator, markAsRead, collapseBtnIcon;
private final ImageView avatar, more, visibility, deleteNotification, unreadIndicator, markAsRead, collapseBtnIcon, botIcon;
private final PopupMenu optionsMenu;
private Relationship relationship;
private APIRequest<?> currentRelationshipRequest;
//TODO: readd
public Holder(Activity activity, ViewGroup parent){
this(activity, R.layout.display_item_header, parent);
}
@ -159,7 +157,7 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
markAsRead=findViewById(R.id.mark_as_read);
collapseBtn=findViewById(R.id.collapse_btn);
collapseBtnIcon=findViewById(R.id.collapse_btn_icon);
// botIcon=findViewById(R.id.bot_icon);
botIcon=findViewById(R.id.bot_icon);
extraText=findViewById(R.id.extra_text);
pronouns=findViewById(R.id.pronouns);
avatar.setOnClickListener(this::onAvaClick);
@ -325,6 +323,9 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{
this.time.setVisibility(time==null ? View.GONE : View.VISIBLE);
if(time!=null) this.time.setText(time);
botIcon.setVisibility(item.user.bot ? View.VISIBLE : View.GONE);
botIcon.setColorFilter(username.getCurrentTextColor());
deleteNotification.setVisibility(GlobalUserPreferences.enableDeleteNotifications && item.notification!=null && !item.inset ? View.VISIBLE : View.GONE);
if (item.hasVisibilityToggle){
boolean hidden = !item.status.sensitiveRevealed || (item.status.hasSpoiler() && !item.status.spoilerRevealed);

View File

@ -173,6 +173,16 @@
android:textColor="?colorM3OnSurfaceVariant"
tools:text="\@Gargron@mastodon.social"/>
<ImageView
android:id="@+id/bot_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:importantForAccessibility="no"
android:contentDescription="@string/sk_icon_bot"
android:layout_marginTop="2dp"
android:src="@drawable/ic_fluent_bot_16_filled" />
<TextView
android:id="@+id/separator"
android:layout_width="wrap_content"