You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by zs...@apache.org on 2017/07/27 02:28:01 UTC

[1/4] incubator-weex git commit: * [android] RecyclerView Memory optimization

Repository: incubator-weex
Updated Branches:
  refs/heads/0.15-dev 821164cfa -> 5cb9fc7eb


* [android] RecyclerView Memory optimization


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

Branch: refs/heads/0.15-dev
Commit: 1a871981d0d8af344f4abb8ca1fe927f0d4848c7
Parents: f63bf2c
Author: miomin <69...@qq.com>
Authored: Tue Jul 25 16:51:32 2017 +0800
Committer: miomin <69...@qq.com>
Committed: Tue Jul 25 16:51:32 2017 +0800

----------------------------------------------------------------------
 .../weex/ui/component/list/BasicListComponent.java    | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/1a871981/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
index bdec22e..b85ec21 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
@@ -92,6 +92,7 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
   private int mListCellCount = 0;
   private boolean mForceLoadmoreNextTime = false;
   private ArrayList<ListBaseViewHolder> recycleViewList = new ArrayList<>();
+  private static int visibleCellCount = 6;
   private static final Pattern transformPattern = Pattern.compile("([a-z]+)\\(([0-9\\.]+),?([0-9\\.]+)?\\)");
 
   private Map<String, AppearanceHelper> mAppearComponents = new HashMap<>();
@@ -818,11 +819,18 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
     if(holder.canRecycled()) {
       recycleViewList.add(holder);
 
+      // recycleViewList allowed max size
+      int threshold = visibleCellCount >= 6 ? (visibleCellCount * 6) : (6*6);
+
       /**
-       * Recycle cache{@link recycleViewList} when recycleViewList.size() > list max child count
+       * Recycle cache{@link recycleViewList} when recycleViewList.size() > list max child count or threshold
        */
-      if (recycleViewList.size() > getChildCount() + 1)
+      if (recycleViewList.size() > getChildCount() + 1 || recycleViewList.size() >= threshold) {
+        WXLogUtils.d(TAG, "Recycle holder list recycled : cache size is " + recycleViewList.size() +
+                ", visibleCellCount is " + visibleCellCount + ", threshold is " + threshold +
+                ", child count is " + getChildCount());
         recycleViewHolderList();
+      }
     } else {
       WXLogUtils.w(TAG, "this holder can not be allowed to  recycled" );
     }
@@ -1188,6 +1196,8 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
       direction = directionX > 0 ? Constants.Value.DIRECTION_LEFT : Constants.Value.DIRECTION_RIGHT;
     }
 
+    visibleCellCount = lastVisible - firstVisible;
+
     while (it.hasNext()) {
       AppearanceHelper item = it.next();
       WXComponent component = item.getAwareChild();


[4/4] incubator-weex git commit: Merge branch '0.15-dev-xy' into 0.15-dev

Posted by zs...@apache.org.
Merge branch '0.15-dev-xy' into 0.15-dev

* 0.15-dev-xy:
  * [android] visibleCellCount need to be considered columnCount
  * [android] RecyclerView Memory optimization


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

Branch: refs/heads/0.15-dev
Commit: 5cb9fc7eb37f5edbc62d17246082f2fae5ff13d1
Parents: 821164c 0bf8ebe
Author: zshshr <zh...@gmail.com>
Authored: Thu Jul 27 10:27:28 2017 +0800
Committer: zshshr <zh...@gmail.com>
Committed: Thu Jul 27 10:27:28 2017 +0800

----------------------------------------------------------------------
 .../weex/ui/component/list/BasicListComponent.java   | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[2/4] incubator-weex git commit: * [android] visibleCellCount need to be considered columnCount

Posted by zs...@apache.org.
* [android] visibleCellCount need to be considered columnCount


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

Branch: refs/heads/0.15-dev
Commit: b9116490531918754565f8b9fddd6e44393c6786
Parents: 1a87198
Author: miomin <69...@qq.com>
Authored: Tue Jul 25 17:04:17 2017 +0800
Committer: miomin <69...@qq.com>
Committed: Tue Jul 25 17:04:17 2017 +0800

----------------------------------------------------------------------
 .../com/taobao/weex/ui/component/list/BasicListComponent.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b9116490/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
index b85ec21..c959351 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java
@@ -1196,7 +1196,8 @@ public abstract class BasicListComponent<T extends ViewGroup & ListComponentView
       direction = directionX > 0 ? Constants.Value.DIRECTION_LEFT : Constants.Value.DIRECTION_RIGHT;
     }
 
