From d1dcdbfb67de019ca9ac0d36863ddc1260c1a9d5 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 4 Sep 2022 11:44:28 +0200 Subject: [PATCH] Added whois info button --- .../faircode/email/FragmentDialogOpenLink.java | 9 +++++++++ app/src/main/res/layout/dialog_whois.xml | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentDialogOpenLink.java b/app/src/main/java/eu/faircode/email/FragmentDialogOpenLink.java index 49af818dc4..16deec8cd8 100644 --- a/app/src/main/java/eu/faircode/email/FragmentDialogOpenLink.java +++ b/app/src/main/java/eu/faircode/email/FragmentDialogOpenLink.java @@ -454,9 +454,18 @@ public class FragmentDialogOpenLink extends FragmentDialogBase { final View dview = LayoutInflater.from(context).inflate(R.layout.dialog_whois, null); final TextView tvHost = dview.findViewById(R.id.tvHost); final TextView tvWhois = dview.findViewById(R.id.tvWhois); + final ImageButton ibInfo = dview.findViewById(R.id.ibInfo); tvWhois.setMovementMethod(LinkMovementMethod.getInstance()); + ibInfo.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Uri uri = Uri.parse("https://en.wikipedia.org/wiki/WHOIS"); + Helper.view(v.getContext(), uri, true); + } + }); + tvHost.setText(args.getString("host")); tvWhois.setText(whois); diff --git a/app/src/main/res/layout/dialog_whois.xml b/app/src/main/res/layout/dialog_whois.xml index 8424811daa..9eb6a74aa6 100644 --- a/app/src/main/res/layout/dialog_whois.xml +++ b/app/src/main/res/layout/dialog_whois.xml @@ -19,10 +19,24 @@ android:drawablePadding="6dp" android:text="@string/title_whois" android:textAppearance="@style/TextAppearance.AppCompat.Large" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintEnd_toStartOf="@+id/ibInfo" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + +