https://kotlinlang.org logo
Title
r

robinchew

08/23/2017, 8:02 AM
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

gildor

08/23/2017, 8:04 AM
Just use TextView + background + text color
b

bamdmux

08/23/2017, 8:05 AM
Have it hidden, and make it visible if there were errors
r

robinchew

08/23/2017, 8:22 AM
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

gildor

08/23/2017, 8:26 AM
It depends on what animation do you want to get. For example easiest soltion is just use Transition API from android.support.transition
r

robinchew

08/23/2017, 8:27 AM
Alright thanks the help
g

gildor

08/23/2017, 8:30 AM
effect of “deep” can be done if you just add this “shadow” to bottom of view background
r

robinchew

08/23/2017, 8:31 AM
Is there a shadow property for all views?
b

bamdmux

08/23/2017, 8:31 AM
In material design you can control elevation
theres a code sample
and also if you want another sample for what @gildor said:
r

robinchew

08/23/2017, 8:33 AM
Awesome thanks everyone
b

bamdmux

08/23/2017, 8:34 AM
The training pages of developer.android have a lot of samples implementing the design guidelines
g

gildor

08/23/2017, 8:36 AM
You can try to play with elevation, but it works only starting from API 21 or only for CardView
r

robinchew

08/23/2017, 8:38 AM
Im new to android studio so i dont know how easy it is to setup projects downloaded from the net
g

gildor

08/23/2017, 8:39 AM
There are tons of tutorials in Google, including official ones
r

robinchew

08/23/2017, 8:40 AM
Also, im not using XML.
Im building views programmatically
g

gildor

08/23/2017, 8:51 AM
You still can use all mentioned approaches
btw why do you decide to build view programmatically?
r

robinchew

08/23/2017, 8:59 AM
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

bamdmux

08/23/2017, 9:03 AM
Then I suggest you take a look at Anko: https://github.com/Kotlin/anko/wiki/Anko-Layouts
r

robinchew

08/23/2017, 9:04 AM
I was interested in that, i also looked into https://github.com/zserge/anvil