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 07:23:21 UTC

[03/11] incubator-weex git commit: * [android] draw box-shadow on ViewGroup directly

* [android] draw box-shadow on ViewGroup directly


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

Branch: refs/heads/release-0.16
Commit: b6001a095b5883a5b848e21b5e2fae03177d313a
Parents: 3ecabc5
Author: misakuo <mi...@apache.org>
Authored: Thu Oct 19 17:45:23 2017 +0800
Committer: jianbai.gbj <ji...@alibaba-inc.com>
Committed: Mon Oct 23 10:02:35 2017 +0800

----------------------------------------------------------------------
 .../taobao/weex/ui/component/WXVContainer.java  | 40 +-------------------
 1 file changed, 1 insertion(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b6001a09/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
index c695e12..8ef4060 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXVContainer.java
@@ -18,7 +18,6 @@
  */
 package com.taobao.weex.ui.component;
 
-import android.content.Context;
 import android.content.Intent;
 import android.support.annotation.RestrictTo;
 import android.support.annotation.RestrictTo.Scope;
@@ -32,9 +31,6 @@ import android.view.ViewGroup;
 import com.taobao.weex.WXSDKInstance;
 import com.taobao.weex.common.Constants;
 import com.taobao.weex.dom.WXDomObject;
-import com.taobao.weex.ui.view.WXFrameLayout;
-import com.taobao.weex.utils.WXLogUtils;
-import com.taobao.weex.utils.WXViewUtils;
 
 import java.util.ArrayList;
 
@@ -45,7 +41,6 @@ public abstract class WXVContainer<T extends ViewGroup> extends WXComponent<T> {
 
   private static final String TAG="WXVContainer";
   protected ArrayList<WXComponent> mChildren = new ArrayList<>();
-  private BoxShadowHost mBoxShadowHost;
 
   @Deprecated
   public WXVContainer(WXSDKInstance instance, WXDomObject dom, WXVContainer parent, String instanceId, boolean isLazy) {
@@ -487,39 +482,6 @@ public abstract class WXVContainer<T extends ViewGroup> extends WXComponent<T> {
    ********************************************************/
 
   public @Nullable View getBoxShadowHost(boolean isClear) {
-    if (isClear) {
-      // Return existed host if want clear shadow
-      return mBoxShadowHost;
-    }
-
-    ViewGroup hostView = getHostView();
-    if (hostView == null) {
-      return null;
-    }
-
-    if (!(hostView instanceof WXFrameLayout)) {
-      return hostView;
-    }
-
-    try {
-      if (mBoxShadowHost == null) {
-        mBoxShadowHost = new BoxShadowHost(getContext());
-        WXViewUtils.setBackGround(mBoxShadowHost, null);
-        mBoxShadowHost.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
-        hostView.addView(mBoxShadowHost);
-      }
-      hostView.removeView(mBoxShadowHost);
-      hostView.addView(mBoxShadowHost);
-      return mBoxShadowHost;
-    } catch (Throwable t) {
-      WXLogUtils.w("BoxShadow", t);
-    }
-    return hostView;
-  }
-
-  private class BoxShadowHost extends View {
-    public BoxShadowHost(Context context) {
-      super(context);
-    }
+    return getHostView();
   }
 }