@Implements(value=android.webkit.WebView.class) public class ShadowWebView extends ShadowViewGroup
Modifier and Type | Class and Description |
---|---|
static class |
ShadowWebView.LoadData |
static class |
ShadowWebView.LoadDataWithBaseURL |
ShadowView.WindowIdHelper
realViewGroup
attributeSet, realView, scrollToCoordinates
Constructor and Description |
---|
ShadowWebView() |
Modifier and Type | Method and Description |
---|---|
protected void |
addJavascriptInterface(Object obj,
String interfaceName) |
protected boolean |
canGoBack() |
protected void |
clearCache(boolean includeDiskFiles) |
protected void |
clearFormData() |
protected void |
clearHistory() |
protected void |
clearView() |
protected WebBackForwardList |
copyBackForwardList() |
protected void |
destroy() |
boolean |
didClearCacheIncludeDiskFiles() |
void |
ensureProviderCreated() |
protected void |
evaluateJavascript(String script,
ValueCallback<String> callback) |
protected static String |
findAddress(String addr) |
protected static PackageInfo |
getCurrentWebViewPackage()
Overrides the system implementation for getting the WebView package.
|
int |
getGoBackInvocations() |
Object |
getJavascriptInterface(String interfaceName) |
Map<String,String> |
getLastAdditionalHttpHeaders() |
String |
getLastEvaluatedJavascript() |
ShadowWebView.LoadData |
getLastLoadData() |
ShadowWebView.LoadDataWithBaseURL |
getLastLoadDataWithBaseURL() |
String |
getLastLoadedUrl() |
protected String |
getOriginalUrl() |
protected WebSettings |
getSettings() |
protected String |
getUrl() |
WebChromeClient |
getWebChromeClient() |
WebViewClient |
getWebViewClient() |
protected void |
goBack() |
protected void |
loadData(String data,
String mimeType,
String encoding) |
protected void |
loadDataWithBaseURL(String baseUrl,
String data,
String mimeType,
String encoding,
String historyUrl) |
protected void |
loadUrl(String url) |
protected void |
loadUrl(String url,
Map<String,String> additionalHttpHeaders) |
protected void |
onPause() |
protected void |
onResume() |
protected void |
removeJavascriptInterface(String name) |
static void |
reset() |
protected WebBackForwardList |
restoreState(Bundle inState) |
protected WebBackForwardList |
saveState(Bundle outState) |
void |
setCanGoBack(boolean canGoBack)
Deprecated.
Do not depend on this method as it will be removed in a future update. The preferered method is to populate a fake web history to use for going back.
|
static void |
setCurrentWebViewPackage(PackageInfo webViewPackageInfo)
Sets the value to return from
#getCurrentWebviewPackage() . |
protected void |
setLayoutParams(ViewGroup.LayoutParams params) |
protected void |
setWebChromeClient(WebChromeClient client) |
static void |
setWebContentsDebuggingEnabled(boolean enabled) |
protected void |
setWebViewClient(WebViewClient client) |
boolean |
wasClearCacheCalled() |
boolean |
wasClearFormDataCalled() |
boolean |
wasClearHistoryCalled() |
boolean |
wasClearViewCalled() |
boolean |
wasDestroyCalled() |
boolean |
wasOnPauseCalled() |
boolean |
wasOnResumeCalled() |
addView, dump, getDisallowInterceptTouchEvent, getInterceptedTouchEvent, innerText, onInterceptTouchEvent, removedChild, requestDisallowInterceptTouchEvent
__constructor__, callOnAttachedToWindow, callOnDetachedFromWindow, checkedPerformClick, clearWasInvalidated, clickOn, didRequestLayout, draw, dump, dump, dumpAttribute, dumpAttributes, dumpFirstPart, dumpIndent, getGlobalVisibleRect, getLastTouchEvent, getLayerType, getOnClickListener, getOnCreateContextMenuListener, getOnLongClickListener, getOnSystemUiVisibilityChangeListener, getOnTouchListener, getScrollX, getScrollY, getWindowId, innerText, invalidate, isAttachedToWindow, lastHapticFeedbackPerformed, onLayout, onLayoutWasCalled, onTouchEvent, performHapticFeedback, post, postDelayed, postInvalidateDelayed, removeCallbacks, requestLayout, scrollBy, scrollTo, setAnimation, setDidRequestLayout, setGlobalVisibleRect, setLayerType, setMyParent, setOnClickListener, setOnCreateContextMenuListener, setOnFocusChangeListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setScrollX, setScrollY, setViewFocus, visualize, wasInvalidated
@HiddenApi @Implementation public void ensureProviderCreated()
@Implementation protected void setLayoutParams(ViewGroup.LayoutParams params)
@Implementation protected void loadUrl(String url)
@Implementation protected void loadUrl(String url, Map<String,String> additionalHttpHeaders)
@Implementation protected void loadDataWithBaseURL(String baseUrl, String data, String mimeType, String encoding, String historyUrl)
@Implementation protected void loadData(String data, String mimeType, String encoding)
public String getLastLoadedUrl()
@Implementation protected String getOriginalUrl()
@Implementation protected String getUrl()
public Map<String,String> getLastAdditionalHttpHeaders()
@Implementation protected WebSettings getSettings()
@Implementation protected void setWebViewClient(WebViewClient client)
@Implementation protected void setWebChromeClient(WebChromeClient client)
public WebViewClient getWebViewClient()
@Implementation protected void addJavascriptInterface(Object obj, String interfaceName)
@Implementation protected void removeJavascriptInterface(String name)
@Implementation protected void clearCache(boolean includeDiskFiles)
public boolean wasClearCacheCalled()
public boolean didClearCacheIncludeDiskFiles()
@Implementation protected void clearFormData()
public boolean wasClearFormDataCalled()
@Implementation protected void clearHistory()
public boolean wasClearHistoryCalled()
@Implementation protected void clearView()
public boolean wasClearViewCalled()
@Implementation protected void onPause()
public boolean wasOnPauseCalled()
@Implementation protected void onResume()
public boolean wasOnResumeCalled()
@Implementation protected void destroy()
public boolean wasDestroyCalled()
public WebChromeClient getWebChromeClient()
@Implementation protected boolean canGoBack()
@Implementation protected void goBack()
@Implementation protected WebBackForwardList copyBackForwardList()
@Implementation protected static String findAddress(String addr)
@Implementation(minSdk=26) protected static PackageInfo getCurrentWebViewPackage()
Overrides the system implementation for getting the WebView package.
Returns null by default, but this can be changed with #setCurrentWebviewPackage()
.
public static void setCurrentWebViewPackage(PackageInfo webViewPackageInfo)
Sets the value to return from #getCurrentWebviewPackage()
.
@Implementation(minSdk=19) protected void evaluateJavascript(String script, ValueCallback<String> callback)
public String getLastEvaluatedJavascript()
@Deprecated public void setCanGoBack(boolean canGoBack)
Sets the value to return from android.webkit.WebView#canGoBack()
canGoBack
- Value to return from android.webkit.WebView#canGoBack()
public int getGoBackInvocations()
android.webkit.WebView#goBack()
was invokedpublic ShadowWebView.LoadData getLastLoadData()
public ShadowWebView.LoadDataWithBaseURL getLastLoadDataWithBaseURL()
@Implementation protected WebBackForwardList saveState(Bundle outState)
@Implementation protected WebBackForwardList restoreState(Bundle inState)
@Resetter public static void reset()
public static void setWebContentsDebuggingEnabled(boolean enabled)