YorkShen closed pull request #1446: * [android] Make header can recycled.
URL: https://github.com/apache/incubator-weex/pull/1446
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXHeader.java 
b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXHeader.java
index d55106e82c..ca9fb2cf5a 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/WXHeader.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/WXHeader.java
@@ -49,13 +49,8 @@ public boolean isLazy() {
     return false;
   }
 
-  @Override
-  public boolean isSticky() {
-    return true;
-  }
-
   @Override
   public boolean canRecycled() {
-    return false;
+    return !isSticky();
   }
 }
diff --git 
a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXCell.java 
b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXCell.java
index 0998457857..168754597d 100644
--- a/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXCell.java
+++ b/android/sdk/src/main/java/com/taobao/weex/ui/component/list/WXCell.java
@@ -35,6 +35,7 @@
 import com.taobao.weex.ui.ComponentCreator;
 import com.taobao.weex.ui.action.BasicComponentData;
 import com.taobao.weex.ui.component.WXComponent;
+import com.taobao.weex.ui.component.WXHeader;
 import com.taobao.weex.ui.component.WXVContainer;
 import com.taobao.weex.ui.flat.WidgetContainer;
 import com.taobao.weex.ui.view.WXFrameLayout;
@@ -125,7 +126,7 @@ public boolean isFlatUIEnabled() {
      */
     @Override
     protected WXFrameLayout initComponentHostView(@NonNull Context context) {
-        if (isSticky()) {
+        if (isSticky() || this instanceof WXHeader) {
             WXFrameLayout view = new WXFrameLayout(context);
             mRealView = new WXFrameLayout(context);
             view.addView(mRealView);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to