Skip to content

Fix disappearing cell issue for TableView on Android - #19723

Merged
rmarinho merged 1 commit into
mainfrom
fix-tableview-disappearing-cells
Jan 9, 2024
Merged

rmarinho merged 1 commit into
mainfrom
fix-tableview-disappearing-cells

Conversation

@hartez

@hartez hartez commented Jan 5, 2024

Copy link
Copy Markdown
Contributor

Description of Change

Disables the native cell recycling mechanisms in favor of the renderer/handler reuse that's already built into .NET MAUI. Adds special casing to ensure that the behavior changes only apply to TableView; similar problems may exist in ListView, but that's beyond the scope of this change.

The native cell recycling relies on information that TableView was providing unreliably, and the old implementation of GetView() was removing cell contents from existing layouts so it could add the content to layouts it was measuring - this occasionally results in cells simply disappearing after they've been laid out. These changes clean up that implementation so that the cell content shifting no longer happens.

These changes also break down the TableView's cell creation methods for easier maintenance.

@hartez
hartez requested a review from a team as a code owner January 5, 2024 19:09
@hartez
hartez requested review from PureWeen and rmarinho January 5, 2024 19:09
@jsuarezruiz jsuarezruiz added t/bug Something isn't working platform/android area-controls-listview ListView and TableView labels Jan 8, 2024
@jsuarezruiz

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho

rmarinho commented Jan 8, 2024 •

Copy link
Copy Markdown
Member
/Users/builder/azdo/_work/2/s/src/Compatibility/ControlGallery/src/Issues.Shared/Github6384.cs(76,48): error CS0234: The type or namespace name 'FailsOnMauiiOSAttribute' does not exist in the namespace 'Microsoft.Maui.Controls.Compatibility.UITests' (are you missing an assembly reference?) [/Users/builder/azdo/_work/2/s/src/Compatibility/ControlGallery/test/Android.UITests/Compatibility.ControlGallery.Android.UITests.csproj]

trying to run ControlGallery, can you rebase?

@PureWeen

PureWeen commented Jan 8, 2024

Copy link
Copy Markdown
Member

/rebase

Disables the native cell recycling mechanisms in favor of the renderer/handler reuse that's already built into
.NET MAUI. Adds special casing to ensure that the behavior changes only apply to TableView; similar problems may
exist in ListView, but that's beyond the scope of this change.

These changes also break down the TableView's cell creation methods for easier maintenance.
@github-actions
github-actions Bot force-pushed the fix-tableview-disappearing-cells branch from 0321b7b to 3e9152f Compare January 8, 2024 15:40
@rmarinho
rmarinho merged commit 7af421e into main Jan 9, 2024
@rmarinho
rmarinho deleted the fix-tableview-disappearing-cells branch January 9, 2024 16:26
@janusw

janusw commented Jan 10, 2024

Copy link
Copy Markdown
Contributor

Thanks a lot for this PR, @hartez!

Two short questions: Does it actually fix #5924? And am I right in assuming that it will be included in the next MAUI 8 release?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants