diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java
index 6200e09c24..940558b003 100644
--- a/app/src/main/java/eu/faircode/email/ActivityView.java
+++ b/app/src/main/java/eu/faircode/email/ActivityView.java
@@ -637,8 +637,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
if (faq.resolveActivity(getPackageManager()) == null)
startActivity(getIntentRate());
else {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
- builder
+ new AlertDialog.Builder(this)
.setMessage(R.string.title_issue)
.setPositiveButton(R.string.title_yes, new DialogInterface.OnClickListener() {
@Override
diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java
index 12edba2cac..85298b9193 100644
--- a/app/src/main/java/eu/faircode/email/FragmentAccount.java
+++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java
@@ -699,8 +699,7 @@ public class FragmentAccount extends FragmentEx {
ibDelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
- builder
+ new AlertDialog.Builder(getContext())
.setMessage(R.string.title_account_delete)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
@@ -735,7 +734,8 @@ public class FragmentAccount extends FragmentEx {
}.load(FragmentAccount.this, args);
}
})
- .setNegativeButton(android.R.string.cancel, null).show();
+ .setNegativeButton(android.R.string.cancel, null)
+ .show();
}
});
diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java
index fe014c57ab..708e95fca8 100644
--- a/app/src/main/java/eu/faircode/email/FragmentCompose.java
+++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java
@@ -235,8 +235,7 @@ public class FragmentCompose extends FragmentEx {
public boolean onNavigationItemSelected(@NonNull MenuItem item) {
int action = item.getItemId();
if (action == R.id.action_delete) {
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
- builder
+ new AlertDialog.Builder(getContext())
.setMessage(R.string.title_ask_delete)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
@@ -244,7 +243,8 @@ public class FragmentCompose extends FragmentEx {
onAction(R.id.action_delete);
}
})
- .setNegativeButton(android.R.string.cancel, null).show();
+ .setNegativeButton(android.R.string.cancel, null)
+ .show();
} else
onAction(action);
diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java
index cbea606c70..bd3894516a 100644
--- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java
+++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java
@@ -347,8 +347,7 @@ public class FragmentIdentity extends FragmentEx {
ibDelete.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
- builder
+ new AlertDialog.Builder(getContext())
.setMessage(R.string.title_identity_delete)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
@@ -381,7 +380,8 @@ public class FragmentIdentity extends FragmentEx {
}.load(FragmentIdentity.this, args);
}
})
- .setNegativeButton(android.R.string.cancel, null).show();
+ .setNegativeButton(android.R.string.cancel, null)
+ .show();
}
});
diff --git a/app/src/main/java/eu/faircode/email/FragmentMessage.java b/app/src/main/java/eu/faircode/email/FragmentMessage.java
index d3c0e38cf9..3587542a79 100644
--- a/app/src/main/java/eu/faircode/email/FragmentMessage.java
+++ b/app/src/main/java/eu/faircode/email/FragmentMessage.java
@@ -52,6 +52,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
+import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -247,12 +248,26 @@ public class FragmentMessage extends FragmentEx {
.putExtra("uri", uri));
} else {
- // https://developer.chrome.com/multidevice/android/customtabs
- CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
- builder.setToolbarColor(Helper.resolveColor(getContext(), R.attr.colorPrimary));
-
- CustomTabsIntent customTabsIntent = builder.build();
- customTabsIntent.launchUrl(getContext(), Uri.parse(url));
+ View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_link, null);
+ final EditText etLink = view.findViewById(R.id.etLink);
+ etLink.setText(url);
+ new AlertDialog.Builder(getContext())
+ .setView(view)
+ .setPositiveButton(R.string.title_yes, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ Uri uri = Uri.parse(etLink.getText().toString());
+
+ // https://developer.chrome.com/multidevice/android/customtabs
+ CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
+ builder.setToolbarColor(Helper.resolveColor(getContext(), R.attr.colorPrimary));
+
+ CustomTabsIntent customTabsIntent = builder.build();
+ customTabsIntent.launchUrl(getContext(), uri);
+ }
+ })
+ .setNegativeButton(R.string.title_no, null)
+ .show();
}
}
@@ -712,8 +727,7 @@ public class FragmentMessage extends FragmentEx {
}
private void onActionSpam() {
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
- builder
+ new AlertDialog.Builder(getContext())
.setMessage(R.string.title_ask_spam)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
@@ -761,15 +775,15 @@ public class FragmentMessage extends FragmentEx {
}.load(FragmentMessage.this, args);
}
})
- .setNegativeButton(android.R.string.cancel, null).show();
+ .setNegativeButton(android.R.string.cancel, null)
+ .show();
}
private void onActionDelete() {
boolean delete = (Boolean) bottom_navigation.getTag();
if (delete) {
// No trash or is trash
- AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
- builder
+ new AlertDialog.Builder(getContext())
.setMessage(R.string.title_ask_delete)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
@@ -819,7 +833,8 @@ public class FragmentMessage extends FragmentEx {
}.load(FragmentMessage.this, args);
}
})
- .setNegativeButton(android.R.string.cancel, null).show();
+ .setNegativeButton(android.R.string.cancel, null)
+ .show();
} else {
Helper.setViewsEnabled(view, false);
diff --git a/app/src/main/res/layout/dialog_link.xml b/app/src/main/res/layout/dialog_link.xml
new file mode 100644
index 0000000000..da0a63cca7
--- /dev/null
+++ b/app/src/main/res/layout/dialog_link.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 894af731e2..333693e36f 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -222,6 +222,7 @@
Long press for options
Swipe left to trash; swipe right to archive (if available); long press to mark read/unread or to add/remove star
+ Open link
There is an update to version %1$s available
Do you have a question or problem?
Yes