-    visibleCellCount = lastVisible - firstVisible;
+    if (mColumnCount > 0)
+      visibleCellCount = (lastVisible - firstVisible) * mColumnCount;
 
     while (it.hasNext()) {
       AppearanceHelper item = it.next();


[3/4] incubator-weex git commit: Merge branch '0.15-dev' of https://github.com/apache/incubator-weex into 0.15-dev

Posted by zs...@apache.org.
Merge branch '0.15-dev' of https://github.com/apache/incubator-weex into 0.15-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/0bf8ebe6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/0bf8ebe6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/0bf8ebe6

Branch: refs/heads/0.15-dev
Commit: 0bf8ebe6b6078187971553dffe7a501d0f650405
Parents: b911649 ee9b1c7
Author: miomin <69...@qq.com>
Authored: Wed Jul 26 16:37:14 2017 +0800
Committer: miomin <69...@qq.com>
Committed: Wed Jul 26 16:37:14 2017 +0800

----------------------------------------------------------------------
 examples/vue/components/input.vue               |  17 +
 html5/test/render/vue/core/node.js              |  10 +-
 .../render/vue/data/dotvue/event-bubble-bar.vue |  11 -
 .../render/vue/data/dotvue/event-bubble.vue     |  11 -
 .../WeexDemo.xcodeproj/project.pbxproj          |   4 +
 ios/playground/WeexDemo/WXDemoViewController.m  |   2 +-
 ios/sdk/WeexSDK.xcodeproj/project.pbxproj       |   8 +
 .../WeexSDK/Sources/Bridge/WXBridgeContext.m    |  34 +-
 ios/sdk/WeexSDK/Sources/Bridge/WXBridgeMethod.m |  16 +-
 ios/sdk/WeexSDK/Sources/Bridge/WXJSCoreBridge.m |  33 +-
 .../WeexSDK/Sources/Component/WXEditComponent.m |   2 +-
 .../Sources/Component/WXImageComponent.m        |   1 +
 .../Sources/Component/WXScrollerComponent.m     |   1 +
 .../WeexSDK/Sources/Component/WXTextComponent.m |   1 +
 .../Sources/Manager/WXComponentManager.m        |   5 +-
 .../WeexSDK/Sources/Manager/WXTracingManager.h  | 126 ++++++
 .../WeexSDK/Sources/Manager/WXTracingManager.m  | 384 +++++++++++++++++++
 ios/sdk/WeexSDK/Sources/Model/WXComponent.m     |   3 +
 .../WeexSDK/Sources/Model/WXJSExceptionInfo.h   |   1 +
 ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m   |   7 +
 .../WeexSDK/Sources/Module/WXAnimationModule.m  |   7 +-
 ios/sdk/WeexSDK/Sources/Module/WXDomModule.m    |   4 +-
 .../WeexSDK/Sources/Protocol/WXBridgeProtocol.h |   5 +
 ios/sdk/WeexSDK/Sources/Utility/WXLog.m         |   8 +
 .../Sources/View/WXComponent+ViewManagement.m   |   3 +-
 ios/sdk/WeexSDK/Sources/WeexSDK.h               |   1 +
 pre-build/native-bundle-main.js                 |  12 +-
 27 files changed, 660 insertions(+), 57 deletions(-)
----------------------------------------------------------------------