public class XWalkView
extends android.widget.FrameLayout
XWalkView represents an Android view for web apps/pages. Thus most of attributes
for Android view are valid for this class. Since it internally uses
android.view.SurfaceView for rendering web pages by default, it can't be resized,
rotated, transformed and animated due to the limitations of SurfaceView.
Alternatively, if the preference key XWalkPreferences.ANIMATABLE_XWALK_VIEW
is set to True, XWalkView can be transformed and animated because
TextureView is intentionally used to render web pages for animation support.
Besides, XWalkView won't be rendered if it's invisible.
XWalkView needs hardware acceleration to render web pages. As a result, the AndroidManifest.xml of the caller's app must be appended with the attribute "android:hardwareAccelerated" and its value must be set as "true".
<application android:name="android.app.Application" android:label="XWalkUsers" android:hardwareAccelerated="true">
Crosswalk provides 2 major callback classes, namely XWalkResourceClient
and
XWalkUIClient
for listening to the events related to resource loading and UI.
By default, Crosswalk has a default implementation. Callers can override them if needed.
Unlike other Android views, this class has to listen to system events like intents and activity result. The web engine inside this view need to get and handle them. With contianer activity's lifecycle change, XWalkView will pause all timers and other components like videos when activity paused, resume back them when activity resumed. When activity is about to destroy, XWalkView will destroy itself as well. Embedders can also call onHide() and pauseTimers() to explicitly pause XWalkView. Similarily with onShow(), resumeTimers() and onDestroy(). For example:
import android.app.Activity; import android.os.Bundle; import org.xwalk.core.internal.XWalkResourceClient; import org.xwalk.core.internal.XWalkUIClient; import org.xwalk.core.internal.XWalkView; public class MyActivity extends Activity { XWalkView mXwalkView; class MyResourceClient extends XWalkResourceClient { MyResourceClient(XWalkView view) { super(view); } @Override WebResourceResponse shouldInterceptLoadRequest(XWalkView view, String url) { // Handle it here. ... } } class MyUIClient extends XWalkUIClient { MyUIClient(XWalkView view) { super(view); } @Override void onFullscreenToggled(XWalkView view, String url) { // Handle it here. ... } } @Override protected void onCreate(Bundle savedInstanceState) { mXwalkView = new XWalkView(this, null); setContentView(mXwalkView); mXwalkView.setResourceClient(new MyResourceClient(mXwalkView)); mXwalkView.setUIClient(new MyUIClient(mXwalkView)); mXwalkView.load("http://www.crosswalk-project.org", null); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (mXwalkView != null) { mXwalkView.onActivityResult(requestCode, resultCode, data); } } @Override protected void onNewIntent(Intent intent) { if (mXwalkView != null) { mXwalkView.onNewIntent(intent); } } }
android.widget.FrameLayout.LayoutParams
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
Modifier and Type | Field and Description |
---|---|
static int |
RELOAD_IGNORE_CACHE
Reload mode with bypassing the cache.
|
static int |
RELOAD_NORMAL
Normal reload mode as default.
|
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y
Constructor and Description |
---|
XWalkView(android.content.Context context,
android.app.Activity activity)
Constructor for Crosswalk runtime.
|
XWalkView(android.content.Context context,
android.util.AttributeSet attrs)
Constructor for inflating via XML.
|
Modifier and Type | Method and Description |
---|---|
void |
addJavascriptInterface(java.lang.Object object,
java.lang.String name)
Injects the supplied Java object into this XWalkView.
|
void |
clearCache(boolean includeDiskFiles)
Clear the resource cache.
|
void |
evaluateJavascript(java.lang.String script,
android.webkit.ValueCallback<java.lang.String> callback)
Evaluate a fragment of JavaScript code and get the result via callback.
|
java.lang.String |
getAPIVersion() |
XWalkNavigationHistory |
getNavigationHistory()
Get the navigation history for current XWalkView.
|
java.lang.String |
getOriginalUrl()
Get the original url specified by caller.
|
java.lang.String |
getTitle()
Get the title of current web page/app.
|
java.lang.String |
getUrl()
Get the url of current web page/app.
|
java.lang.String |
getXWalkVersion() |
boolean |
hasEnteredFullscreen()
Indicate that a HTML element is occupying the whole screen.
|
void |
leaveFullscreen()
Leave fullscreen mode if it's.
|
void |
load(java.lang.String url,
java.lang.String content)
Load a web page/app from a given base URL or a content.
|
void |
loadAppFromManifest(java.lang.String url,
java.lang.String content)
Load a web app from a given manifest.json file.
|
void |
onActivityResult(int requestCode,
int resultCode,
android.content.Intent data)
Pass through activity result to XWalkView.
|
void |
onDestroy()
Release internal resources occupied by this XWalkView.
|
void |
onHide()
Pause many other things except JavaScript timers inside rendering engine,
like video player, modal dialogs, etc.
|
boolean |
onNewIntent(android.content.Intent intent)
Pass through intents to XWalkView.
|
void |
onShow()
Resume video player, modal dialogs.
|
void |
pauseTimers()
Pause all layout, parsing and JavaScript timers for all XWalkView instances.
|
void |
reload(int mode)
Reload a web app with a given mode.
|
boolean |
restoreState(android.os.Bundle inState)
Restore the state from the saved bundle data.
|
void |
resumeTimers()
Resume all layout, parsing and JavaScript timers for all XWalkView instances.
|
boolean |
saveState(android.os.Bundle outState)
Save current internal state of this XWalkView.
|
void |
setNetworkAvailable(boolean networkUp)
This method is used by Cordova for hacking.
|
void |
setResourceClient(XWalkResourceClient client)
Embedders use this to customize their handlers to events/callbacks related
to resource loading.
|
void |
setUIClient(XWalkUIClient client)
Embedders use this to customize their handlers to events/callbacks related
to UI.
|
void |
stopLoading()
Stop current loading progress.
|
checkLayoutParams, draw, drawableStateChanged, gatherTransparentRegion, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getConsiderGoneChildrenWhenMeasuring, getForeground, getForegroundGravity, getMeasureAllChildren, jumpDrawablesToCurrentState, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onLayout, onMeasure, onSizeChanged, setForeground, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState, verifyDrawable
addChildrenForAccessibility, addFocusables, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getOverlay, getPersistentDrawingCache, hasFocus, hasFocusable, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAnimationEnd, onAnimationStart, onAttachedToWindow, onCreateDrawableState, onDetachedFromWindow, onInterceptHoverEvent, onInterceptTouchEvent, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollX, getScrollY, getSolidColor, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTranslationX, getTranslationY, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, hasOnClickListeners, hasOverlappingRendering, hasWindowFocus, inflate, initializeFadingEdge, initializeScrollbars, invalidate, invalidate, invalidate, invalidateDrawable, isActivated, isAttachedToWindow, isClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPopulateAccessibilityEvent, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onScrollChanged, onSetAlpha, onStartTemporaryDetach, onTouchEvent, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBottom, setCameraDistance, setClickable, setClipBounds, setContentDescription, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTranslationX, setTranslationY, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, showContextMenu, startActionMode, startAnimation, startDrag, toString, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, requestFitSystemWindows, requestLayout
public static final int RELOAD_NORMAL
public static final int RELOAD_IGNORE_CACHE
public XWalkView(android.content.Context context, android.util.AttributeSet attrs)
context
- a Context object used to access application assets.attrs
- an AttributeSet passed to our parent.public XWalkView(android.content.Context context, android.app.Activity activity)
context
- a Context object used to access application assetsactivity
- the activity for this XWalkView.public void load(java.lang.String url, java.lang.String content)
getUrl()
.
If content is null, try to load the content from the url.
It supports URL schemes like 'http:', 'https:' and 'file:'.
It can also load files from Android assets, e.g. 'file:///android_asset/'.url
- the url for web page/app.content
- the content for the web page/app. Could be empty.public void loadAppFromManifest(java.lang.String url, java.lang.String content)
url
- the url for manifest.json.content
- the content for manifest.json.public void reload(int mode)
mode
- the reload mode.public void stopLoading()
public java.lang.String getUrl()
public java.lang.String getTitle()
public java.lang.String getOriginalUrl()
public XWalkNavigationHistory getNavigationHistory()
public void addJavascriptInterface(java.lang.Object object, java.lang.String name)
JavascriptInterface
if it's called by JavaScript.object
- the supplied Java object, called by JavaScript.name
- the name injected in JavaScript.public void evaluateJavascript(java.lang.String script, android.webkit.ValueCallback<java.lang.String> callback)
script
- the JavaScript string.callback
- the callback to handle the evaluated result.public void clearCache(boolean includeDiskFiles)
includeDiskFiles
- indicate whether to clear disk files for cache.public boolean hasEnteredFullscreen()
public void leaveFullscreen()
public void pauseTimers()
public void resumeTimers()
public void onHide()
pauseTimers()
about pausing
JavaScript timers.
It will be called when the container Activity get paused. It can also be explicitly
called to pause above things.public void onShow()
public void onDestroy()
public void onActivityResult(int requestCode, int resultCode, android.content.Intent data)
requestCode
- passed from android.app.Activity.onActivityResult().resultCode
- passed from android.app.Activity.onActivityResult().data
- passed from android.app.Activity.onActivityResult().public boolean onNewIntent(android.content.Intent intent)
intent
- passed from android.app.Activity.onNewIntent().public boolean saveState(android.os.Bundle outState)
outState
- the saved state for restoring.public boolean restoreState(android.os.Bundle inState)
inState
- the state saved from saveState().public java.lang.String getAPIVersion()
public java.lang.String getXWalkVersion()
public void setUIClient(XWalkUIClient client)
client
- the XWalkUIClient defined by callers.public void setResourceClient(XWalkResourceClient client)
client
- the XWalkResourceClient defined by callers.public void setNetworkAvailable(boolean networkUp)