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

Support for Setting Switch Off State Color #25068

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

Conversation

devanathan-vaithiyanathan
Copy link
Contributor

@devanathan-vaithiyanathan devanathan-vaithiyanathan commented Oct 3, 2024

Description of Change

Currently, we can only change the track color for the switch in the "on" state. Support for changing the track color in the "off" state has now been added. A new API called OffColor has been implemented for the switch, allowing us to change the track color when the switch is off as well.

Issues Fixed

Fixes #15695

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac
  • Tizen

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Oct 3, 2024
Copy link
Contributor

Hey there @devanathan-vaithiyanathan! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Could you include some UITests? For example, could use the VerifyScreenshot method to validate colors with snapshots.

@devanathan-vaithiyanathan devanathan-vaithiyanathan changed the title Fix Switch view has inconsistent colors when "off" Support for Setting Switch Off State Color Oct 7, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Switch/Switch.cs(33,43): error RS0016: Symbol 'OffColorProperty' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net9.0-tizen7.0]
/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Switch/Switch.cs(55,4): error RS0016: Symbol 'OffColor.get' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net9.0-tizen7.0]
/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Switch/Switch.cs(56,4): error RS0016: Symbol 'OffColor.set' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net9.0-tizen7.0]
0 Warning(s)
3 Error(s)

@PureWeen PureWeen added this to the .NET 9.0 GA milestone Oct 14, 2024
@rmarinho rmarinho changed the base branch from net9.0 to main October 19, 2024 23:57
@rmarinho
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@devanathan-vaithiyanathan
Copy link
Contributor Author

/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Switch/Switch.cs(33,43): error RS0016: Symbol 'OffColorProperty' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net9.0-tizen7.0] /Users/builder/azdo/_work/3/s/src/Controls/src/Core/Switch/Switch.cs(55,4): error RS0016: Symbol 'OffColor.get' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net9.0-tizen7.0] /Users/builder/azdo/_work/3/s/src/Controls/src/Core/Switch/Switch.cs(56,4): error RS0016: Symbol 'OffColor.set' is not part of the declared public API (https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md) [/Users/builder/azdo/_work/3/s/src/Controls/src/Core/Controls.Core.csproj::TargetFramework=net9.0-tizen7.0] 0 Warning(s) 3 Error(s)

The public API for the Tizen platform has been added.

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

public void VerifySwitchOffColor()
{
App.WaitForElement("Switch");
VerifyScreenshot();
Copy link
Contributor

Choose a reason for hiding this comment

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

Pending snapshots. Already available on the latest build.

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've added snapshots for all platforms

@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen modified the milestones: .NET 9.0 GA, .NET 9 SR2 Oct 30, 2024
@jsuarezruiz
Copy link
Contributor

@PureWeen This should retarget to net9.0, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready To Review
Development

Successfully merging this pull request may close these issues.

Adding a bindable Off state Color for Switch
5 participants