mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-27 10:17:18 +00:00
Original text: long click to confirm link
This commit is contained in:
parent
591beda75a
commit
97e03de72e
2 changed files with 7 additions and 19 deletions
|
@ -2994,12 +2994,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onOpenLink(String url) {
|
||||
public boolean onOpenLink(String url, boolean always) {
|
||||
if (parentFragment == null)
|
||||
return false;
|
||||
|
||||
Uri uri = Uri.parse(url);
|
||||
return ViewHolder.this.onOpenLink(uri, null, EntityFolder.JUNK.equals(message.folderType));
|
||||
return ViewHolder.this.onOpenLink(uri, null,
|
||||
always || EntityFolder.JUNK.equals(message.folderType));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -187,7 +187,7 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
|||
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
Log.i("Open url=" + url);
|
||||
return intf.onOpenLink(url);
|
||||
return intf.onOpenLink(url, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -312,21 +312,8 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
|||
type == HitTestResult.GEO_TYPE ||
|
||||
type == HitTestResult.EMAIL_TYPE ||
|
||||
type == HitTestResult.SRC_ANCHOR_TYPE ||
|
||||
type == HitTestResult.EDIT_TEXT_TYPE) {
|
||||
ClipboardManager clipboard = Helper.getSystemService(context, ClipboardManager.class);
|
||||
if (clipboard == null)
|
||||
return false;
|
||||
|
||||
String title = context.getString(R.string.app_name);
|
||||
|
||||
ClipData clip = ClipData.newPlainText(title, extra);
|
||||
clipboard.setPrimaryClip(clip);
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
|
||||
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
|
||||
|
||||
return true;
|
||||
}
|
||||
type == HitTestResult.EDIT_TEXT_TYPE)
|
||||
return intf.onOpenLink(extra, true);
|
||||
|
||||
if (type == WebView.HitTestResult.IMAGE_TYPE ||
|
||||
type == WebView.HitTestResult.SRC_IMAGE_ANCHOR_TYPE) {
|
||||
|
@ -502,7 +489,7 @@ public class WebViewEx extends WebView implements DownloadListener, View.OnLongC
|
|||
|
||||
void onScrollChange(int dx, int dy, int scrollX, int scrollY);
|
||||
|
||||
boolean onOpenLink(String url);
|
||||
boolean onOpenLink(String url, boolean always);
|
||||
|
||||
void onUserInterAction();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue