aboutsummaryrefslogtreecommitdiff
path: root/src/github
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2013-11-14 14:19:12 -0800
committerdaneren2005 <daneren2005@gmail.com>2013-11-14 14:19:12 -0800
commitcf6c4ce9d153291b1cebaa832a0a55942f89cad7 (patch)
tree531afeccff0320765bc444ffb99579bb1118381f /src/github
parent6a6f300c700967d4347fe7c12f5134886902be28 (diff)
downloaddsub-cf6c4ce9d153291b1cebaa832a0a55942f89cad7.tar.gz
dsub-cf6c4ce9d153291b1cebaa832a0a55942f89cad7.tar.bz2
dsub-cf6c4ce9d153291b1cebaa832a0a55942f89cad7.zip
Add a way to not linkify a dialog's text
Diffstat (limited to 'src/github')
-rw-r--r--src/github/daneren2005/dsub/util/Util.java32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/github/daneren2005/dsub/util/Util.java b/src/github/daneren2005/dsub/util/Util.java
index 7ff551de..c4f51e5c 100644
--- a/src/github/daneren2005/dsub/util/Util.java
+++ b/src/github/daneren2005/dsub/util/Util.java
@@ -786,24 +786,44 @@ public final class Util {
}
public static void info(Context context, int titleId, int messageId) {
- showDialog(context, android.R.drawable.ic_dialog_info, titleId, messageId);
+ info(context, titleId, messageId, true);
}
public static void info(Context context, int titleId, String message) {
- showDialog(context, android.R.drawable.ic_dialog_info, titleId, message);
+ info(context, titleId, message, true);
}
public static void info(Context context, String title, String message) {
- showDialog(context, android.R.drawable.ic_dialog_info, title, message);
+ info(context, title, message);
+ }
+ public static void info(Context context, int titleId, int messageId, boolean linkify) {
+ showDialog(context, android.R.drawable.ic_dialog_info, titleId, messageId, linkify);
+ }
+ public static void info(Context context, int titleId, String message, boolean linkify) {
+ showDialog(context, android.R.drawable.ic_dialog_info, titleId, message, linkify);
+ }
+ public static void info(Context context, String title, String message, boolean linkify) {
+ showDialog(context, android.R.drawable.ic_dialog_info, title, message, linkify);
}
private static void showDialog(Context context, int icon, int titleId, int messageId) {
- showDialog(context, icon, context.getResources().getString(titleId), context.getResources().getString(messageId));
+ showDialog(context, icon, titleId, messageId, true);
}
private static void showDialog(Context context, int icon, int titleId, String message) {
- showDialog(context, icon, context.getResources().getString(titleId), message);
+ showDialog(context, icon, titleId, message, true);
}
private static void showDialog(Context context, int icon, String title, String message) {
+ showDialog(context, icon, title, message, true);
+ }
+ private static void showDialog(Context context, int icon, int titleId, int messageId, boolean linkify) {
+ showDialog(context, icon, context.getResources().getString(titleId), context.getResources().getString(messageId), linkify);
+ }
+ private static void showDialog(Context context, int icon, int titleId, String message, boolean linkify) {
+ showDialog(context, icon, context.getResources().getString(titleId), message, linkify);
+ }
+ private static void showDialog(Context context, int icon, String title, String message, boolean linkify) {
SpannableString ss = new SpannableString(message);
- Linkify.addLinks(ss, Linkify.ALL);
+ if(linkify) {
+ Linkify.addLinks(ss, Linkify.ALL);
+ }
AlertDialog dialog = new AlertDialog.Builder(context)
.setIcon(icon)