Perry Hoekstra
Perry Hoekstra

Reputation: 2763

Implement Material-themed widgets

I have a values/styles.xml file with quite a number of entries within it such as defining the ActionBar, it's title and tab text. In my application, I would like it to show the new Materials Design icons when running on an Android 5.x smartphones.

Looking at this Developer Guideline page, I have in values/styles.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.Foo" parent="android:Theme.Holo.Light.DarkActionBar">
        <item name="android:actionBarStyle">@style/FooActionBar</item>
        <item name="android:actionBarTabTextStyle">@style/FooActionBarTabText</item>
    </style>

    <style name="FooActionBar"
        parent="android:Widget.Holo.ActionBar">
       ...
    </style>

    <!-- ActionBar title text -->
    <style name="FooActionBarTitleText"
        parent="android:TextAppearance.Holo.Widget.ActionBar.Title">
        ...
    </style>

    <!-- ActionBar tabs text styles -->
    <style name="FooActionBarTabText"
        parent="android:Widget.Holo.ActionBar.TabText">
        ...
    </style>
</resources>

In my values-v21/styles.xml file, I just have:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Theme.Foo" parent="android:Theme.Material.Light.DarkActionBar">
    </style>
</resources>

However, that seems to be ignored as when I go to various screens on an Android 5.x phone, it is still showing the KitKat widgets. What did I interpret wrong on the Maintaining Compatibility developer guide page? Do I have to provide entries for elements such as FooActionBar and FooActionBarTitleText with the the values-v21/styles.xml file?

Upvotes: 0

Views: 56

Answers (1)

I don't know if you copy pasted wrong but it is values-v21/styles.xml instead of values-21/styles.xml

Upvotes: 2

Related Questions