feat(search): add back bot indicator to account search results preview
This commit is contained in:
@@ -56,7 +56,7 @@ import me.grishka.appkit.views.UsableRecyclerView;
|
|||||||
|
|
||||||
public class AccountViewHolder extends BindableViewHolder<AccountViewModel> implements ImageLoaderViewHolder, UsableRecyclerView.Clickable, UsableRecyclerView.LongClickable{
|
public class AccountViewHolder extends BindableViewHolder<AccountViewModel> implements ImageLoaderViewHolder, UsableRecyclerView.Clickable, UsableRecyclerView.LongClickable{
|
||||||
private final TextView name, username, followers, pronouns, bio;
|
private final TextView name, username, followers, pronouns, bio;
|
||||||
public final ImageView avatar;
|
public final ImageView avatar, botIcon;
|
||||||
private final FrameLayout accessory;
|
private final FrameLayout accessory;
|
||||||
private final ProgressBarButton button;
|
private final ProgressBarButton button;
|
||||||
private final PopupMenu contextMenu;
|
private final PopupMenu contextMenu;
|
||||||
@@ -92,6 +92,7 @@ public class AccountViewHolder extends BindableViewHolder<AccountViewModel> impl
|
|||||||
name=findViewById(R.id.name);
|
name=findViewById(R.id.name);
|
||||||
username=findViewById(R.id.username);
|
username=findViewById(R.id.username);
|
||||||
avatar=findViewById(R.id.avatar);
|
avatar=findViewById(R.id.avatar);
|
||||||
|
botIcon=findViewById(R.id.bot_icon);
|
||||||
accessory=findViewById(R.id.accessory);
|
accessory=findViewById(R.id.accessory);
|
||||||
button=findViewById(R.id.button);
|
button=findViewById(R.id.button);
|
||||||
menuAnchor=findViewById(R.id.menu_anchor);
|
menuAnchor=findViewById(R.id.menu_anchor);
|
||||||
@@ -147,6 +148,10 @@ public class AccountViewHolder extends BindableViewHolder<AccountViewModel> impl
|
|||||||
pronouns.setVisibility(pronounsString.isPresent() ? View.VISIBLE : View.GONE);
|
pronouns.setVisibility(pronounsString.isPresent() ? View.VISIBLE : View.GONE);
|
||||||
pronounsString.ifPresent(p -> HtmlParser.setTextWithCustomEmoji(pronouns, p, item.account.emojis));
|
pronounsString.ifPresent(p -> HtmlParser.setTextWithCustomEmoji(pronouns, p, item.account.emojis));
|
||||||
|
|
||||||
|
if(item.account.bot) {
|
||||||
|
botIcon.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
/* unused in megalodon
|
/* unused in megalodon
|
||||||
boolean hasVerifiedLink=item.verifiedLink!=null;
|
boolean hasVerifiedLink=item.verifiedLink!=null;
|
||||||
if(!hasVerifiedLink)
|
if(!hasVerifiedLink)
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
android:importantForAccessibility="no"
|
android:importantForAccessibility="no"
|
||||||
tools:src="#0f0"/>
|
tools:src="#0f0"/>
|
||||||
|
|
||||||
<LinearLayout
|
<org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout
|
||||||
android:id="@+id/line1"
|
android:id="@+id/line1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/username"
|
android:id="@+id/username"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="4dp"
|
android:layout_marginStart="4dp"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
@@ -50,7 +50,19 @@
|
|||||||
android:textAlignment="viewStart"
|
android:textAlignment="viewStart"
|
||||||
tools:text="\@user@server"/>
|
tools:text="\@user@server"/>
|
||||||
|
|
||||||
</LinearLayout>
|
<ImageView
|
||||||
|
android:id="@+id/bot_icon"
|
||||||
|
android:layout_width="18sp"
|
||||||
|
android:layout_height="18sp"
|
||||||
|
android:layout_marginEnd="4dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:importantForAccessibility="no"
|
||||||
|
android:contentDescription="@string/sk_icon_bot"
|
||||||
|
android:tint="?colorM3Secondary"
|
||||||
|
android:src="@drawable/ic_fluent_bot_16_filled" />
|
||||||
|
|
||||||
|
</org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/line2"
|
android:id="@+id/line2"
|
||||||
@@ -84,6 +96,7 @@
|
|||||||
android:textAppearance="@style/m3_body_medium"
|
android:textAppearance="@style/m3_body_medium"
|
||||||
android:textColor="?colorM3Secondary"
|
android:textColor="?colorM3Secondary"
|
||||||
tools:text="123 followers"/>
|
tools:text="123 followers"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user