2

I couldn't find any hint about the color of the Edit Text. There are some information about sizes here but it doesn't mention about the color.

Edit Text info

Should I treat it as a divider as mentioned here?:

Colors

osrl
  • 8,168
  • 8
  • 36
  • 57

3 Answers3

0

The new "TextInputLayout" control (included in the Design Support library) colors that line the same color as your accent color. This is done automatically by the OS as part of the AppCompat functionality.

So, I can't point to official docs for this - but I can tell you that the official "Material" input control colors the line the same as an accent color.

Bottom line, I think the line should be your accent color (when the EditText is focused and input is active on that view).

Booger
  • 18,579
  • 7
  • 55
  • 72
0

You should be using accent color.

https://www.google.co.in/design/spec/style/color.html#color-ui-color-application (check Fallback accent colors section)

If your accent color is too light or dark to sufficiently contrast with the background color, use a darker or lighter tint of the accent color instead. If your accent color doesn’t work at all, use the 500 version of your primary color on white backgrounds. If your background color is the 500 version of your primary color, make your accent color either white 100% or black 54%.

Ramesh
  • 1,287
  • 1
  • 9
  • 14
  • What about the unfocused state? – osrl Aug 17 '15 at 13:19
  • Though i cant point to any documentation, I dont think we need to set unfocused state color and hint text color and they will be set by android automatically. in the same above link if you see "Toolbars and status bars" section, They have given how sample edittext should look like. I tried setting same primary color as the same one shown (3F51B5) and hint color/ unfocused state appeared similar to that by default without setting any values by myself. – Ramesh Aug 17 '15 at 13:33
  • I don't know the default value but when I use EditText with AppCompat style, it looks like a black color. I think it should be a transparent color. "Disabled / Hint text : %30". Since the hint text and the unfocused line has the same color(i think) line should be %30 transparent black. – osrl Aug 18 '15 at 09:05
  • 1
    oops!! verified my code again I saw that i have hint text defined as #000000 with opacity of 0.26 for light and white with 0.3 opacity for dark themes for my buttons and same style is applied to edittext as well. Cant find resources for edittext but button specs which i followed are available at https://www.google.co.in/design/spec/components/buttons.html#buttons-flat-raised-buttons – Ramesh Aug 18 '15 at 11:35
-2

You can change the color of edit text line no need to treat it as the border already answer to this question is listed here. Once go through this links:

How to change line color in EditText

Change Line Color of EditText - Android

Thanks

Community
  • 1
  • 1