Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I figured out what was the problem. You should copy the android selector and modify it.</p> <p><strong>styles.xml</strong></p> <pre><code>&lt;style name="Theme.NewTransaction" parent="@style/Theme.AppCompat.Light.DarkActionBar"&gt; &lt;item name="selectableItemBackground"&gt;@drawable/actionbar_item_bg_selector&lt;/item&gt; &lt;/style&gt; </code></pre> <p><strong>actionbar_item_bg_selector.xml</strong></p> <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_window_focused="false" android:drawable="@color/transparent" /&gt; &lt;!-- Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state. --&gt; &lt;item android:state_focused="true" android:state_enabled="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_disabled" /&gt; &lt;item android:state_focused="true" android:state_enabled="false" android:drawable="@drawable/list_selector_background_disabled" /&gt; &lt;item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" /&gt; &lt;item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/list_selector_background_transition" /&gt; &lt;item android:state_focused="true" android:drawable="@drawable/list_selector_background_focused" /&gt; &lt;item android:drawable="@color/transparent" /&gt; &lt;/selector&gt; </code></pre> <p>I think my problem was related to this comment:<br> <em>Even though these two point to the same resource, have two states so the drawable will invalidate itself when coming out of pressed state.</em></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload