mirror of https://github.com/NekoX-Dev/NekoX.git
Add copy to url alert
(cherry picked from commit 54d471bd67f36d41790da8e03b2af54aaa3e53cc)
This commit is contained in:
parent
ddf1841ed1
commit
ea0e850344
|
@ -459,7 +459,7 @@ public class AlertsCreator {
|
|||
return null;
|
||||
}
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
builder.setTitle(title == null ? LocaleController.getString("NekoX", R.string.NekoX) : title);
|
||||
builder.setTitle(title == null ? LocaleController.getString("AppName", R.string.AppName) : title);
|
||||
builder.setMessage(text);
|
||||
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
|
||||
return builder;
|
||||
|
@ -847,6 +847,14 @@ public class AlertsCreator {
|
|||
builder.setMessageTextViewClickable(false);
|
||||
builder.setPositiveButton(LocaleController.getString("Open", R.string.Open), (dialogInterface, i) -> Browser.openUrl(fragment.getParentActivity(), url, inlineReturn == 0, tryTelegraph));
|
||||
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
|
||||
builder.setNeutralButton(LocaleController.getString("Copy", R.string.Copy), (dialogInterface, i) -> {
|
||||
try {
|
||||
AndroidUtilities.addToClipboard(url);
|
||||
Toast.makeText(fragment.getParentActivity(), LocaleController.getString("LinkCopied", R.string.LinkCopied), Toast.LENGTH_SHORT).show();
|
||||
} catch (Exception e) {
|
||||
FileLog.e(e);
|
||||
}
|
||||
});
|
||||
fragment.showDialog(builder.create());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue