Hey guys,

I have implemented gridView with gridView adapter, extended from 
baseAdapter.
And implemented method to change drawable id for gridView items:

public void changeDrawableForItem(int position, int drawable) {
    getItem(position).setDrawableId(drawable);
    notifyDataSetChanged();
}


For all changed Items I'm applying animation for 200ms.
And applying method "notifyDataSetChanged();" to updated all views in 
gridView.

All works as it shoud, except for one thing.

When I'm changing gradually few items in a row, within short intervals less 
then 200ms, I can see items blinking while they animating.
It's obvious that blinking is triggered by method "notifyDataSetChanged()" 
applied few times in a row within short intervals.

I have tried to get gridView item view and apply methods "invalidate()", 
"postInvalidate()", "requestLayout()" to update single view item in 
gridView:

public void changeDrawableForItem(int position, int drawable) {
    getItem(position).setDrawableId(drawable);
    View itemView = gridView.getChildAt(position);
    itemView.invalidate();
    itemView.postInvalidate();
    itemView.requestLayout();
}


But none of this methods makes this view to redraw.

Is there anyway to update single specific gridView item withoud updating 
all gridView with method "notifyDataSetChanged();" ?
Condition - all gridView items is always in view port.

Thanks in advance for your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/6ba559a5-7637-4266-adda-a7878cb8a0af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to