KEMBAR78
[Android] Fixed Picker Does Not Show Selected Item Highlight by NanthiniMahalingam · Pull Request #30345 · dotnet/maui · GitHub
Skip to content

Conversation

@NanthiniMahalingam
Copy link
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details

  • The Picker control does not display a selected item indication on the Android platform.

Root Cause

  • On Android, when an item is selected in the Picker dialog, there is no visual indication of the selected item due to missing support for selection highlighting.

Description of Changes

  • Implemented the SetSingleChoiceItems method to visually indicate the selected item in the Picker dialog.
  • Used MaterialAlertDialogBuilder to enable customization of the Picker dialog appearance.
  • Applied materialAlertDialogTheme to maintain consistent styling for both light and dark themes.

Validated the behaviour in the following platforms

  • Android
  • Windows ,
  • iOS,
  • MacOS

Issues Fixed

Fixes #29633
Fixes #19681

Output Images
Android

Before After
Light Mode
Dark Mode

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Jul 1, 2025
@dotnet-policy-service
Copy link
Contributor

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

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jul 1, 2025
@NanthiniMahalingam NanthiniMahalingam marked this pull request as ready for review July 1, 2025 12:12
@NanthiniMahalingam NanthiniMahalingam requested a review from a team as a code owner July 1, 2025 12:12
@PureWeen PureWeen added this to the .NET 10.0-preview7 milestone Jul 2, 2025
@PureWeen PureWeen added the p/0 Work that we can't release without label Jul 3, 2025
@github-project-automation github-project-automation bot moved this from Todo to Changes Requested in MAUI SDK Ongoing Jul 3, 2025
@rmarinho
Copy link
Member

/rebase

@rmarinho
Copy link
Member

/azp run

@rmarinho rmarinho requested a review from PureWeen July 14, 2025 11:54
@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@rmarinho rmarinho left a comment

Choose a reason for hiding this comment

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

Some tests are failing PickerShouldShowSelectedItemHighlight

@PureWeen
Copy link
Member

/azp run

@PureWeen PureWeen moved this from Changes Requested to Ready To Review in MAUI SDK Ongoing Jul 18, 2025
@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mattleibow
Copy link
Member

This has a chnage of behavior in that after selecting an item, it no longer closes the dialog and we have to manually press cancel... Which seems wrong.

So I added some logic to auto-close the picker when an new item is selected. I feel like this is a better experience as well as keeping the existing behavior. Not sure why Android wnt this path since all the other OS have the popup close...

@mattleibow
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@mattleibow mattleibow moved this from Ready To Review to Approved in MAUI SDK Ongoing Jul 21, 2025
@PureWeen
Copy link
Member

  • failing test unrelated

@PureWeen PureWeen merged commit fc10fa0 into dotnet:net10.0 Jul 24, 2025
127 of 129 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Jul 24, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-picker Picker community ✨ Community Contribution p/0 Work that we can't release without partner/syncfusion Issues / PR's with Syncfusion collaboration platform/android

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants