use of android.webkit.WebSettings in project materialistic by hidroh.
the class CacheableWebView method setLoadSettings.
@SuppressLint("SetJavaScriptEnabled")
private void setLoadSettings() {
WebSettings webSettings = getSettings();
webSettings.setLoadWithOverviewMode(true);
webSettings.setUseWideViewPort(true);
webSettings.setJavaScriptEnabled(true);
}
use of android.webkit.WebSettings in project double-espresso by JakeWharton.
the class SimpleWebViewActivity method onCreate.
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
WebView mainWebView = new WebView(this);
setContentView(mainWebView);
mainWebView.loadData("<html>" + "<script>document.was_clicked = false</script>" + "<body> " + "<button style='height:1000px;width:1000px;' onclick='document.was_clicked = true'> " + "I'm a button</button>" + "</body> " + "</html>", "text/html", null);
WebSettings settings = mainWebView.getSettings();
settings.setJavaScriptEnabled(true);
}
use of android.webkit.WebSettings in project AirMapView by airbnb.
the class WebViewMapFragment method onCreateView.
@SuppressLint({ "SetJavaScriptEnabled", "AddJavascriptInterface" })
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_webview, container, false);
webView = (WebView) view.findViewById(R.id.webview);
mLayout = (ViewGroup) view;
WebSettings webViewSettings = webView.getSettings();
webViewSettings.setSupportZoom(true);
webViewSettings.setBuiltInZoomControls(false);
webViewSettings.setJavaScriptEnabled(true);
webViewSettings.setGeolocationEnabled(true);
webViewSettings.setAllowFileAccess(false);
webViewSettings.setAllowContentAccess(false);
webView.setWebChromeClient(new GeoWebChromeClient());
AirMapType mapType = AirMapType.fromBundle(getArguments());
webView.loadDataWithBaseURL(mapType.getDomain(), mapType.getMapData(getResources()), "text/html", "base64", null);
webView.addJavascriptInterface(new MapsJavaScriptInterface(), "AirMapView");
return view;
}
use of android.webkit.WebSettings in project weiciyuan by qii.
the class OAuthActivity method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.oauthactivity_layout);
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(false);
actionBar.setTitle(getString(R.string.login));
webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WeiboWebViewClient());
WebSettings settings = webView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setSaveFormData(false);
settings.setSavePassword(false);
settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
settings.setRenderPriority(WebSettings.RenderPriority.HIGH);
CookieSyncManager.createInstance(this);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
}
use of android.webkit.WebSettings in project weiciyuan by qii.
the class BrowserWebFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.browserwebfragment_layout, container, false);
if (mWebView != null) {
mWebView.destroy();
}
mWebView = (WebView) view.findViewById(R.id.webView);
mProgressBar = (ProgressBar) view.findViewById(R.id.progressbar);
mWebView.setOnKeyListener(new View.OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
if ((keyCode == KeyEvent.KEYCODE_BACK) && mWebView.canGoBack()) {
mWebView.goBack();
return true;
}
return false;
}
});
mWebView.setWebViewClient(new InnerWebViewClient());
mWebView.setWebChromeClient(new InnerWebChromeClient());
mIsWebViewAvailable = true;
WebSettings settings = mWebView.getSettings();
settings.setJavaScriptEnabled(true);
settings.setBuiltInZoomControls(true);
settings.setDisplayZoomControls(false);
return view;
}
Aggregations