Search code examples
androidattributesandroid-appcompatandroid-theme

Where can I found definition for selectableItemBackgroundBorderless reference attribute?


Where I can found definition for ?attr/selectableItemBackgroundBorderless ?

For example:

<ImageButton
    android:id="@+id/removeButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="end"
    android:layout_margin="8dp"
    android:background="?attr/selectableItemBackgroundBorderless"
    android:contentDescription="@string/content_description"
    android:tint="@color/colorPrimaryText"
    app:srcCompat="@drawable/ic_cancel" />

I mean I can see reference definition in appcompat-1.2.0\res\values\values.xml i.e.:

<item name="selectableItemBackgroundBorderless">?attr/selectableItemBackground</item>

But where is defined this attribute?


Solution

  • In my installation, I'm using:

    compileSdkVersion 29
    minSdkVersion 21
    targetSdkVersion 29
    

    I found selectableItemBackgroundBorderless defined in \AppData\Local\Android\Sdk\platforms\android-29\data\res\values\themes_material.xml where:

    <item name="selectableItemBackgroundBorderless">@drawable/item_background_borderless_material</item>
    

    then in AppData\Local\Android\Sdk\platforms\android-29\data\res\drawable\item_background_borderless_material.xml

    <ripple xmlns:android="http://schemas.android.com/apk/res/android"
        android:color="?attr/colorControlHighlight" />
    

    and colorControlHighlight defined in Android\Sdk\platforms\android-29\data\res\values\themes_material.xml as:

    <item name="colorControlHighlight">@color/ripple_material_light</item>
    

    @color/ripple_material_light defined in Android\Sdk\platforms\android-29\data\res\color\ripple_material_light.xml as:

    <selector xmlns:android="http://schemas.android.com/apk/res/android">
        <item android:alpha="@dimen/highlight_alpha_material_light"
              android:color="@color/foreground_material_light" />
    </selector>
    

    What an absurd ride...