use of android.webkit.WebView in project SeriesGuide by UweTrottmann.
the class BaseOAuthActivity method setupViews.
private void setupViews() {
webview = (WebView) findViewById(R.id.webView);
buttonContainer = findViewById(R.id.containerOauthButtons);
progressBar = findViewById(R.id.progressBarOauth);
textViewMessage = (TextView) buttonContainer.findViewById(R.id.textViewOauthMessage);
// setup buttons (can be used if browser launch fails or user comes back without code)
Button buttonBrowser = (Button) findViewById(R.id.buttonOauthBrowser);
buttonBrowser.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
launchBrowser();
}
});
Button buttonWebView = (Button) findViewById(R.id.buttonOauthWebView);
buttonWebView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
activateWebView();
}
});
activateFallbackButtons();
setMessage(null);
}
use of android.webkit.WebView in project XPrivacy by M66B.
the class XWebView method after.
@Override
protected void after(XParam param) throws Throwable {
switch(mMethod) {
case WebView:
if (param.args.length > 0 && param.thisObject instanceof WebView) {
if (isRestricted(param, PrivacyManager.cView, "initUserAgentString")) {
String ua = (String) PrivacyManager.getDefacedProp(Binder.getCallingUid(), "UA");
WebView webView = (WebView) param.thisObject;
if (webView.getSettings() != null)
webView.getSettings().setUserAgentString(ua);
}
}
break;
case loadUrl:
case postUrl:
// Do nothing
break;
case getSettings:
if (param.getResult() != null) {
Class<?> clazz = param.getResult().getClass();
if (PrivacyManager.getTransient(clazz.getName(), null) == null) {
PrivacyManager.setTransient(clazz.getName(), Boolean.toString(true));
XPrivacy.hookAll(XWebSettings.getInstances(param.getResult()), clazz.getClassLoader(), getSecret(), true);
}
}
break;
}
}
use of android.webkit.WebView in project material-dialogs by afollestad.
the class MDRootLayout method setUpDividersVisibility.
private void setUpDividersVisibility(final View view, final boolean setForTop, final boolean setForBottom) {
if (view == null) {
return;
}
if (view instanceof ScrollView) {
final ScrollView sv = (ScrollView) view;
if (canScrollViewScroll(sv)) {
addScrollListener(sv, setForTop, setForBottom);
} else {
if (setForTop) {
drawTopDivider = false;
}
if (setForBottom) {
drawBottomDivider = false;
}
}
} else if (view instanceof AdapterView) {
final AdapterView sv = (AdapterView) view;
if (canAdapterViewScroll(sv)) {
addScrollListener(sv, setForTop, setForBottom);
} else {
if (setForTop) {
drawTopDivider = false;
}
if (setForBottom) {
drawBottomDivider = false;
}
}
} else if (view instanceof WebView) {
view.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {
@Override
public boolean onPreDraw() {
if (view.getMeasuredHeight() != 0) {
if (!canWebViewScroll((WebView) view)) {
if (setForTop) {
drawTopDivider = false;
}
if (setForBottom) {
drawBottomDivider = false;
}
} else {
addScrollListener((ViewGroup) view, setForTop, setForBottom);
}
view.getViewTreeObserver().removeOnPreDrawListener(this);
}
return true;
}
});
} else if (view instanceof RecyclerView) {
boolean canScroll = canRecyclerViewScroll((RecyclerView) view);
if (setForTop) {
drawTopDivider = canScroll;
}
if (setForBottom) {
drawBottomDivider = canScroll;
}
if (canScroll) {
addScrollListener((ViewGroup) view, setForTop, setForBottom);
}
} else if (view instanceof ViewGroup) {
View topView = getTopView((ViewGroup) view);
setUpDividersVisibility(topView, setForTop, setForBottom);
View bottomView = getBottomView((ViewGroup) view);
if (bottomView != topView) {
setUpDividersVisibility(bottomView, false, true);
}
}
}
use of android.webkit.WebView 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.WebView in project FadingActionBar by ManuelPeinado.
the class WebViewActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
FadingActionBarHelper helper = new FadingActionBarHelper().actionBarBackground(R.drawable.ab_background).headerLayout(R.layout.header).contentLayout(R.layout.activity_webview);
setContentView(helper.createView(this));
helper.initActionBar(this);
WebView webView = (WebView) findViewById(R.id.webView);
webView.setWebViewClient(new WebViewClient());
webView.loadUrl("http://en.wikipedia.org/wiki/New_York_City");
}
Aggregations