7

I'm trying to apply a theme to a CustomEditText which inherit directly from EditText like "android:theme" attribute would do to any other classic widget. My theme don't use a style with custom attribute, it overloads my apptheme attributes to have a different "ColorControlNormal" attribute for exemple. Here are my theme :

Apptheme :

 <style name="Theme.Light.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowBackground">@android:color/white</item>
    <item name="android:colorBackground">@android:color/white</item>
    <item name="colorControlNormal">@color/pink</item>
    <item name="android:textColorPrimary">@color/grey_dark</item>
    <item name="colorControlActivated">@color/pink</item>
</style>

The theme I want to apply to my CustomEditText :

<style name="CustomEditTextTheme">
    <item name="android:textSize">@dimen/font_medium</item>
    <item name="android:ems">8</item>
    <item name="colorControlNormal">@color/grey_medium</item>
    <item name="colorControlActivated">@color/pink</item>
    <item name="android:textColorHint">@color/grey_medium</item>
</style>

I already read this but I don't have custom style attributes and I can't apply "CustomEditTextTheme" to my whole activity.

Obviously, android:theme="@style/CustomEditText don't make the job.

Community
  • 1
  • 1
Magnas
  • 869
  • 1
  • 5
  • 18
  • are you looking for style="@style/CustomEditText" ? – Luis Pereira Oct 23 '15 at 13:17
  • No, It wouldn't work even with normal widgets since I define "colorControl.." which are theme properties. What I'm trying to do is to apply CustomEditTextTheme to my CustomEditText like "android:theme" does on non-custom widgets. – Magnas Oct 23 '15 at 13:22

0 Answers0