Can I customize the global custom widget app styles for Android support?

I would like to define custom styles for some widgets from Android Support Design (e.g. AppBarLayout, TextInputLayout, FAB ...) and set these styles by default for my project, as I can do with EditText and other system widgets. For example:

<style name="Theme.MyApp" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/colorPrimary</item> <item name="colorPrimaryDark">@color/colorPrimaryDark</item> <item name="android:editTextStyle">@style/Theme.MyApp.EditText</item> </style> <style name="Theme.MyApp.EditText" parent="Widget.AppCompat.EditText"> <item name="android:textColor">@color/my_awsome_edittext_color</item> <item name="android:layout_height">wrap_content</item> </style> 

My current problem is set to raise AppBarLayout elevation = "0dp" for a specific Activity that has its own theme. After figuring out the source code for the Android AppBarLayout support design, I found out that it has a theme called Widget.Design.AppBarLayout , so I did:

 <style name="Theme.MyApp.AppBarLayout" parent="Widget.Design.AppBarLayout"> <item name="elevation">0dp</item> </style> 

But I did not find an attribute to set it in my Theme.MyApp , for example android:editTextStyle . And this is true for TextInputLayout, FAB and so on. These widgets customize their themes directly from the resource:

 TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.AppBarLayout, R.style.Widget_Design_AppBarLayout); 

So, there really is no way to define styles in this form? If not, are there any technical reasons not to provide this feature?

+8
android themes android-textinputlayout androiddesignsupport android-appbarlayout
source share

No one has answered this question yet.

See related questions:

337
Cannot find Theme.AppCompat.Light for new Android ActionBar support
26
How to style NavigationView design support library?
5
What is the difference between colorPrimary and PrimaryDark color in themes
5
error: Error: A resource was not found that matches the specified name: attr 'colorAccent'
4
Android support library 23.2.0 error in setting style = "@ style / Widget.AppCompat.Button.Colored"
one
Android text color for Spinner with custom style
0
Android theme tag style
0
Do not use some AppCompat themes and attributes.
0
The shadow of the toolbar disappears when the background color is dark
-one
Custom Material Design for Android

All Articles