-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Android] Fixed Picker Does Not Show Selected Item Highlight #29979
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
Conversation
|
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. |
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.
Pull Request Overview
This PR addresses the Android Picker control issue by introducing visual indication for the selected item in the Picker dialog.
- Updated styles to include the materialAlertDialogTheme for consistent theming.
- Replaced the AppCompatAlertDialog with MaterialAlertDialogBuilder and changed the item selection method to SetSingleChoiceItems for pre-selecting the current item.
- Added automated tests and a host app sample to verify the new behavior.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Core/src/Platform/Android/Resources/values/styles.xml | Added materialAlertDialogTheme reference for consistent theming. |
| src/Core/src/Handlers/Picker/PickerHandler.Android.cs | Updated dialog creation to use MaterialAlertDialogBuilder and SetSingleChoiceItems for selection highlighting. |
| src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29633.cs | Added a test to ensure the Picker displays a selected item highlight. |
| src/Controls/tests/TestCases.HostApp/Issues/Issue29633.cs | Added a sample page demonstrating the highlighted Picker behavior. |
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| using (var builder = new AppCompatAlertDialog.Builder(Context)) | ||
| using (var builder = new MaterialAlertDialogBuilder(Context)) |
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.
Do we need to switch the control? I worry that for net9 this may cause issues with styling as none of the other dialogs are material. We got things like buttons and toolbars, but this full switch may need to wait for net10.
The single selection does exist:
https://developer.android.com/reference/androidx/appcompat/app/AlertDialog.Builder#setSingleChoiceItems(java.lang.CharSequence[],int,android.content.DialogInterface.OnClickListener)
| <item name="alertDialogTheme">@style/MauiAlertDialogTheme</item> | ||
| <item name="materialAlertDialogTheme">@style/MauiAlertDialogTheme</item> |
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.
I see we use the same material dilog style for both material and app compat, but still might be worth not changing too much in net9.
Maybe for net10 we switch all the pickers to material? But that is a different issue.
6f0453e to
25a5ad2
Compare
…net#26153) * Don’t call NSAttributedString with HTML from a background thread * Added a UITest * Refactor * add more comments and move to Controls --------- Co-authored-by: Matthew Leibowitz <[email protected]>
…ge class (dotnet#29138) * Fix for GraphicsView ImagePaint * update for the graphics view imagePaint * Added testcase * Implementation for Downsize * Revert "Added testcase" This reverts commit ef22fa8. * Added test case * Added CreateResizedMethod * Implemented Resize method * Fix modification * Added testcase * Revert "Added test case" This reverts commit a79de0d. * Updated the changes * Update changes * Updated the testcase * Commited the changes * Updating code * Update TestCase * Code Update * Modify TestCase * TestCase Updation * Code update * Adding Snapshots * Added snapshots * Revert "Added snapshots" This reverts commit cac6f45. * Refactor code
* Initial plan for issue * Update TSA areaPath from "DevDiv\\VS Client - Runtime SDKs\\MAUI" to "DevDiv\\.NET MAUI\\MAUI" Co-authored-by: Aguilex <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Aguilex <[email protected]>
* [ci] try do full build on dnceng Update stage-build.yml Update stage-build.yml Update stage-build.yml Update stage-build.yml Update stage-build.yml Update stage-build.yml * Remove the jdk step * Fix provisioning * [tests] Try fix GC flaky tests * [tests] Refactor to use GC test helpers * Build on macos and windows * remove pool * Fix display name * try this * try again * Revert "try this" This reverts commit f55e3c7. * Revert "try again" This reverts commit 85eab97. * again * Build platform * again * buildConfigurations * go back * Release * variable * Add prepare steps * again * Buildplatform * OS * add vmImage * Fix build script * Try fix TestHelper collect * Fix _buildScriptMacOS * Add TreatWarningsAsErrors variable * Try fix path * Fix paths * Try fix leaks * Refactor _BuildConfig * again * Fix pack log * -warnAsError 0 * Try this setting * Fix scripts * Add Helix * Add Helix script * Add helix * change name * Try again * Try restore first * Add helix cmd * Add missing parameters * No node reuse * Setup machine first * try again * try condition * again * again * Fix * ident * again * if * again * Build and pack * Update .net9 eng * Try helix in debug * fix bl * remove bl * don t run unit test * Run tests in release/debug * Try again * Fix stage * Try fix script * Build buildstasks * we need restore on this too * Try $(Build.SourcesDirectory) * Fix variables * Update * this works? * [iOS] Add CodesignRequireProvisioningProfile=false * [tests] Fix more leak tests * Just run xunit tests for now * Try publish missing assemblies * [ci] Update arcade versions * add TreatWarningsAsErrors=$(TreatWarningsAsErrors * Try -nowarn * Try fix display names * back * test_helix_unit_tests * again * Test * Try set friendly name * Try run other tests * Skip failing test * Fix name * Revert "Try set friendly name" This reverts commit af22e7c. * Try fix test warn * Fix warn as error * Add more tests * Fix helix * try run on mac too * [testing] Skipping some tests don t work on helix * [tests] Skip some failing tests * Try to spend more time on build mac * Publish needed packages * [tests] don t run resizetizer tests * [tests] Cleanup testhelper * [ci] Update xharness * [ci] Try to pass env variable to integration tests * Try again * Update AppleTemplateTests.cs * Update TestHelpers.cs * Update TestHelpers.cs * dont run iOS tests on dotnet previous * [testing] Fix helper method * [testint] Don t skip BindingUnsubscribesForDeadTarget
* Adding different options to generate adb keys * More changes
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Initial plan for issue * Update README with link to .NET 10 Co-authored-by: rachelkang <[email protected]> * Update date format for .NET 10 announcement Co-authored-by: mattleibow <[email protected]> * Remove .NET 10 entry from README based on feedback Co-authored-by: jsuarezruiz <[email protected]> * Re-add .NET 10 link with just the year 2025 Co-authored-by: jsuarezruiz <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: rachelkang <[email protected]> Co-authored-by: mattleibow <[email protected]> Co-authored-by: jsuarezruiz <[email protected]>
…tnet#30117) * Initial plan for issue * Fix update-cgmanifest.ps1 to generate deterministic output Co-authored-by: mattleibow <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mattleibow <[email protected]>
…ines (dotnet#30230) * Initial plan * Add code formatting instructions to copilot-instructions.md Co-authored-by: mattleibow <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mattleibow <[email protected]>
* Build the project forst before formatting * We may need to restore... * Update dotnet-format-daily.yml
…sisBannedApiAnalyzers to 4.14.0 (dotnet#30213) * Initial plan * Update analyzer versions and fix initial Graphics API issues Co-authored-by: PureWeen <[email protected]> * Add missing public APIs for netstandard2.0 and netstandard2.1 Core project Co-authored-by: PureWeen <[email protected]> * Fix Controls.Core public API issues for netstandard builds Co-authored-by: PureWeen <[email protected]> * Fix Controls.Core compile errors by adding missing public APIs for all target frameworks Co-authored-by: PureWeen <[email protected]> * Fix iOS public API duplicates by removing entries already in Shipped.txt Co-authored-by: PureWeen <[email protected]> * Fix MacCatalyst public API duplicates by removing iOS lifecycle events already in Shipped.txt Co-authored-by: PureWeen <[email protected]> * - fix iOS * - fix catalyst and ios * - fix * - fix windows * - fix windows * Fix Maps project build errors by adding missing public API declarations for MapElementHandlerUpdate record Co-authored-by: PureWeen <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: PureWeen <[email protected]> Co-authored-by: Shane Neuville <[email protected]>
…ldNotHangOrCrash in CI that occasionally fails (dotnet#30239) * fixed flaky test 8870 * Update src/TestUtils/src/UITest.Appium/HelperExtensions.cs Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
25a5ad2 to
c985abb
Compare
|
I noticed the PR might include some unintended changes, possibly due to a misstep during rebase. Would you mind taking a quick look to confirm? |
…ead (dotnet#26153)" This reverts commit 61ee829.
|
Closing this one in favor of #30345 |
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
Root Cause
Description of Changes
Validated the behaviour in the following platforms
Issues Fixed
Fixes #29633
Fixes #19681
Output Images
Android