Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid StateListDrawable bug?
    primarykey
    data
    text
    <p>i have <code>StateListdrawable</code> in xml</p> <pre><code>&lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item android:state_activated="false" android:drawable="@drawable/ic_checked_off" /&gt; &lt;item android:state_activated="true" android:drawable="@drawable/ic_checked_on" /&gt; &lt;item android:drawable="@drawable/ic_checked_on" android:state_pressed="true" /&gt; &lt;item android:drawable="@drawable/ic_checked_off" /&gt; &lt;/selector&gt; </code></pre> <p>i have <code>GridView</code> images which has <code>StateListDrawable</code>, and programically try to change drawable state with</p> <pre><code> if(mSelected.contains(photo)){ view.findViewById(R.id.selector).setActivated(true); } </code></pre> <p>images which selected changes state, but when i click his state not change, i'm sorry i can't explain what i want, my english is worse</p> <p>i try to explain it </p> <p>if <code>mSelected.contains(photo) [state - active] -&gt; [checked_on.jpg]</code> when i click -> state drawable begins from first and ignoring my programically state changes</p> <p><strong>==Edit==</strong></p> <p>Adapter Item --</p> <pre><code>private View getPhoto(int position, View convertView, ViewGroup parent){ View view = convertView; if(convertView == null){ view = LayoutInflater.from(mContext).inflate(R.layout.gallery_photo_item, parent, false); } ImageView mPhoto = (ImageView)view.findViewById(R.id.photoview); Photo photo = (Photo) getItem(position - COLUMNS_NUM); if(mSelected.contains(photo)){ view.findViewById(R.id.selector).setActivated(true); // here i change my drawable state because it's front of my imageView } mLoader.displayImage(MediaStore.Images.Media.EXTERNAL_CONTENT_URI + File.separator + photo.id, mPhoto); return view; } </code></pre>
    singulars
    1. This table or related slice is empty.
    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. 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