本文整理汇总了Java中org.xwalk.core.XWalkPreferences.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java XWalkPreferences.setValue方法的具体用法?Java XWalkPreferences.setValue怎么用?Java XWalkPreferences.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.xwalk.core.XWalkPreferences
的用法示例。
在下文中一共展示了XWalkPreferences.setValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setGlobalPrefs
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
private static Context setGlobalPrefs(Context context, CordovaPreferences preferences) {
if (!hasSetStaticPref) {
hasSetStaticPref = true;
ApplicationInfo ai = null;
try {
ai = context.getPackageManager().getApplicationInfo(context.getApplicationContext().getPackageName(), PackageManager.GET_META_DATA);
} catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException(e);
}
boolean prefAnimatable = preferences == null ? false : preferences.getBoolean("CrosswalkAnimatable", false);
boolean manifestAnimatable = ai.metaData == null ? false : ai.metaData.getBoolean("CrosswalkAnimatable");
// Selects between a TextureView (obeys framework transforms applied to view) or a SurfaceView (better performance).
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, prefAnimatable || manifestAnimatable);
if ((ai.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
}
XWalkPreferences.setValue(XWalkPreferences.JAVASCRIPT_CAN_OPEN_WINDOW, true);
XWalkPreferences.setValue(XWalkPreferences.ALLOW_UNIVERSAL_ACCESS_FROM_FILE, true);
}
return context;
}
示例2: onCreateView
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// View rootView = inflater.inflate(R.layout.fragment_e1zone, container, false);
// return rootView;
View v = inflater.inflate(R.layout.fragment_e1zone, container, false);
mXWalkView = (XWalkView) v.findViewById(R.id.xwalkview);
//enable remote debugging
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
xWalkCookieManager =new XWalkCookieManager();
xWalkCookieManager.setAcceptCookie(true);
//load extra from intent and set cookie to xwalkview
xWalkCookieManager.removeAllCookie();
String[] cookieArray = getActivity().getIntent().getStringArrayExtra("cookieArray");
for (String aCookieArray : cookieArray)
xWalkCookieManager.setCookie(getString(R.string.host_url), aCookieArray);
//start
mXWalkView.load(mUrl,null);
return v;
}
示例3: onCreate
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
@Override
public void onCreate(){
// Possible XWalk fix
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, false);
configureJobManager();
pluginManager = new PluginManager();
preferences = getSharedPreferences("baker.app", 0);
if(Configuration.isStandaloneMode()) {
issueCollection = new LocalIssueCollection();
}else{
issueCollection = new RemoteIssueCollection();
}
licenceManager = new LicenceManager();
}
示例4: onXWalkReady
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
protected void onXWalkReady() {
isXWalkReady = true;
xWalkView.getSettings().setUserAgentString(userAgentString());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE)){
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
}
}
xWalkView.addJavascriptInterface(this, "AndroidInterface");
displayScreenContent();
deepLinkWhenPresent();
}
示例5: onCreate
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, true);
XWalkPreferences.setValue(XWalkPreferences.ENABLE_THEME_COLOR, false);
}
示例6: onCreate
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, true);
setContentView(R.layout.activity_main);
PreferenceManager.setDefaultValues(this,R.xml.preference,false); //reade preference first
SharedPreferences sharedPreferences = this.getPreferences(Context.MODE_PRIVATE);
mxWalkViewFragment = new XWalkViewFragment();
//set up drawer
NavigationDrawerFragment mNavigationDrawerFragment = (NavigationDrawerFragment)
getFragmentManager().findFragmentById(R.id.navigation_drawer);
//Start the Fragments
if (savedInstanceState == null){
// if(!sharedPreferences.getBoolean("LOGGED_IN",false)){ //if user is not logged in. show login welcome screen
// //Todo ...
// Intent loginIntent = new Intent(this,LoginActivity.class);
// startActivity(loginIntent);
// }else{
getFragmentManager().beginTransaction()
.add(R.id.main_container, mxWalkViewFragment)
.commit();
mxWalkViewFragment.setUrl(getString(R.string.host_url));
// }
//set URL to the Fragment
}
}
示例7: onCreate
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
xWalkWebView=(XWalkView)findViewById(R.id.xwalkWebView);
// turn on debugging
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
}
示例8: initWebViewSettings
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
@SuppressLint("SetJavaScriptEnabled")
private void initWebViewSettings() {
webview.setVerticalScrollBarEnabled(false);
// TODO: The Activity is the one that should call requestFocus().
if (shouldRequestFocusOnInit()) {
this.webview.requestFocusFromTouch();
}
// Enable JavaScript
final XWalkSettings settings = this.webview.getSettings();
settings.setJavaScriptEnabled(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setAllowUniversalAccessFromFileURLs(true);
// Enable database
// We keep this disabled because we use or shim to get around DOM_EXCEPTION_ERROR_16
String databasePath = webview.getContext().getApplicationContext().getDir("database", Context.MODE_PRIVATE).getPath();
//settings.setDatabaseEnabled(true);
//TODO: bring it back when it's ready in the XWalk.
//settings.setDatabasePath(databasePath);
//Determine whether we're in debug or release mode, and turn on Debugging!
ApplicationInfo appInfo = webview.getContext().getApplicationContext().getApplicationInfo();
if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) {
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
}
// Enable DOM storage
settings.setDomStorageEnabled(true);
// Enable built-in geolocation
settings.setGeolocationEnabled(true);
// Enable AppCache
// Fix for CB-2282
settings.setAppCachePath(databasePath);
settings.setAppCacheEnabled(true);
}
示例9: onCreate
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_xwalk);
if (BuildConfig.DEBUG) {
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
}
mWebView = (XWalkView) findViewById(R.id.webView);
mWebView.load("https://get.webgl.org", null);
}
示例10: enableRemoteDebugging
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
public void enableRemoteDebugging() {
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
}
示例11: onCreate
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Hide the Top Title
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_nocdisplay);
final View controlsView = findViewById(R.id.fullscreen_content_controls);
final View contentView = findViewById(R.id.xwalkWebView);
XWalkView xWalkWebView =(XWalkView)findViewById(R.id.xwalkWebView);
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, true);
JSONConfig jdata = new JSONConfig(this);
jdata.execute();
// Set up an instance of SystemUiHider to control the system UI for
// this activity.
mSystemUiHider = SystemUiHider.getInstance(this, contentView, HIDER_FLAGS);
mSystemUiHider.setup();
mSystemUiHider
.setOnVisibilityChangeListener(new SystemUiHider.OnVisibilityChangeListener() {
// Cached values.
int mControlsHeight;
int mShortAnimTime;
@Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
public void onVisibilityChange(boolean visible) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR2) {
// If the ViewPropertyAnimator API is available
// (Honeycomb MR2 and later), use it to animate the
// in-layout UI controls at the bottom of the
// screen.
if (mControlsHeight == 0) {
mControlsHeight = controlsView.getHeight();
}
if (mShortAnimTime == 0) {
mShortAnimTime = getResources().getInteger(
android.R.integer.config_shortAnimTime);
}
controlsView.animate()
.translationY(visible ? 0 : mControlsHeight)
.setDuration(mShortAnimTime);
} else {
// If the ViewPropertyAnimator APIs aren't
// available, simply show or hide the in-layout UI
// controls.
controlsView.setVisibility(visible ? View.VISIBLE : View.GONE);
}
if (visible && AUTO_HIDE) {
// Schedule a hide().
delayedHide(AUTO_HIDE_DELAY_MILLIS);
}
}
});
// Set up the user interaction to manually show or hide the system UI.
contentView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (TOGGLE_ON_CLICK) {
mSystemUiHider.toggle();
} else {
mSystemUiHider.show();
}
}
});
// Upon interacting with UI controls, delay any scheduled hide()
// operations to prevent the jarring behavior of controls going away
// while interacting with the UI.
//findViewById(R.id.dummy_button).setOnTouchListener(mDelayHideTouchListener);
}
示例12: initInApplication
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
public static void initInApplication(Context context) {
XWalkPreferences.setValue(XWalkPreferences.ALLOW_UNIVERSAL_ACCESS_FROM_FILE, true);
XWalkPreferences.setValue(XWalkPreferences.SUPPORT_MULTIPLE_WINDOWS, true);
XWalkPreferences.setValue(XWalkPreferences.JAVASCRIPT_CAN_OPEN_WINDOW, true);
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW,true);//设置TextureView为默认的渲染方式,
}
示例13: setRemoteDebug
import org.xwalk.core.XWalkPreferences; //导入方法依赖的package包/类
public void setRemoteDebug(boolean debug) {
XWalkPreferences.setValue(XWalkPreferences.REMOTE_DEBUGGING, debug);
}