maui icon indicating copy to clipboard operation
maui copied to clipboard

[Android] Fix incorrect height of CollectionView when ItemsSource is empty.

Open Tamilarasan-Paranthaman opened this issue 1 year ago • 10 comments

Root Cause:

  • The ItemSpacing was set in the MauiRecyclerView even when the ItemsSource was null. As a result, the default padding occupied space in the MauiRecyclerView.

Description of Change:

  • The ItemSpacing (padding) should only be applied if the ItemsCount is greater than zero. Otherwise, padding should not be applied.

Issues Fixed

Fixes #23148

Before Issue Fix After Issue Fix

Tamilarasan-Paranthaman avatar Aug 07 '24 11:08 Tamilarasan-Paranthaman

/azp run

jfversluis avatar Aug 07 '24 14:08 jfversluis

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 07 '24 14:08 azure-pipelines[bot]

I haven't been able to reproduce the original issue.

Here I'm running the code from the original issue against our sandbox.

I'll test again once tests are added to see how you are reproducing this one.

image

PureWeen avatar Aug 07 '24 20:08 PureWeen

/azp run

PureWeen avatar Aug 08 '24 14:08 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 08 '24 14:08 azure-pipelines[bot]

@PureWeen, I can reproduce the issue with the latest source as well. I'm using Visual Studio and an API 31 Pixel 5 emulator. We're testing this in the main branch, not with .net9. I hope this information helps.

image

karthikraja-arumugam avatar Aug 09 '24 08:08 karthikraja-arumugam

@PureWeen ,I have reproduced the issue using the latest dotnet maui main repository. The problem persists across API levels 31, 33, 34, and 35 on our emulators. For further reference, I've also attached a video demonstrating the issue. collectionview 1

SuthiYuvaraj avatar Aug 09 '24 10:08 SuthiYuvaraj

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 09 '24 14:08 azure-pipelines[bot]

/azp run

jsuarezruiz avatar Oct 25 '24 09:10 jsuarezruiz

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Oct 25 '24 09:10 azure-pipelines[bot]

/rebase

jsuarezruiz avatar Mar 11 '25 10:03 jsuarezruiz

/rebase

jsuarezruiz avatar Mar 25 '25 06:03 jsuarezruiz

/azp run

jsuarezruiz avatar Mar 25 '25 06:03 jsuarezruiz

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Mar 25 '25 06:03 azure-pipelines[bot]