Search in sources :

Example 1 with Item

use of com.stylingandroid.designlibrary.rss.model.Item in project DesignLibrary by StylingAndroid.

the class ItemFragment method onCreateView.

@Override
@SuppressLint("SetJavaScriptEnabled")
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Item item = (Item) getArguments().getSerializable(KEY_ITEM);
    View view = inflater.inflate(R.layout.fragment_item, container, false);
    if (item != null) {
        WebView webView = (WebView) view.findViewById(R.id.web_view);
        String html = item.getContent();
        html = html.replaceAll(NEWLINE, BR);
        webView.getSettings().setUseWideViewPort(true);
        webView.getSettings().setLoadWithOverviewMode(true);
        webView.getSettings().setJavaScriptEnabled(true);
        webView.loadData(html, HTML_MIME_TYPE, null);
    }
    return view;
}
Also used : Item(com.stylingandroid.designlibrary.rss.model.Item) WebView(android.webkit.WebView) View(android.view.View) WebView(android.webkit.WebView) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 View (android.view.View)1 WebView (android.webkit.WebView)1 Item (com.stylingandroid.designlibrary.rss.model.Item)1