public final class

XWalkPreferences

extends XWalkPreferencesInternal
java.lang.Object
   ↳ XWalkPreferencesInternal
     ↳ org.xwalk.core.XWalkPreferences

Class Overview

This class represents the preferences and could be set by callers. It is not thread-safe and must be called on the UI thread. Afterwards, the preference could be read from all threads and can impact all XWalkView instances.

Summary

Constants
String ANIMATABLE_XWALK_VIEW The key string to enable/disable animatable XWalkView.
String REMOTE_DEBUGGING The key string to enable/disable remote debugging.
Public Constructors
XWalkPreferences()
Public Methods
synchronized static boolean getValue(String key)
Get a preference value from Crosswalk.
synchronized static void setValue(String key, boolean enabled)
Set a preference value into Crosswalk.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ANIMATABLE_XWALK_VIEW

The key string to enable/disable animatable XWalkView. Default value is false. If this key is set to True, the XWalkView created by Crosswalk can be transformed and animated. Internally, Crosswalk is alternatively using TextureView as the backend of XWalkView. TextureView is a kind of android.view.View that is different from SurfaceView. Unlike SurfaceView, it can be resized, transformed and animated. Once this key is set to True, all XWalkView will use TextureView as the rendering target instead of SurfaceView. The downside of TextureView is, it would consume more graphics memory than SurfaceView and may have 1~3 extra frames of latency to display updates. Note this key MUST be set before creating the first XWalkView, otherwise a RuntimeException will be thrown.

Constant Value: "animatable-xwalk-view"

public static final String REMOTE_DEBUGGING

The key string to enable/disable remote debugging.

Constant Value: "remote-debugging"

Public Constructors

public XWalkPreferences ()

Public Methods

public static synchronized boolean getValue (String key)

Get a preference value from Crosswalk. An exception will be thrown if the key for the preference is not valid.

Parameters
key the string name of the key.
Returns
  • true if it's enabled.
Throws
RuntimeException

public static synchronized void setValue (String key, boolean enabled)

Set a preference value into Crosswalk. An exception will be thrown if the key for the preference is not valid.

Parameters
key the string name of the key.
enabled true if setting it as enabled.
Throws
RuntimeException