feat(profile): add the upstream handle thingys
This commit is contained in:
@@ -85,6 +85,7 @@ import org.joinmastodon.android.ui.OutlineProviders;
|
|||||||
import org.joinmastodon.android.ui.SimpleViewHolder;
|
import org.joinmastodon.android.ui.SimpleViewHolder;
|
||||||
import org.joinmastodon.android.ui.SingleImagePhotoViewerListener;
|
import org.joinmastodon.android.ui.SingleImagePhotoViewerListener;
|
||||||
import org.joinmastodon.android.ui.photoviewer.PhotoViewer;
|
import org.joinmastodon.android.ui.photoviewer.PhotoViewer;
|
||||||
|
import org.joinmastodon.android.ui.sheets.DecentralizationExplainerSheet;
|
||||||
import org.joinmastodon.android.ui.tabs.TabLayout;
|
import org.joinmastodon.android.ui.tabs.TabLayout;
|
||||||
import org.joinmastodon.android.ui.tabs.TabLayoutMediator;
|
import org.joinmastodon.android.ui.tabs.TabLayoutMediator;
|
||||||
import org.joinmastodon.android.ui.text.CustomEmojiSpan;
|
import org.joinmastodon.android.ui.text.CustomEmojiSpan;
|
||||||
@@ -138,7 +139,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
private ImageView avatar;
|
private ImageView avatar;
|
||||||
private CoverImageView cover;
|
private CoverImageView cover;
|
||||||
private View avatarBorder;
|
private View avatarBorder;
|
||||||
private TextView name, username, bio, followersCount, followersLabel, followingCount, followingLabel;
|
private TextView name, username, usernameDomain, bio, followersCount, followersLabel, followingCount, followingLabel;
|
||||||
private ImageView lockIcon, botIcon;
|
private ImageView lockIcon, botIcon;
|
||||||
private ProgressBarButton actionButton, notifyButton;
|
private ProgressBarButton actionButton, notifyButton;
|
||||||
private ViewPager2 pager;
|
private ViewPager2 pager;
|
||||||
@@ -244,6 +245,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
name=content.findViewById(R.id.name);
|
name=content.findViewById(R.id.name);
|
||||||
usernameWrap=content.findViewById(R.id.username_wrap);
|
usernameWrap=content.findViewById(R.id.username_wrap);
|
||||||
username=content.findViewById(R.id.username);
|
username=content.findViewById(R.id.username);
|
||||||
|
usernameDomain=content.findViewById(R.id.username_domain);
|
||||||
lockIcon=content.findViewById(R.id.lock_icon);
|
lockIcon=content.findViewById(R.id.lock_icon);
|
||||||
botIcon=content.findViewById(R.id.bot_icon);
|
botIcon=content.findViewById(R.id.bot_icon);
|
||||||
bio=content.findViewById(R.id.bio);
|
bio=content.findViewById(R.id.bio);
|
||||||
@@ -454,6 +456,16 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
nameEdit.addTextChangedListener(new SimpleTextWatcher(e->editDirty=true));
|
nameEdit.addTextChangedListener(new SimpleTextWatcher(e->editDirty=true));
|
||||||
bioEdit.addTextChangedListener(new SimpleTextWatcher(e->editDirty=true));
|
bioEdit.addTextChangedListener(new SimpleTextWatcher(e->editDirty=true));
|
||||||
|
|
||||||
|
usernameDomain.setOnClickListener(v->new DecentralizationExplainerSheet(getActivity(), accountID, account).show());
|
||||||
|
// qrCodeButton.setOnClickListener(v->{
|
||||||
|
// Bundle args=new Bundle();
|
||||||
|
// args.putString("account", accountID);
|
||||||
|
// args.putParcelable("targetAccount", Parcels.wrap(account));
|
||||||
|
// ProfileQrCodeFragment qf=new ProfileQrCodeFragment();
|
||||||
|
// qf.setArguments(args);
|
||||||
|
// qf.show(getChildFragmentManager(), "qrDialog");
|
||||||
|
// });
|
||||||
|
|
||||||
return sizeWrapper;
|
return sizeWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -714,13 +726,18 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isSelf=AccountSessionManager.getInstance().isSelf(accountID, account);
|
// boolean isSelf=AccountSessionManager.getInstance().isSelf(accountID, account);
|
||||||
|
|
||||||
String acct = ((isSelf || account.isRemote)
|
// String acct = ((isSelf || account.isRemote)
|
||||||
? account.getFullyQualifiedName()
|
// ? account.getFullyQualifiedName()
|
||||||
: account.acct);
|
// : account.acct);
|
||||||
|
|
||||||
username.setText('@'+acct);
|
username.setText("@"+account.username);
|
||||||
|
|
||||||
|
String domain=account.getDomain();
|
||||||
|
if(TextUtils.isEmpty(domain))
|
||||||
|
domain=AccountSessionManager.get(accountID).domain;
|
||||||
|
usernameDomain.setText(domain);
|
||||||
|
|
||||||
lockIcon.setVisibility(account.locked ? View.VISIBLE : View.GONE);
|
lockIcon.setVisibility(account.locked ? View.VISIBLE : View.GONE);
|
||||||
lockIcon.setImageTintList(ColorStateList.valueOf(username.getCurrentTextColor()));
|
lockIcon.setImageTintList(ColorStateList.valueOf(username.getCurrentTextColor()));
|
||||||
|
|||||||
@@ -215,6 +215,20 @@
|
|||||||
android:contentDescription="@string/sk_icon_bot"
|
android:contentDescription="@string/sk_icon_bot"
|
||||||
android:src="@drawable/ic_fluent_bot_20_filled" />
|
android:src="@drawable/ic_fluent_bot_20_filled" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/username_domain"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:textAppearance="@style/m3_label_small"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingHorizontal="4dp"
|
||||||
|
android:textColor="?colorM3OnSurfaceVariant"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:background="@drawable/rect_4dp"
|
||||||
|
android:backgroundTint="?colorM3SurfaceVariant"
|
||||||
|
tools:text="mastodon.social"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<org.joinmastodon.android.ui.views.FloatingHintEditTextLayout
|
<org.joinmastodon.android.ui.views.FloatingHintEditTextLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user