google / jetpack-camera-app

Apache License 2.0
116 stars 25 forks source link

Add ToggleButton ui component #203

Closed heytsai closed 1 month ago

heytsai commented 2 months ago

This adds a ui component that can be used to choose between image capture and video capture when HDR is enabled:

Screenshot from 2024-05-09 20-30-50

The button can be disabled for the case that only HDR video is supported

The animation for transition between different states is also implemented for completeness.

JolandaVerhoef commented 1 month ago

UX question - is there a reason you're showing the video on the left and still image on the right? The Pixel system camera has them the other way around (Camera icon on the left, video on the right)

heytsai commented 1 month ago

UX question - is there a reason you're showing the video on the left and still image on the right? The Pixel system camera has them the other way around (Camera icon on the left, video on the right)

Thank you, updated it to put the camera icon on the left.

There is no strong reason, just because the checked item will always be video when the toggle is disabled (if a device supports Ultra HDR, it will also support HDR video), and I feel more natural to put it on the left side.

heytsai commented 1 month ago

The ui component after the update would be like follows:

Screenshot from 2024-05-13 15-39-49

heytsai commented 1 month ago

Thank you Trevor. The preview after the fixed is as follows (the first one is Light Mode):

Screenshot from 2024-05-15 11-00-12

Also, I changed the parameter "isDisabled" to "enabled" to align with other components (e.g., Button).