Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit 833a7e7

Browse files
author
huanglei.hl
committed
[Android] Fix list frozen in wrong condition.
* issue: #2250
1 parent 36dce32 commit 833a7e7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

android/sdk/src/main/java/com/taobao/weex/ui/component/list/BasicListComponent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -734,16 +734,16 @@ public void addChild(WXComponent child, int index) {
734734
}
735735
if (isKeepScrollPosition) {
736736
if(view.getInnerView().getLayoutManager() instanceof LinearLayoutManager){
737-
if(!view.getInnerView().isLayoutFrozen()){ //frozen, prevent layout when scroll
738-
view.getInnerView().setLayoutFrozen(true);
739-
}
740737
if(keepPositionCell == null){
741738
int last=((LinearLayoutManager)view.getInnerView().getLayoutManager()).findLastCompletelyVisibleItemPosition();
742739
ListBaseViewHolder holder = (ListBaseViewHolder) view.getInnerView().findViewHolderForAdapterPosition(last);
743740
if(holder != null){
744741
keepPositionCell = holder.getComponent();
745742
}
746743
if(keepPositionCell != null) {
744+
if(!view.getInnerView().isLayoutFrozen()){ //frozen, prevent layout when scroll
745+
view.getInnerView().setLayoutFrozen(true);
746+
}
747747
if(keepPositionCellRunnable != null){
748748
view.removeCallbacks(keepPositionCellRunnable);
749749
}

0 commit comments

Comments
 (0)