Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Android] fix item indices and item count in a ListView #15478

Merged
merged 2 commits into from Jul 16, 2022
Merged

Conversation

jfversluis
Copy link
Member

Description of Change

Exactly the same as #15477 but now it builds because I have magic powers

Issues Resolved

@jfversluis jfversluis merged commit 94acebb into 5.0.0 Jul 16, 2022
@jfversluis jfversluis deleted the takover-15477 branch July 16, 2022 18:38
@PeteVasi
Copy link

PeteVasi commented May 5, 2023

Note that we're seeing odd behavior in our CustomRenderer ListViews, that I believe is caused by this change.

You can reproduce the bug with the Xamarin Forms Sample - Custom Renderer - ListView.
In here: https://github.com/xamarin/xamarin-forms-samples/blob/main/CustomRenderers/ListView/Droid/NativeAndroidListViewRenderer.cs#L50 you can see that the position is corrected for with a - 1, but if you upgrade that sample solution past Forms 5 SR-12, every item you click on will show the item above it instead.

Unsure if this should be filed as an issue or not, but we noticed it as a breaking change.

@heikow10
Copy link
Contributor

heikow10 commented May 9, 2023

@PeteVasi I assume the correction by - 1 is a workaround for the bug which was fixed by this PR. So I think you can fix the odd behavior by removing the correction by - 1 in your CustomRenderer.
So the error is in the sample but I don't know if the samples are maintained anymore.

@PeteVasi
Copy link

Right, I've fixed up my own custom renderer, but wanted a note out there in case someone else runs into this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants