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

Bug in CupertinoTimePickerState on Android Emulator #20

Open
StefanOltmann opened this issue Jan 15, 2024 · 7 comments
Open

Bug in CupertinoTimePickerState on Android Emulator #20

StefanOltmann opened this issue Jan 15, 2024 · 7 comments
Labels
bug Something isn't working component: TimePicker

Comments

@StefanOltmann
Copy link

I have to report a minor glitch:

For some reason the CupertinoTimePickerState changes it values on the first time the CupertinoTimePicker is shown. It decreases hours and minutes down by one.

Interestingly this does not happen on JVM Desktop and it couldn't reproduce it on a real device. As far as I can see this happens only on Android Emulator (running Android 14).

I tried changing locale and timezone, but that did not help.

Maybe you want to see if it could happen on a real device, too.

android_emulator.mov
jvm_desktop.mov
@alexzhirkevich
Copy link
Owner

alexzhirkevich commented Jan 15, 2024

Can you try it without expanding animation? The state of wheel pickers is higly depend on composed content because it is produced by the layoutInfo of the lazy list. So state may break if it doesn't compose all its children during the initial composition

@StefanOltmann
Copy link
Author

I removed the AnimatedVisibility for testing purposes, but in this case that does not seem to be the problem.

@alexzhirkevich
Copy link
Owner

Unfortunately, this is how this picker is designed. You can try different animations such as scale, slide and fade.

In such partucilar case scaleIn with TransformOrigin(1f,1f) will probably even look better

@StefanOltmann
Copy link
Author

Even with no animation it's broken. I changed the AnimatedVisibility to a simple if (showTimePicker).

Also this does not really explain why it's just not working in the Emulator.

But until someone discovers this happening on a real device we can close the issue.

@alexzhirkevich alexzhirkevich added bug Something isn't working component: TimePicker labels Jan 15, 2024
@alexzhirkevich
Copy link
Owner

Btw, this picker isn't work as it should on desktop because of the same bug with snapping behavior for trackpad

@alexzhirkevich
Copy link
Owner

alexzhirkevich commented Jan 15, 2024

Do your emulator and android device both have AM picker? It isn't displayed on your desktop clip. May be the issue is in it? You can set time format manually in the state constructor

@StefanOltmann
Copy link
Author

I tried with and without. The bug also happens if I force the 24h format.

Is it not reproducible for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: TimePicker
Projects
None yet
Development

No branches or pull requests

2 participants