diff --git a/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Account.java b/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Account.java index 5fc2e8d7..8d4cad29 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Account.java +++ b/app/src/main/java/app/fedilab/android/mastodon/client/entities/api/Account.java @@ -88,6 +88,7 @@ public class Account implements Serializable { @SerializedName("role") public Role role; public transient RelationShip relationShip; + public transient String pronouns = null; public synchronized Spannable getSpanDisplayName(Context context, WeakReference viewWeakReference) { diff --git a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountsSearchAdapter.java b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountsSearchAdapter.java index d75f4faa..a6c09c5e 100644 --- a/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountsSearchAdapter.java +++ b/app/src/main/java/app/fedilab/android/mastodon/ui/drawer/AccountsSearchAdapter.java @@ -30,6 +30,7 @@ import java.util.List; import app.fedilab.android.databinding.DrawerAccountSearchBinding; import app.fedilab.android.mastodon.client.entities.api.Account; +import app.fedilab.android.mastodon.client.entities.api.Field; import app.fedilab.android.mastodon.helper.MastodonHelper; @@ -116,6 +117,19 @@ public class AccountsSearchAdapter extends ArrayAdapter implements Filt holder.binding.accountUn.setText(String.format("@%s", account.acct)); holder.binding.accountDn.setText(account.display_name); holder.binding.accountDn.setVisibility(View.VISIBLE); + account.pronouns = null; + for(Field field: account.fields) { + if(field.name.trim().equalsIgnoreCase("pronouns")) { + account.pronouns = field.value; + break; + } + } + if(account.pronouns != null) { + holder.binding.pronouns.setText(account.pronouns); + holder.binding.pronouns.setVisibility(View.VISIBLE); + } else { + holder.binding.pronouns.setVisibility(View.GONE); + } MastodonHelper.loadPPMastodon(holder.binding.accountPp, account); return holder.view; } diff --git a/app/src/main/res/layouts/mastodon/layout/drawer_account_search.xml b/app/src/main/res/layouts/mastodon/layout/drawer_account_search.xml index c4695cce..102b5b0d 100644 --- a/app/src/main/res/layouts/mastodon/layout/drawer_account_search.xml +++ b/app/src/main/res/layouts/mastodon/layout/drawer_account_search.xml @@ -15,6 +15,7 @@ see --> + +