use of android.webkit.WebView in project materialistic by hidroh.
the class ReadabilityFragmentTest method testFontSizeMenu.
@Test
public void testFontSizeMenu() {
verify(readabilityClient).parse(eq("1"), eq("http://example.com/article.html"), callback.capture());
callback.getValue().onResponse("<div>content</div>");
fragment.onOptionsItemSelected(new RoboMenuItem(R.id.menu_font_options));
assertThat(fragment.getFragmentManager()).hasFragmentWithTag(PopupSettingsFragment.class.getName());
PreferenceManager.getDefaultSharedPreferences(activity).edit().putString(activity.getString(R.string.pref_readability_text_size), "3").apply();
WebView webView = (WebView) activity.findViewById(R.id.web_view);
shadowOf(webView).getWebViewClient().onPageFinished(webView, "about:blank");
assertThat(shadowOf(webView).getLastLoadDataWithBaseURL().data).contains("20");
assertEquals(R.style.AppTextSize_XLarge, Preferences.Theme.resolvePreferredReadabilityTextSize(activity));
controller.pause().stop().destroy();
}
use of android.webkit.WebView in project openkit-android by OpenKit.
the class WebDialog method setUpWebView.
@SuppressLint("SetJavaScriptEnabled")
private void setUpWebView(int margin) {
LinearLayout webViewContainer = new LinearLayout(getContext());
webView = new WebView(getContext());
webView.setVerticalScrollBarEnabled(false);
webView.setHorizontalScrollBarEnabled(false);
webView.setWebViewClient(new DialogWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
webView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
webView.setVisibility(View.INVISIBLE);
webView.getSettings().setSavePassword(false);
webViewContainer.setPadding(margin, margin, margin, margin);
webViewContainer.addView(webView);
webViewContainer.setBackgroundColor(BACKGROUND_GRAY);
contentFrameLayout.addView(webViewContainer);
}
use of android.webkit.WebView in project Klyph by jonathangerbaud.
the class WebDialog method setUpWebView.
@SuppressLint("SetJavaScriptEnabled")
private void setUpWebView(int margin) {
LinearLayout webViewContainer = new LinearLayout(getContext());
webView = new WebView(getContext());
webView.setVerticalScrollBarEnabled(false);
webView.setHorizontalScrollBarEnabled(false);
webView.setWebViewClient(new DialogWebViewClient());
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl(url);
webView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
webView.setVisibility(View.INVISIBLE);
webView.getSettings().setSavePassword(false);
webViewContainer.setPadding(margin, margin, margin, margin);
webViewContainer.addView(webView);
webViewContainer.setBackgroundColor(BACKGROUND_GRAY);
contentFrameLayout.addView(webViewContainer);
}
use of android.webkit.WebView in project musicbrainz-android by jdamcd.
the class WebFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View layout = inflater.inflate(R.layout.fragment_webview, container, false);
webView = (WebView) layout.findViewById(R.id.webview);
loadWebView();
return layout;
}
use of android.webkit.WebView in project Klyph by jonathangerbaud.
the class FbDialog method setUpWebView.
private void setUpWebView(int margin) {
LinearLayout webViewContainer = new LinearLayout(getContext());
mWebView = new WebView(getContext());
mWebView.setVerticalScrollBarEnabled(false);
mWebView.setHorizontalScrollBarEnabled(false);
mWebView.setWebViewClient(new FbDialog.FbWebViewClient());
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setUserAgentString("Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Safari/530.17");
mWebView.loadUrl(mUrl);
mWebView.setLayoutParams(FILL);
mWebView.setVisibility(View.INVISIBLE);
mWebView.getSettings().setSavePassword(false);
webViewContainer.setPadding(margin, margin, margin, margin);
webViewContainer.addView(mWebView);
mContent.addView(webViewContainer);
}
Aggregations