Skip to content

Commit

Permalink
chore(android): improve ListView child view detection when recycling
Browse files Browse the repository at this point in the history
  • Loading branch information
jquick-axway authored and ewanharris committed Jun 30, 2021
1 parent 0ec733f commit f1f2a27
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public TiUIView createView(Activity activity)
}

// Generate all child proxies from template and create all views.
if (this.children.isEmpty()) {
if (!hasChildren()) {
generateViewFromTemplate(this, this.template);
}
return new ItemView(this);
Expand Down Expand Up @@ -337,10 +337,13 @@ public void moveChildrenTo(ListItemProxy proxy)
return;
}

// Do not continue if this proxy has no children.
// Do not continue if this proxy has no child views.
// This will force given proxy to regenerate child proxies from template.
if (!hasChildren()) {
return;
}
TiViewProxy[] childProxies = getChildren();
if ((childProxies == null) || (childProxies.length <= 0) || (childProxies[0].peekView() == null)) {
if (childProxies[0].peekView() == null) {
return;
}

Expand Down

0 comments on commit f1f2a27

Please sign in to comment.