summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kde.org>2014-03-04 11:03:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-06 06:08:37 +0100
commit5ab630f8be137157c5f0809d8325f9b163036b01 (patch)
tree0263e471445802a350acf7864368c833f2b463e0 /src
parent134527162ac6d36023fb9cd4265c2b98bf321805 (diff)
Android: Display HTML text correctly on Android native dialog.
Task-number: QTBUG-35687 Change-Id: I3a298b7f4c5f9608537b1afdb994d76ef3abb706 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java b/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java
index 6ee1304c12..b8dbaa4829 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtMessageDialogHelper.java
@@ -51,6 +51,8 @@ import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.text.ClipboardManager;
+import android.text.Html;
+import android.text.Spanned;
import android.util.TypedValue;
import android.view.View;
import android.widget.Button;
@@ -74,11 +76,11 @@ class ButtonStruct implements View.OnClickListener
{
m_dialog = dialog;
m_id = id;
- m_text = text;
+ m_text = Html.fromHtml(text);
}
QtMessageDialogHelper m_dialog;
private int m_id;
- String m_text;
+ Spanned m_text;
@Override
public void onClick(View view) {
@@ -153,22 +155,22 @@ public class QtMessageDialogHelper
public void setTile(String title)
{
- m_title = title;
+ m_title = Html.fromHtml(title);
}
public void setText(String text)
{
- m_text = text;
+ m_text = Html.fromHtml(text);
}
public void setInformativeText(String informativeText)
{
- m_informativeText = informativeText;
+ m_informativeText = Html.fromHtml(informativeText);
}
public void setDetailedText(String text)
{
- m_detailedText = text;
+ m_detailedText = Html.fromHtml(text);
}
public void addButton(int id, String text)
@@ -417,7 +419,7 @@ public class QtMessageDialogHelper
private Activity m_activity;
private int m_icon = 0;
- private String m_title, m_text, m_informativeText, m_detailedText;
+ private Spanned m_title, m_text, m_informativeText, m_detailedText;
private ArrayList<ButtonStruct> m_buttonsList;
private AlertDialog m_dialog;
private long m_handler = 0;