Ajay
Ajay

Reputation: 4926

Grid View single child drawable animation

hello , i want to drawable animation for only grid view single child but i could not find the proper solution for this

enter image description here

this is sample pic where you can see the red circle , i just want the drawable animation for that grid view child [red circle image].

Thanks....

Upvotes: 0

Views: 1266

Answers (1)

Ajay
Ajay

Reputation: 4926

Here is solution .....

i just write the following code into getView method of Adapter class

if (position == 0) {
                v.setBackgroundResource(R.anim.frame);
                mAnimation = (AnimationDrawable) v.getBackground();
                v.postDelayed(new Runnable() {
                    public void run() {
                        if (mAnimation != null)
                            mAnimation .start();
                    }
                }, 100);
            }

Upvotes: 1

Related Questions