4

So I'm having trouble accessing the appcompat icons in the library and I dunno why.

// build.gradle
`compile 'com.android.support:appcompat-v7:23.2.0'`

I'm trying to use this icon: @drawable/abc_ic_clear_mtrl_alpha

// styles.xml
<style name="MyTheme" parent="Theme.AppCompat.Light">
    <item name="homeAsUpIndicator">@drawable/abc_ic_clear_mtrl_alpha</item>
</style>

But I get this error: Error:(12, 5) No resource found that matches the given name (at 'homeAsUpIndicator' with value '@drawable/abc_ic_clear_mtrl_alpha').

Any help is appreciated thanks.

mco
  • 1,809
  • 15
  • 31

2 Answers2

5

Support library v7:23.2.0 now supports Vector Drawable.

This way, a lot of drawable become useless or obsolete and where removed.

I think that abc_ic_clear_mtrl_alpha was replaced by abc_ic_clear_material which uses vector:

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0"
        android:tint="?attr/colorControlNormal">
    <path
            android:pathData="M19,6.41L17.59,5,12,10.59,6.41,5,5,6.41,10.59,12,5,17.59,6.41,19,12,13.41,17.59,19,19,17.59,13.41,12z"
            android:fillColor="@android:color/white"/>
</vector>

As you can see, the new icon uses vector and colorControlNormal.

You may want to check this question to check how to enable Vector and change the color of the icons.

Community
  • 1
  • 1
guipivoto
  • 18,327
  • 9
  • 60
  • 75
0

For newest versions you can found abc_ic_clear_mtrl_alpha and a lot of other icons doing this:

android.support.v7.appcompat.R.drawable.abc_ic_clear_material

Jorge Casariego
  • 21,948
  • 6
  • 90
  • 97