From 6e5fa34be67f7b6ecb784aa448a6155db3970e81 Mon Sep 17 00:00:00 2001 From: FineFindus <63370021+FineFindus@users.noreply.github.com> Date: Fri, 17 Mar 2023 20:36:18 +0100 Subject: [PATCH] feat(external-share): start re-design --- .../android/ui/AccountSwitcherSheet.java | 6 ++- .../main/res/layout/item_account_switcher.xml | 49 ++++++++++++++----- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/AccountSwitcherSheet.java b/mastodon/src/main/java/org/joinmastodon/android/ui/AccountSwitcherSheet.java index d866519c3..64a4f6e21 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/AccountSwitcherSheet.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/AccountSwitcherSheet.java @@ -8,6 +8,7 @@ import android.graphics.drawable.Animatable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Build; +import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.view.WindowInsets; @@ -80,7 +81,7 @@ public class AccountSwitcherSheet extends BottomSheet{ AccountViewHolder holder = new AccountViewHolder(); holder.more.setVisibility(View.GONE); holder.currentIcon.setVisibility(View.GONE); - holder.name.setText(R.string.add_account); + holder.display_name.setText(R.string.add_account); holder.avatar.setScaleType(ImageView.ScaleType.CENTER); holder.avatar.setImageResource(R.drawable.ic_fluent_add_circle_24_filled); holder.avatar.setImageTintList(ColorStateList.valueOf(UiUtils.getThemeColor(activity, android.R.attr.textColorPrimary))); @@ -184,6 +185,7 @@ public class AccountSwitcherSheet extends BottomSheet{ private class AccountViewHolder extends BindableViewHolder implements ImageLoaderViewHolder, UsableRecyclerView.Clickable{ private final TextView name; + private final TextView display_name; private final ImageView avatar; private final ImageButton more; private final View currentIcon; @@ -192,6 +194,7 @@ public class AccountSwitcherSheet extends BottomSheet{ public AccountViewHolder(){ super(activity, R.layout.item_account_switcher, list); name=findViewById(R.id.name); + display_name=findViewById(R.id.display_name); avatar=findViewById(R.id.avatar); more=findViewById(R.id.more); currentIcon=findViewById(R.id.current); @@ -211,6 +214,7 @@ public class AccountSwitcherSheet extends BottomSheet{ @SuppressLint("SetTextI18n") @Override public void onBind(AccountSession item){ + display_name.setText(item.self.displayName); name.setText("@"+item.self.username+"@"+item.domain); if(AccountSessionManager.getInstance().getLastActiveAccountID().equals(item.getID())){ more.setVisibility(View.GONE); diff --git a/mastodon/src/main/res/layout/item_account_switcher.xml b/mastodon/src/main/res/layout/item_account_switcher.xml index 1cffbf7af..d23f462d5 100644 --- a/mastodon/src/main/res/layout/item_account_switcher.xml +++ b/mastodon/src/main/res/layout/item_account_switcher.xml @@ -2,30 +2,53 @@ - + + + + + + + +