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

[1/3] incubator-weex git commit: * [android] fix the incorrect image size

Repository: incubator-weex
Updated Branches:
  refs/heads/0.13-dev b33a2fea4 -> 59062f36c


* [android] fix the incorrect image size


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

Branch: refs/heads/0.13-dev
Commit: 73f1038f6a1ed82f84b983a404447350a24bb778
Parents: 42f2a85
Author: moxun.ljf <fu...@foxmail.com>
Authored: Wed May 3 11:17:41 2017 +0800
Committer: moxun.ljf <fu...@foxmail.com>
Committed: Wed May 3 11:17:41 2017 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/ui/view/WXImageView.java    | 31 +++++++++++++++++---
 1 file changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/73f1038f/android/sdk/src/main/java/com/taobao/weex/ui/view/WXImageView.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXImageView.java b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXImageView.java
index 32baa00..dd7b2bc 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/view/WXImageView.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/view/WXImageView.java
@@ -32,6 +32,7 @@ import com.taobao.weex.ui.component.WXImage;
 import com.taobao.weex.ui.view.gesture.WXGesture;
 import com.taobao.weex.ui.view.gesture.WXGestureObservable;
 import com.taobao.weex.utils.ImageDrawable;
+import com.taobao.weex.utils.WXLogUtils;
 
 import java.lang.ref.WeakReference;
 import java.util.Arrays;
@@ -130,8 +131,19 @@ public class WXImageView extends ImageView implements WXGestureObservable,
   @Override
   public int getNaturalWidth() {
     Drawable drawable = getDrawable();
-    if (drawable != null && drawable instanceof ImageDrawable) {
-      return ((ImageDrawable) drawable).getBitmapWidth();
+    if (drawable != null) {
+      if (drawable instanceof ImageDrawable) {
+        return ((ImageDrawable) drawable).getBitmapWidth();
+      } else if (drawable instanceof BitmapDrawable) {
+        Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
+        if (bitmap != null) {
+          return bitmap.getWidth();
+        } else {
+          WXLogUtils.w("WXImageView", "Bitmap on " + drawable.toString() + " is null");
+        }
+      } else {
+        WXLogUtils.w("WXImageView", "Not supported drawable type: " + drawable.getClass().getSimpleName());
+      }
     }
     return -1;
   }
@@ -139,8 +151,19 @@ public class WXImageView extends ImageView implements WXGestureObservable,
   @Override
   public int getNaturalHeight() {
     Drawable drawable = getDrawable();
-    if (drawable != null && drawable instanceof ImageDrawable) {
-      return ((ImageDrawable) drawable).getBitmapHeight();
+    if (drawable != null) {
+      if (drawable instanceof ImageDrawable) {
+        return ((ImageDrawable) drawable).getBitmapHeight();
+      } else if (drawable instanceof BitmapDrawable) {
+        Bitmap bitmap = ((BitmapDrawable) drawable).getBitmap();
+        if (bitmap != null) {
+          return bitmap.getHeight();
+        } else {
+          WXLogUtils.w("WXImageView", "Bitmap on " + drawable.toString() + " is null");
+        }
+      } else {
+        WXLogUtils.w("WXImageView", "Not supported drawable type: " + drawable.getClass().getSimpleName());
+      }
     }
     return -1;
   }


[2/3] incubator-weex git commit: Merge branch 'android-bugfix-imagesize' of github.com:misakuo/incubator-weex into 0.13-dev

Posted by so...@apache.org.
Merge branch 'android-bugfix-imagesize' of github.com:misakuo/incubator-weex into 0.13-dev


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

Branch: refs/heads/0.13-dev
Commit: e795fd5d18cef2e676774b45b4a85f3e811e7b28
Parents: bb33a75 73f1038
Author: sospartan <so...@apache.org>
Authored: Thu May 4 13:54:26 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Thu May 4 13:54:26 2017 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/ui/view/WXImageView.java    | 31 +++++++++++++++++---
 1 file changed, 27 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



[3/3] incubator-weex git commit: Merge branch '0.13-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.13-dev

Posted by so...@apache.org.
Merge branch '0.13-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.13-dev


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

Branch: refs/heads/0.13-dev
Commit: 59062f36c14c00da3988fa4424de6e0c1e0674cb
Parents: e795fd5 b33a2fe
Author: sospartan <so...@apache.org>
Authored: Thu May 4 13:54:38 2017 +0800
Committer: sospartan <so...@apache.org>
Committed: Thu May 4 13:54:38 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m | 69 ++++++++++++++++----
 .../WeexSDK/Sources/Component/WXAComponent.m    |  8 +--
 .../Sources/Component/WXImageComponent.m        |  9 ++-
 .../Sources/Component/WXVideoComponent.m        | 12 ++--
 .../WeexSDK/Sources/Component/WXWebComponent.m  | 10 +--
 ios/sdk/WeexSDK/Sources/Manager/WXRuleManager.m |  8 +--
 ios/sdk/WeexSDK/Sources/Module/WXStreamModule.m |  6 +-
 .../Sources/Protocol/WXURLRewriteProtocol.h     |  5 +-
 test/scripts/util.js                            |  2 +-
 9 files changed, 90 insertions(+), 39 deletions(-)
----------------------------------------------------------------------