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

Fix for [iOS] Use non-overridden traits in AppInfoImplementation.RequestTheme #25497

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

Conversation

SuthiYuvaraj
Copy link
Contributor

Root Cause

While updating the requested theme, the default TrailCollection is obtained, which does not return non-overridden traits and does not take the system theme into account.

Description of Change

UIScreen.MainScreen.TraitCollection is obtained , which will return non overridden traits based on the system theme

Issues Fixed

Fixes #23411

Output Video

Before Issue Fix After Issue Fix
BeforeFix.mov
AfterFix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 24, 2024
@karthikraja-arumugam
Copy link

The fix ensures the theme updates correctly on the current page, but the main page still retains the previously requested theme, even when updating the application's current theme.

@filipnavara, do you have any thoughts on this?

@filipnavara
Copy link
Member

do you have any thoughts on this?

I'll have to check again what is going on in the test app. That sounds like the exact behavior this was trying to fix...

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Application.Current.UserAppTheme = AppTheme.Dark;
}

private void OnModalPage(object sender, EventArgs e)
Copy link
Contributor

Choose a reason for hiding this comment

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

The EventHandler is only created for iOS and failing in the rest of the platforms.

D:\a\_work\1\s\src\Controls\tests\TestCases.HostApp\Issues\Issue23411.xaml(30,17): XamlC error XC0002: EventHandler "OnModalPage" with correct signature not found in type "Maui.Controls.Sample.Issues.Issue23411". [D:\a\_work\1\s\src\Controls\tests\TestCases.HostApp\Controls.TestCases.HostApp.csproj::TargetFramework=net9.0-windows10.0.20348.0]
    5 Error(s)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jsuarezruiz ,Thank you for sharing your concerns with us. We are actively working to resolve the issue and optimize the code for all platforms. We will provide you with an update on the latest fix as soon as possible.

@SuthiYuvaraj SuthiYuvaraj marked this pull request as ready for review October 30, 2024 13:06
@SuthiYuvaraj SuthiYuvaraj requested a review from a team as a code owner October 30, 2024 13:06
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

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

Successfully merging this pull request may close these issues.

[iOS] Application cannot be reset back to system theme
4 participants