From 9dffb57bcb145583e4d22344ee62138040e71fd7 Mon Sep 17 00:00:00 2001 From: Nathanael Anderson Date: Mon, 7 Sep 2015 15:11:29 -0500 Subject: [PATCH] Issue with Android and urls... --- ui/html-view/html-view.android.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui/html-view/html-view.android.ts b/ui/html-view/html-view.android.ts index b469db3c8..0a83663f7 100644 --- a/ui/html-view/html-view.android.ts +++ b/ui/html-view/html-view.android.ts @@ -10,6 +10,13 @@ function onHtmlPropertyChanged(data: dependencyObservable.PropertyChangeData) { } if (types.isString(data.newValue)) { + // If the data.newValue actually has a in it; we need to disable auto-linking + // as it internally disables anyways; and then links won't work.. + if (data.newValue.toLowerCase().indexOf(" 0) { + view.android.setAutoLinkMask(0); + } else { + view.android.setAutoLinkMask(15); // 15 (0x0f) = Linkify All text links + } view.android.setText(android.text.Html.fromHtml(data.newValue)); } else { view.android.setText(""); @@ -30,7 +37,10 @@ export class HtmlView extends common.HtmlView { public _createUI() { this._android = new android.widget.TextView(this._context); - this._android.setAutoLinkMask(15); // 15 (0x0f) = Linkify All + // This makes the work + this._android.setLinksClickable(true); + this._android.setMovementMethod(android.text.method.LinkMovementMethod.getInstance()); + } } \ No newline at end of file