-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix for Android - Dynamic Updates to CollectionView Header/Footer and Templates Are Not Displayed #28904
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hey there @@SuthiYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
} | ||
|
||
[Test, Order(4)] | ||
public void CollectionViewFooterViewShouldChangeDynamically() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tests are failing on iOS:

at UITest.Appium.HelperExtensions.Wait(Func`1 query, Func`2 satisfactory, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2404
at UITest.Appium.HelperExtensions.WaitForAtLeastOne(Func`1 query, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 2421
at UITest.Appium.HelperExtensions.WaitForElement(IApp app, String marked, String timeoutMessage, Nullable`1 timeout, Nullable`1 retryFrequency, Nullable`1 postTimeout) in /_/src/TestUtils/src/UITest.Appium/HelperExtensions.cs:line 665
at Microsoft.Maui.TestCases.Tests.Issues.Issue28676.CollectionViewFooterViewShouldChangeDynamically() in /_/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue28676.cs:line 47
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
@@ -33,12 +33,13 @@ protected override void ItemsViewPropertyChanged(object sender, PropertyChangedE | |||
{ | |||
base.ItemsViewPropertyChanged(sender, property); | |||
|
|||
if (property.Is(Microsoft.Maui.Controls.StructuredItemsView.HeaderProperty)) | |||
if (property.Is(Microsoft.Maui.Controls.StructuredItemsView.HeaderProperty) || property.Is(Microsoft.Maui.Controls.StructuredItemsView.HeaderTemplateProperty)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test HeaderFooterTemplateWorks
is failing on Android, could you verify if is related with the changes?
Issue Description:
HeaderTemplate
andFooterTemplate
are also not applied correctly at runtime.Root Cause:
ItemsViewPropertyChanged
did not handle updates forHeaderTemplateProperty
andFooterTemplateProperty
.OnBindViewHolder
did not account for rendering updated header/footer content or templates.Description of Change
HeaderTemplateProperty
andFooterTemplateProperty
in theItemsViewPropertyChanged
method to ensure runtime changes are detected and processed.OnBindViewHolder
method to handle both simple views and string-based headers/footers using SimpleViewHolder.BindTemplatedItemViewHolder
to correctly create and bind TemplatedItemViewHolder for HeaderTemplate and FooterTemplate, ensuring updates are accurately reflected in the UI.Issues Fixed
Fixes #28676
Tested the behaviour on the following platforms
Output Screenshot
HeaderFooterBefore.mov
HeaderFooterFix.mov