Is there any out of the box way to support the pas...
# compose
c
Is there any out of the box way to support the password toggle that came with material android/xml?
k
I haven’t come across anything like that. It should be fairly straightforward to build something using this
r
Copy code
trailingIcon = {
            IconButton(
                onClick = {
                    passwordVisibile = !passwordVisibile
                }
            ) {
                Icon(
                    imageVector = if (passwordVisibile) [eyedrawable] else [eyepatchdrawable]
                    ),
                    
                )
            }
        },
 visualTransformation = if (passwordVisibile) VisualTransformation.None else PasswordVisualTransformation(),
Add trailing icon to outlinetextfield and [passwordVisibile] boolean flag to toggle between drawables
g
c
@Gabriele Mariotti when you click to hide, is the crossed out slash animated? Can't tell in the gif from SO, and the one from material has an animation IIRC.
g
It uses the same vector provided by the material components library, but not the animated-vector.
c
Hm. Okay. I'll try to add the animated vector.
@Louis Pullen-Freilich [G] still having some trouble getting an animated vector to work, and I'm curious if there are any plans to build that into the default text input material component? See here for how it animates in xml land:

https://materialdoc.cn/images/password_toggle.gif