You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/22 08:37:00 UTC

[jira] [Commented] (WEEX-199) Add Global Switch Control Wson on or off

    [ https://issues.apache.org/jira/browse/WEEX-199?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16334025#comment-16334025 ] 

ASF GitHub Bot commented on WEEX-199:
-------------------------------------

GitHub user gubaojian opened a pull request:

    https://github.com/apache/incubator-weex/pull/995

    [WEEX-199][android] Add Global Switch Control Wson on or off

    [WEEX-199][android] Add Global Switch Control Wson on or off

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gubaojian/incubator-weex release-0.17-wson-switch

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-weex/pull/995.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #995
    
----
commit cb452bf5bac1e22f2ca2be9043d2b6220ea25bb3
Author: jianbai.gbj <ji...@...>
Date:   2018-01-22T06:25:29Z

    [WEEX-199][android] Add Global Switch Control Wson on or off

----


> Add Global Switch Control Wson on or off
> ----------------------------------------
>
>                 Key: WEEX-199
>                 URL: https://issues.apache.org/jira/browse/WEEX-199
>             Project: Weex
>          Issue Type: Improvement
>            Reporter: codefurture
>            Assignee: Adam Feng
>            Priority: Trivial
>
> Add Global Switch Control Wson on or off
>  
> public static void updateGlobalConfig(String config){
>  if(TextUtils.isEmpty(config)){
>  config = "none";
>  }
>  if(!TextUtils.equals(config, globalConfig)){
>  globalConfig = config;
>  WXEnvironment.getCustomOptions().put(GLOBAL_CONFIG_KEY, globalConfig);
>  Runnable runnable = new Runnable() {
>  @Override
>  public void run() {
>  if(mBridgeManager != null){
>  if(mBridgeManager.isJSFrameworkInit()){
>  if(mBridgeManager.mWXBridge instanceof WXBridge) {
>  final WXBridge bridge = (WXBridge) mBridgeManager.mWXBridge;
>  bridge.updateGlobalConfig(globalConfig);
>  }
>  }
>  }
>  if(globalConfig.contains("wson_off")){
>  WXJsonUtils.USE_WSON = false;
>  }else{
>  WXJsonUtils.USE_WSON = true;
>  }
>  }
>  };
>  if(mBridgeManager != null && mBridgeManager.isJSFrameworkInit()){
>  mBridgeManager.post(runnable);
>  }else{
>  runnable.run();
>  }
>  }
> }



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)