Hey how do you render the `Correct the following e...
# android
r
Hey how do you render the
Correct the following errors
in

https://storage.googleapis.com/material-design/publish/material_v_11/assets/0Bzhp5Z4wHba3dEZTUF9idzBHMWc/patterns_errors_userinput19.png

?
g
Just use TextView + background + text color
b
Have it hidden, and make it visible if there were errors
r
Oh ok, will there be fancy animation that comes for free from hiding n showing?
Is there code that controls elevation? Cos the grey bit looks deeper
g
It depends on what animation do you want to get. For example easiest soltion is just use Transition API from android.support.transition
r
Alright thanks the help
g
effect of “deep” can be done if you just add this “shadow” to bottom of view background
r
Is there a shadow property for all views?
b
In material design you can control elevation
theres a code sample
and also if you want another sample for what @gildor said:
r
Awesome thanks everyone
b
The training pages of developer.android have a lot of samples implementing the design guidelines
g
You can try to play with elevation, but it works only starting from API 21 or only for CardView
r
Im new to android studio so i dont know how easy it is to setup projects downloaded from the net
g
There are tons of tutorials in Google, including official ones
r
Also, im not using XML.
Im building views programmatically
g
You still can use all mentioned approaches
btw why do you decide to build view programmatically?
r
Im a masochist
Also Flexibility
I can easily add and remove views depending on context.
The UI gets the power of a programming language (kotlin, java)
Instead of XML
b
Then I suggest you take a look at Anko: https://github.com/Kotlin/anko/wiki/Anko-Layouts
r
I was interested in that, i also looked into https://github.com/zserge/anvil