feat: use targetAccount domain name in lookup dialog
This commit is contained in:
parent
1098c855c4
commit
32da4f8e09
|
@ -1139,6 +1139,7 @@ public class UiUtils {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String finalDomain = domain;
|
||||||
new GetSearchResults(trimmedQuery, type, false).setCallback(new Callback<>() {
|
new GetSearchResults(trimmedQuery, type, false).setCallback(new Callback<>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(SearchResults results) {
|
public void onSuccess(SearchResults results) {
|
||||||
|
@ -1156,7 +1157,7 @@ public class UiUtils {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.wrapProgress((Activity)context, R.string.loading, true,
|
.wrapProgress((Activity)context, R.string.loading, true,
|
||||||
d -> transformDialogForLookup(context, targetAccountID, null, d))
|
d -> transformDialogForLookup(context, targetAccountID, null, d, finalDomain))
|
||||||
.execNoAuth(domain);
|
.execNoAuth(domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1165,8 +1166,12 @@ public class UiUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void transformDialogForLookup(Context context, String accountID, @Nullable String url, ProgressDialog dialog){
|
private static void transformDialogForLookup(Context context, String accountID, @Nullable String url, ProgressDialog dialog){
|
||||||
|
transformDialogForLookup(context, accountID, url, dialog, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void transformDialogForLookup(Context context, String accountID, @Nullable String url, ProgressDialog dialog, @Nullable String instanceName) {
|
||||||
if (accountID != null) {
|
if (accountID != null) {
|
||||||
dialog.setTitle(context.getString(R.string.sk_loading_resource_on_instance_title, getInstanceName(accountID)));
|
dialog.setTitle(context.getString(R.string.sk_loading_resource_on_instance_title, instanceName != null ? instanceName : getInstanceName(accountID)));
|
||||||
} else {
|
} else {
|
||||||
dialog.setTitle(R.string.sk_loading_fediverse_resource_title);
|
dialog.setTitle(R.string.sk_loading_fediverse_resource_title);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue