Hey, I want to create a simple OTP/PIN layout, any...
# compose
j
Hey, I want to create a simple OTP/PIN layout, any ideas how to do it easily? Jumping one TextField to another doesn't seem like a pretty solution to me, but I have no other idea ATM.
s
What do you mean by jumping one TextField from another?
j
s
Multiple TextFields seems like a good solution to me. As far as I know, that's how it was achieved in the view system too
j
Actually I think most OTP/PIN layout libraries in the classic view system use a single field by extending the EditText class. Ex: https://github.com/ChaosLeung/PinView/blob/master/pinview/src/main/java/com/chaos/view/PinView.java
👌 3
s
Oh thanks for letting me know
d
@József Szilvási did you find a solution? Care to share how did you do it?
j
I went with a very simple solution. I put a transparent TextField on top of the digit fields and filling them according to the Textfield input. https://gist.github.com/naturlecso/132ad768521533357b234f1784144f51