feat(profile): make the new decentralization sheet appear only when holding the instance button

This commit is contained in:
LucasGGamerM
2024-03-17 10:37:02 -03:00
parent 1dd46df540
commit 4a13398801
2 changed files with 35 additions and 23 deletions

View File

@@ -1798,6 +1798,31 @@ public class UiUtils {
return text;
}
public static void goToInstanceAboutFragment(String instanceUrl, String accountID ,Context context){
try {
new GetInstance()
.setCallback(new Callback<>(){
@Override
public void onSuccess(Instance result){
Bundle args = new Bundle();
args.putParcelable("instance", Parcels.wrap(result));
args.putString("account", accountID);
Nav.go((Activity) context, SettingsServerFragment.class, args);
}
@Override
public void onError(ErrorResponse error){
error.showToast(context);
}
})
.wrapProgress((Activity) context, R.string.loading, true)
.execRemote(instanceUrl);
} catch (NullPointerException ignored) {
// maybe the url was malformed?
Toast.makeText(context, R.string.error, Toast.LENGTH_SHORT).show();
}
}
private static final String[] pronounsUrls= new String[] {
"pronouns.within.lgbt/",
"pronouns.cc/pronouns/",