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

VisualStateManager Works Differently on Windows and Android #6629

Closed
david-maw opened this issue Apr 28, 2022 · 8 comments
Closed

VisualStateManager Works Differently on Windows and Android #6629

david-maw opened this issue Apr 28, 2022 · 8 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working
Milestone

Comments

@david-maw
Copy link

Description

I use a VisualStateManager to highlight selected items in a CollectionView. Prior to RC2 it did not work at all on Android so I reported issue #5449. That was fixed so now it works on Android, but differently than Windows.

Steps to Reproduce

  1. Unzip the project from
    MAUIListEntry-VisualState-RC2.zip
  2. Compile and run it on Windows, click each item line in succession, you should see this (the correct behaviour):
    MAUIListEntry-VisualState-RC2-Windows
  3. Compile and run it on Android, again click the three item lines in succession, you should see this:
    MAUIListEntry-VisualState-RC2-Android

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11

Did you find any workaround?

Yes, as part of the fix for Issue #5449 @antonfirsov wrote "...note that you have to define a default BackgroundColor for your grid, otherwise VisualStateManager won't be able to determine what color to switch back to after deselection" this is evidently only true for Android and can be painful to do in existing code. So if you can come up with a color to use this is a workaround on Android (it's evidently not required on Windows).

Relevant log output

No response

@david-maw david-maw added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Apr 28, 2022
@XamlTest XamlTest added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Apr 29, 2022
@XamlTest
Copy link

Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32427.455.main]. Repro on Android 12, not repro on Windows with above project.

@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 2, 2022
@Redth
Copy link
Member

Redth commented May 3, 2022

@PureWeen ^

I think for now the expectation is an opinionated 'default' value.

@Redth Redth added this to the 6.0.300-servicing milestone May 3, 2022
@david-maw
Copy link
Author

Not my preferred fix but I can certainly live with it since I probably have less than a dozen instances to fix. Should I raise some sort of documentation issue to ensure it gets documented as a Xamarin migration note?

@david-maw
Copy link
Author

@PureWeen, incidentally, I found the easiest migration in the "background for highlight" case is just to use "transparent" for non-highlighted items since I normally use plain backgrounds anyway.

@jsuarezruiz jsuarezruiz added the area-controls-collectionview CollectionView, CarouselView, IndicatorView label May 18, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 5, 2023
@XamlTest XamlTest added the s/triaged Issue has been reviewed label Apr 25, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.6.0 Preview 4.0. This issue does not repro with below Project: 6629.zip

Windows and Android have the same behavior when clicking on each item line.

Android emulator (13.0-API 33):
SelectItem

Windows 11:
SelectItem1

@XamlTest XamlTest added the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Apr 25, 2023
@ghost
Copy link

ghost commented Apr 25, 2023

Hi @david-maw. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@david-maw
Copy link
Author

Yep, looks like it is fixed, thanks.

@ghost ghost removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Apr 25, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 25, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/android 🤖 s/triaged Issue has been reviewed t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants