You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by gu...@apache.org on 2017/10/23 10:56:38 UTC

[1/2] incubator-weex git commit: * [android] add switcher to disable box-shadow globally

Repository: incubator-weex
Updated Branches:
  refs/heads/release-0.16 d69658666 -> 10832b11f


* [android] add switcher to disable box-shadow globally


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/696ddc07
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/696ddc07
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/696ddc07

Branch: refs/heads/release-0.16
Commit: 696ddc07f8b0fefc6f827fa92bff601c8f77cf3a
Parents: 64e14b1
Author: misakuo <mi...@apache.org>
Authored: Mon Oct 23 18:12:50 2017 +0800
Committer: misakuo <mi...@apache.org>
Committed: Mon Oct 23 18:12:50 2017 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/ui/component/WXComponent.java    | 10 ++++++++++
 .../java/com/taobao/weex/utils/BoxShadowUtil.java    | 15 +++++++++++++++
 2 files changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/696ddc07/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
index 082c14e..d5aed04 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXComponent.java
@@ -859,6 +859,11 @@ public abstract class  WXComponent<T extends View> implements IWXObject, IWXActi
   }
 
   protected void updateBoxShadow() {
+    if (!BoxShadowUtil.isBoxShadowEnabled()) {
+      WXLogUtils.w("BoxShadow", "box-shadow disabled");
+      return;
+    }
+
     if (getDomObject() != null && getDomObject().getStyles() != null) {
       Object boxShadow = getDomObject().getStyles().get(Constants.Name.BOX_SHADOW);
       Object shadowQuality = getDomObject().getAttrs().get(Constants.Name.SHADOW_QUALITY);
@@ -922,6 +927,11 @@ public abstract class  WXComponent<T extends View> implements IWXObject, IWXActi
   }
 
   protected void clearBoxShadow() {
+    if (!BoxShadowUtil.isBoxShadowEnabled()) {
+      WXLogUtils.w("BoxShadow", "box-shadow disabled");
+      return;
+    }
+
     View target = mHost;
     if (this instanceof WXVContainer) {
       target = ((WXVContainer) this).getBoxShadowHost(true);

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/696ddc07/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java b/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
index d8a9927..229e30d 100644
--- a/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/BoxShadowUtil.java
@@ -60,8 +60,23 @@ import java.util.List;
 
 public class BoxShadowUtil {
   private static final String TAG = "BoxShadowUtil";
+  private static boolean sBoxShadowEnabled = true;
+
+  public static void setBoxShadowEnabled(boolean enabled) {
+    sBoxShadowEnabled = enabled;
+    WXLogUtils.w(TAG, "Switch box-shadow status: " + enabled);
+  }
+
+  public static boolean isBoxShadowEnabled() {
+    return sBoxShadowEnabled;
+  }
 
   public static void setBoxShadow(final View target, String style, float[] radii, int viewPort, final float quality) {
+    if (!sBoxShadowEnabled) {
+      WXLogUtils.w(TAG, "box-shadow was disabled by config");
+      return;
+    }
+
     final BoxShadowOptions options = parseBoxShadow(style, viewPort);
     if (options == null) {
       WXLogUtils.w(TAG, "Failed to parse box-shadow: " + style);


[2/2] incubator-weex git commit: * [android] add switcher to disable box-shadow globally

Posted by gu...@apache.org.
* [android] add switcher to disable box-shadow globally


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/10832b11
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/10832b11
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/10832b11

Branch: refs/heads/release-0.16
Commit: 10832b11f1982a705787267bf4727eb8e4ad609c
Parents: d696586 696ddc0
Author: gurisxie <27...@qq.com>
Authored: Mon Oct 23 18:56:10 2017 +0800
Committer: gurisxie <27...@qq.com>
Committed: Mon Oct 23 18:56:31 2017 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/ui/component/WXComponent.java    | 10 ++++++++++
 .../java/com/taobao/weex/utils/BoxShadowUtil.java    | 15 +++++++++++++++
 2 files changed, 25 insertions(+)
----------------------------------------------------------------------