From fc33a345a75de41cbe25638159aa90bfd669df3b Mon Sep 17 00:00:00 2001 From: Michael Gangolf Date: Sat, 21 Dec 2024 13:31:31 +0100 Subject: [PATCH] fix(android): fix global header/footer title in ListView --- .../titanium/ui/widget/listview/ListViewHolder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java index 4b83ba48705..c38066bbb08 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/listview/ListViewHolder.java @@ -339,7 +339,9 @@ private void setHeaderFooter(TiViewProxy listViewProxy, // Handle header title. this.headerTitle.setText(properties.getString(TiC.PROPERTY_HEADER_TITLE)); this.headerTitle.setVisibility(View.VISIBLE); - + if (this.content.getChildCount() == 0) { + this.container.addView(new View(context)); + } } else if (properties.containsKeyAndNotNull(TiC.PROPERTY_HEADER_VIEW)) { // Handle header view. @@ -373,7 +375,9 @@ private void setHeaderFooter(TiViewProxy listViewProxy, // Handle footer title. this.footerTitle.setText(properties.getString(TiC.PROPERTY_FOOTER_TITLE)); this.footerTitle.setVisibility(View.VISIBLE); - + if (this.content.getChildCount() == 0) { + this.container.addView(new View(context)); + } } else if (properties.containsKeyAndNotNull(TiC.PROPERTY_FOOTER_VIEW)) { // Handle footer view.