use of org.edx.mobile.view.custom.URLInterceptorWebViewClient in project edx-app-android by edx.
the class CourseDetailFragment method populateAboutThisCourse.
/**
* Takes a string which can include html and then renders it into the courseAbout webview.
*
* @param overview A string that can contain html tags
*/
private void populateAboutThisCourse(String overview) {
courseAbout.setVisibility(View.VISIBLE);
URLInterceptorWebViewClient client = new URLInterceptorWebViewClient(getActivity(), courseAboutWebView);
client.setAllLinksAsExternal(true);
StringBuilder buff = WebViewUtil.getIntialWebviewBuffer(getActivity(), logger);
buff.append("<body>");
buff.append("<div class=\"header\">");
buff.append(overview);
buff.append("</div>");
buff.append("</body>");
courseAboutWebView.clearCache(true);
courseAboutWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", StandardCharsets.UTF_8.name(), null);
}
use of org.edx.mobile.view.custom.URLInterceptorWebViewClient in project edx-app-android by edx.
the class CourseHandoutFragment method onViewCreated.
@SuppressLint("SetJavaScriptEnabled")
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
errorNotification = new FullScreenErrorNotification(webview);
snackbarErrorNotification = new SnackbarErrorNotification(webview);
new URLInterceptorWebViewClient(getActivity(), webview).setAllLinksAsExternal(true);
loadData();
}
Aggregations