Skip to content

Commit 8a7459b

Browse files
Fixed-Test-Failing-28622
1 parent ad50b51 commit 8a7459b

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

src/Controls/src/Core/Handlers/Items/Android/Adapters/EmptyViewAdapter.cs

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,35 @@ void UpdateHeaderFooterHeight(object item, bool isHeader)
327327
size = label.Measure(double.PositiveInfinity, double.PositiveInfinity);
328328
}
329329

330-
var itemHeight = size.Height;
330+
if (IsVerticalItemsLayout())
331+
{
332+
var itemHeight = size.Height;
331333

332-
if (isHeader)
333-
_headerHeight = itemHeight;
334-
else
335-
_footerHeight = itemHeight;
334+
if (isHeader)
335+
_headerHeight = itemHeight;
336+
else
337+
_footerHeight = itemHeight;
338+
}
339+
}
340+
341+
bool IsVerticalItemsLayout()
342+
{
343+
if (ItemsView is CollectionView collectionView)
344+
{
345+
switch (collectionView.ItemsLayout)
346+
{
347+
case LinearItemsLayout linearLayout:
348+
{
349+
return linearLayout.Orientation == ItemsLayoutOrientation.Vertical;
350+
}
351+
case GridItemsLayout gridItemsLayout:
352+
{
353+
return gridItemsLayout.Orientation == ItemsLayoutOrientation.Vertical;
354+
}
355+
}
356+
}
357+
// Default
358+
return true;
336359
}
337360
}
338361
}

0 commit comments

Comments
 (0)