parent="@ android: style / TextAppearance.Material.Title" API 19

0

I have a problem with compatibility with the following code

  <style name="ExpandedAppbar" parent="@android:style/TextAppearance.Material.Title">
        <item name="android:textColor">@color/colorPrimary</item>
        <item name="android:textStyle">normal</item>
    </style>

in specific with this part

  

parent="@ android: style / TextAppearance.Material.Title"

Since it was implemented in API 21, they have some replacement for API 19 that does not generate this incompatibility error.

Thanks. !!!!! c;

    
asked by Neil 14.11.2017 в 21:54
source

1 answer

1

For this you need to have a 2-value folder.

One that exists by defect , and another, you have to create in your folder res and give it the name values-v21 .

In the default value folder, in styles.xml , use a subject other than Material Desing. And in the styles.xml of values-v21 folder that you created, use the Subject Material D.

The Smartphone will automatically select the styles.xml file that it supports. If the phone is compatible with Material Design (Lollipop + devices), your application will use theme material (values-21 folder).

If you do not (in phones with previous versions of Android), the default folder will be used.

    
answered by 15.11.2017 / 00:18
source