https://kotlinlang.org logo
#compose
Title
# compose
y

Yann Badoual

06/09/2022, 4:36 PM
Any simple way to draw this kind of code
TextField
? Two ideas in mind: • Using N
TextField
• Drawing a canvas above the actual
TextField
Wondering if there's no better way to do this
j

Joseph Hawkes-Cates

06/10/2022, 2:17 AM
You can set a Visual Transformation on your text field which will do this for you. Specifically in the linked doc there is a PasswordVisualTransformation provided.
y

Yann Badoual

06/10/2022, 8:01 AM
Might work in some case, but depending on the design, might not work. Using
BasicTextField
with a custom
decorationBox
not calling
innerTextField()
does the trick.
Copy code
BasicTextField(
   // ...
) { innerTextField ->
   Canvas {
        // Custom draw
   }
}
3 Views