Challenge (help pls)


#1

Does anybody find the solution?
I’ve tried this, but it made no effect.

<style name="BeatBoxButton" parent="Widget.AppCompat.Button">
        <item name="android:background">@drawable/button_beat_box</item>
        <item name="android:fadeEnabled">false</item>
        <item name="android:fadingEdge">none</item>
        <item name="android:fadeDuration">0</item>
        <item name="android:requiresFadingEdge">none</item>
</style>

Can I have some hint, @cstewart?


#2

I don’t remember the exact solution, but i think you just want your parent to be the borderless button style:

widget.AppCompat.Button.Borderless


#3

What about overriding the stateListAnimator attribute for v21 styles and have it equal null? This seems to work for me. I used the below in my qualified styles file (v21) and it worked.

<style name="BeatBoxButton" parent="Widget.AppCompat.Button">
    <item name="android:background">@drawable/button_beat_box</item>
    <item name="android:stateListAnimator">@null</item>
</style>

I was able to find the below in one of the stackoverflow posts.

<!-- Bordered ink button -->
<style name="Widget.Material.Button">
    <item name="background">@drawable/btn_default_material</item>
    <item name="textAppearance">?attr/textAppearanceButton</item>
    <item name="minHeight">48dip</item>
    <item name="minWidth">88dip</item>
    <item name="stateListAnimator">@anim/button_state_list_anim_material</item>
    <item name="focusable">true</item>
    <item name="clickable">true</item>
    <item name="gravity">center_vertical|center_horizontal</item>
</style>

Since the effect happened when moving between states, I thought that the stateListAnimator was the reason for the shadow. I didn’t think about the background at all, which is the only overriding attribute in the borderless theme, as below:

<style name="Base.Widget.AppCompat.Button.Borderless">
    <item name="android:background">@drawable/abc_btn_borderless_material</item>
</style>

So, the borderless button casts no shadow, that makes sense.

Further, one more question, in my android studio, the cmd+click worked from my values file. It took me to
/Users/srinath/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/9d80826e172c056566f54527eea1c2de/res/values/values.xml

From there cmd+click didn’t actually work, I used the find tool to find the relevant themes and attributes. Any idea why this is happening?

FYI: I do use org.gradle.caching=true in my gradle properties.