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

Commit

Permalink
[Android] Fix list frozen in wrong condition.
Browse files Browse the repository at this point in the history
* issue: #2250
  • Loading branch information
huanglei.hl committed Mar 27, 2019
1 parent 36dce32 commit 833a7e7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -734,16 +734,16 @@ public void addChild(WXComponent child, int index) {
}
if (isKeepScrollPosition) {
if(view.getInnerView().getLayoutManager() instanceof LinearLayoutManager){
if(!view.getInnerView().isLayoutFrozen()){ //frozen, prevent layout when scroll
view.getInnerView().setLayoutFrozen(true);
}
if(keepPositionCell == null){
int last=((LinearLayoutManager)view.getInnerView().getLayoutManager()).findLastCompletelyVisibleItemPosition();
ListBaseViewHolder holder = (ListBaseViewHolder) view.getInnerView().findViewHolderForAdapterPosition(last);
if(holder != null){
keepPositionCell = holder.getComponent();
}
if(keepPositionCell != null) {
if(!view.getInnerView().isLayoutFrozen()){ //frozen, prevent layout when scroll
view.getInnerView().setLayoutFrozen(true);
}
if(keepPositionCellRunnable != null){
view.removeCallbacks(keepPositionCellRunnable);
}
Expand Down

0 comments on commit 833a7e7

Please sign in to comment.