Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material design for subclass of EditText

In API 21, we can use colorAccent to change the color of widgets like EditText, RadioButton etc. But it doesn't apply to the subclasses of those widgets. I've tried this but it's just like colorAccent, it applies only to original widgets.

Is there any solution to this? other than having to create a custom drawable then implements it as a style..

like image 353
Dark Leonhart Avatar asked Oct 31 '14 08:10

Dark Leonhart


2 Answers

For applying colorAccent just extend your custom EditText class from android.support.v7.widget.AppCompatEditText

like image 90
AndrOvip Avatar answered Sep 24 '22 03:09

AndrOvip


Actually as of Android support 22.1 you should subclass AppCompatEditText.

like image 38
Jessicardo Avatar answered Sep 26 '22 03:09

Jessicardo