What is the right way to create an error state for...
# compose
f
What is the right way to create an error state for TextFields similar to the old TextInputEditText? I see there is an
isError
argument. Do I have to add the error message manually as a
Text
below my TextField?
a
Right,
isError
causes the Material textfield to use error styling (for example red color), but as for the message, you can set it manually as part of the label or somewhere outside it that fits your layout
👍 1
f
thank you!
f
Thanks. I actually have that app installed and the tab opened but I forgot about it this time 🤦‍♂️
c
I don't think that's an app (i think you're referring to the material compose demo app on the play store)? That's just the samples that ship with the docs in a single repo.
f
yea it's nice for trying out the different components
c
Yeah. I'm saying that the cs link I posted above is different.
f
oh yea I know
thanks
s
FYI you can run the compose samples in the (eng) demo if you checkout androidx and launch the compose demo apk They're a random collection of things that were useful for the developer working on a feature, not really a polished catalog. But sometimes nice to see it on a real phone
c
Ooh. Is that apk published somewhere @Sean McQuillan [G]? Or do I actually have to go in and build it myself?
s
Gotta build it yourself. Again, it's not really a polished demo more a collection of code 😃
😅 1