Skip to content

Commit

Permalink
fix(android): fix ListView layout with header and footer only (#14117)
Browse files Browse the repository at this point in the history
* fix(android): fix ListView layout with header and footer only

* remove log

* Update android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java

Co-authored-by: Chris Barber <[email protected]>

* rename variable

---------

Co-authored-by: Chris Barber <[email protected]>
  • Loading branch information
2 people authored and hansemannn committed Sep 22, 2024
1 parent 5f5c296 commit 3012280
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,13 @@ private void setHeaderFooter(TiViewProxy listViewProxy,

ConstraintSet constraintSet = new ConstraintSet();
constraintSet.clone((ConstraintLayout) this.container);
constraintSet.connect(R.id.titanium_ui_listview_holder_content, ConstraintSet.BOTTOM,

int constraintStartId = R.id.titanium_ui_listview_holder_header;
if (this.content.getChildCount() > 0) {
constraintStartId = R.id.titanium_ui_listview_holder_content;
}

constraintSet.connect(constraintStartId, ConstraintSet.BOTTOM,
R.id.titanium_ui_listview_holder_footer, ConstraintSet.TOP, 0);
constraintSet.connect(R.id.titanium_ui_listview_holder_left_image, ConstraintSet.BOTTOM,
R.id.titanium_ui_listview_holder_footer, ConstraintSet.TOP, 0);
Expand Down

0 comments on commit 3012280

Please sign in to comment.