Merge pull request #358

feat: add instance info button to DecentralizationExplainerSheet
This commit is contained in:
LucasGGamerM
2024-03-17 13:28:11 -03:00
committed by GitHub
4 changed files with 17 additions and 9 deletions

View File

@@ -398,7 +398,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
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 class ProfileFragment extends LoaderFragment implements OnBackPressedList
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();

View File

@@ -4,6 +4,7 @@ import android.content.ClipData;
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 class DecentralizationExplainerSheet extends BottomSheet{
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;