Skip to content

Commit

Permalink
Merge pull request #8854 from garymathews/TIMOB-24399
Browse files Browse the repository at this point in the history
[TIMOB-24399] Android: Fix Ti.UI.WebView.html property setter
  • Loading branch information
mukherjee2 committed Mar 9, 2017
2 parents e141ad6 + 595873e commit 759e856
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,17 @@ public String getHtml()
return (String) getProperty(TiC.PROPERTY_HTML);
}

@Kroll.method
public void setHtml(String html, @Kroll.argument(optional = true) KrollDict d)
@Kroll.method @Kroll.setProperty
public void setHtml(String html)
{
setProperty(TiC.PROPERTY_HTML, html);
setProperty(OPTIONS_IN_SETHTML, d);

// If the web view has not been created yet, don't set html here. It will be set in processProperties() when the
// view is created.
TiUIView v = peekView();
if (v != null) {
if (TiApplication.isUIThread()) {
((TiUIWebView) v).setHtml(html, d);
((TiUIWebView) v).setHtml(html);
} else {
getMainHandler().sendEmptyMessage(MSG_SET_HTML);
}
Expand Down Expand Up @@ -200,8 +199,7 @@ public boolean handleMessage(Message msg)
return true;
case MSG_SET_HTML:
String html = TiConvert.toString(getProperty(TiC.PROPERTY_HTML));
HashMap<String, Object> d = (HashMap<String, Object>) getProperty(OPTIONS_IN_SETHTML);
getWebView().setHtml(html, d);
getWebView().setHtml(html);
return true;
}
}
Expand Down

0 comments on commit 759e856

Please sign in to comment.