Skip to content
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

[Android] Fixed incorrect tab content display in TabbedPage #27294

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

Vignesh-SF3580
Copy link
Contributor

@Vignesh-SF3580 Vignesh-SF3580 commented Jan 23, 2025

Issue Detail

When opening the app and clicking directly on the fourth tab, the fifth tab's content is displayed instead of the correct content.

Root Cause:

The OffscreenPageLimit mapping was missing in the source, leading to incorrect preloading of tab contents.

Description of Change

Mapped the OffscreenPageLimit property to ensure proper preloading of tab contents, resolving the issue.

Tested the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Issues Fixed

Fixes #23732
Fixes #21640

Screenshots

Before Issue Fix After Issue Fix
TabBarBefore.mov
TabBarAfter.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jan 23, 2025
@karthikraja-arumugam karthikraja-arumugam added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 23, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Vignesh-SF3580 Vignesh-SF3580 marked this pull request as ready for review January 23, 2025 15:07
@Copilot Copilot bot review requested due to automatic review settings January 23, 2025 15:07
@Vignesh-SF3580 Vignesh-SF3580 requested a review from a team as a code owner January 23, 2025 15:07

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • src/Controls/tests/TestCases.HostApp/Issues/23732Page.xaml: Language not supported
Comments suppressed due to low confidence (1)

src/Controls/tests/TestCases.HostApp/Issues/23732Page.xaml.cs:5

  • [nitpick] The class name '_23732Page' is unconventional. It should be renamed to 'Page23732'.
public partial class _23732Page : ContentPage
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

jsuarezruiz
jsuarezruiz previously approved these changes Jan 24, 2025
Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the failing test is actually valid in this case, please look into that @Vignesh-SF3580

@Vignesh-SF3580
Copy link
Contributor Author

I think the failing test is actually valid in this case, please look into that @Vignesh-SF3580

@jfversluis I have validated the test case failure and corrected it by removing the DisconnectHandler call, as the latest code automatically calls previous page's DisconnectHandler during navigation.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).


[Test]
[Category(UITestCategories.TabbedPage)]
public void TabbedPageTabContentUpdated()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is failing on Android:

Assert.That(label.GetText(), Is.EqualTo("page4"))
String lengths are both 5. Strings differ at index 4.
Expected: "page4"
But was:  "page2"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the test cases based on your feedback to avoid the failing. Could you please review and let me know if you have any further concerns?

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the attached videos, I see the below had no animations but the after does have.

Is this a result of your fix or was the capture not correct?

@@ -183,7 +183,6 @@ await CreateHandlerAndAddToWindow<WindowHandlerStub>(new Window(tabbedPage), asy
var nextPage = tabbedPage.Children[pageIndex];
tabbedPage.CurrentPage = nextPage;
await OnNavigatedToAsync(nextPage);
previousPage.Handler.DisconnectHandler();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this removed, is something leaking?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattleibow As mentioned earlier, this test fails with a timeout exception when using DisconnectHandler with the fix. Since the latest code automatically calls the previous page's DisconnectHandler during navigation, I have removed this code.

@Vignesh-SF3580
Copy link
Contributor Author

In the attached videos, I see the below had no animations but the after does have.

Is this a result of your fix or was the capture not correct?

@mattleibow The issue occurs when navigating directly from the first to the fourth tab, where the content does not update properly, and animations are missing.

However, animations work when switching between other tabs. My fix ensures the tab content updates correctly, and animations now work as expected when switching from the first to the fourth tab also.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still tests consistently failing here

@Vignesh-SF3580
Copy link
Contributor Author

Still tests consistently failing here

@jfversluis I have checked the test case failures in this PR, and the only failing test is "GridCellsHonorMaxWidth", that failure is not related to the fix I have added. All other tests have passed without any issues. Most probably re triggering the CI will clear the test case failures. Could you please check and let me know if you have any concerns?

@jsuarezruiz
Copy link
Contributor

Still tests consistently failing here

@jfversluis I have checked the test case failures in this PR, and the only failing test is "GridCellsHonorMaxWidth", that failure is not related to the fix I have added. All other tests have passed without any issues. Most probably re triggering the CI will clear the test case failures. Could you please check and let me know if you have any concerns?

Rebased to avoid the GridCellsHonorMaxWidth failure.

@jsuarezruiz
Copy link
Contributor

/rebase

@Vignesh-SF3580
Copy link
Contributor Author

Still tests consistently failing here

@jfversluis I have checked the test case failures in this PR, and the only failing test is "GridCellsHonorMaxWidth", that failure is not related to the fix I have added. All other tests have passed without any issues. Most probably re triggering the CI will clear the test case failures. Could you please check and let me know if you have any concerns?

Rebased to avoid the GridCellsHonorMaxWidth failure.

Thanks @jsuarezruiz, for the rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android 🤖
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android Tabbar, clicking 4th tab opens the 5th tab TabbedPage: content not shown after readding
5 participants