Show link type in link confirmation dialog

This commit is contained in:
M66B
2024-02-04 16:55:05 +01:00
parent f5ea517876
commit 94ee92a0ad
4 changed files with 32 additions and 0 deletions

View File

@@ -168,6 +168,7 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
// Get views
final View dview = LayoutInflater.from(context).inflate(R.layout.dialog_open_link, null);
scroll = dview.findViewById(R.id.scroll);
final TextView tvCaption = dview.findViewById(R.id.tvCaption);
final ImageButton ibInfo = dview.findViewById(R.id.ibInfo);
final TextView tvTitle = dview.findViewById(R.id.tvTitle);
final ImageButton ibDifferent = dview.findViewById(R.id.ibDifferent);
@@ -529,6 +530,13 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
// Initialize
if (UriHelper.isHyperLink(uri))
tvCaption.setCompoundDrawablesWithIntrinsicBounds(R.drawable.twotone_insert_link_45_24, 0, 0, 0);
else if (UriHelper.isPhoneNumber(uri))
tvCaption.setCompoundDrawablesWithIntrinsicBounds(R.drawable.twotone_call_24, 0, 0, 0);
else if (UriHelper.isGeo(uri))
tvCaption.setCompoundDrawablesWithIntrinsicBounds(R.drawable.twotone_language_24, 0, 0, 0);
tvTitle.setText(title);
tvTitle.setVisibility(TextUtils.isEmpty(title) ? View.GONE : View.VISIBLE);