https://kotlinlang.org logo
b

bod

07/14/2022, 4:44 PM
Another question: the recommended way to have toggles in a settings-like screen is to use
ToggleChip
with
ToggleChipDefaults.switchIcon
, correct? Is there a way to animate the toggle switch?
k

Kseniia Shumelchyk

07/14/2022, 5:58 PM
We don’t enforce specific types for settings-like screen, so any toggle chips will be a good fit for that depending on your needs (see https://developer.android.com/training/wearables/compose/toggle-chips#usage for some examples). There is a default animation when you toggle on/off switch, do you want to do something custom?
message has been deleted
b

bod

07/14/2022, 6:44 PM
Well the toggle itself is not animated. Whereas in the system settings for instance, they are
j

John Nichol

07/14/2022, 8:49 PM
We have an item to look at adding animation in 1.1. - However given that the toggle control is a slot you can look at doing it yourself. I will try to remember to put a sample together tomorrow
🙏 1
b

bod

07/16/2022, 10:58 AM
I've tried putting a regular material Switch in there - it's animated but it's "a bit" oversized 😂
y

yschimke

07/17/2022, 8:25 AM
Can you scale it?
b

bod

07/17/2022, 8:27 AM
I tried setting its size which had no effect, but haven't tried scaling, that might work 💡
6 Views