diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java index c5fad076af..9e27046bce 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ProfileFragment.java @@ -398,7 +398,7 @@ public void getOutline(View view, Outline outline){ followingBtn.setOnClickListener(this::onFollowersOrFollowingClick); content.findViewById(R.id.username_wrap).setOnClickListener(v->{ - UiUtils.goToInstanceAboutFragment(Uri.parse(account.url).getHost(), accountID, getContext()); + new DecentralizationExplainerSheet(getActivity(), accountID, account).show(); }); content.findViewById(R.id.username_wrap).setOnLongClickListener(v->{ @@ -435,14 +435,6 @@ public void getOutline(View view, Outline outline){ nameEdit.addTextChangedListener(new SimpleTextWatcher(e->editDirty=true)); bioEdit.addTextChangedListener(new SimpleTextWatcher(e->editDirty=true)); - usernameDomain.setOnClickListener(v->{ - UiUtils.goToInstanceAboutFragment(Uri.parse(account.url).getHost(), accountID, getContext()); - }); - - usernameDomain.setOnLongClickListener(v->{ - new DecentralizationExplainerSheet(getActivity(), accountID, account).show(); - return true; - }); // qrCodeButton.setOnClickListener(v->{ // Bundle args=new Bundle(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/sheets/DecentralizationExplainerSheet.java b/mastodon/src/main/java/org/joinmastodon/android/ui/sheets/DecentralizationExplainerSheet.java index 657ec4faa3..cfc0a2e522 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/sheets/DecentralizationExplainerSheet.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/sheets/DecentralizationExplainerSheet.java @@ -4,6 +4,7 @@ import android.content.ClipboardManager; import android.content.Context; import android.graphics.drawable.ColorDrawable; +import android.net.Uri; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.TextUtils; @@ -45,6 +46,11 @@ public DecentralizationExplainerSheet(@NonNull Context context, String accountID TextView handleExplanation=findViewById(R.id.handle_explanation); findViewById(R.id.btn_cancel).setOnClickListener(v->dismiss()); + findViewById(R.id.btn_view_info).setOnClickListener(v->{ + UiUtils.goToInstanceAboutFragment(Uri.parse(account.url).getHost(), accountID, context); + dismiss(); + }); + String domain=account.getDomain(); if(TextUtils.isEmpty(domain)) domain=AccountSessionManager.get(accountID).domain; diff --git a/mastodon/src/main/res/layout/sheet_decentralization_info.xml b/mastodon/src/main/res/layout/sheet_decentralization_info.xml index 9460b1a9ef..274d95fe2e 100644 --- a/mastodon/src/main/res/layout/sheet_decentralization_info.xml +++ b/mastodon/src/main/res/layout/sheet_decentralization_info.xml @@ -174,5 +174,14 @@ style="@style/Widget.Mastodon.M3.Button.Filled" android:text="@string/got_it"/> +