3

I was wondering if there is a way that I can animate my GridView's Children to their new positions. So, for example, slide in from the left and when at the end of a row, slide off to the right. This will give the effect of each child moving to its new position, rather than just appearing there.

I have looked around, and could not find any useful information. Ideally a small code sample will get me on my way.

Thanks

Mimminito
  • 2,803
  • 3
  • 21
  • 27

3 Answers3

2

You should consider using GridLayoutAnimationController. GridLayoutAnimationController docs

Ron
  • 24,175
  • 8
  • 56
  • 97
  • Thanks, I have looked into this before, but not got much progress from it. Ill check again – Mimminito Aug 29 '11 at 08:47
  • I have looked into this again, and its not what I need. This will only animate when you have a set of data to begin with, not when you dynamically add data (well, in my experience). Unless you set this everytime a bindView or newView is called, which does not seem great, and does not look right either. – Mimminito Aug 29 '11 at 09:50
1

You may try looking at this video: http://www.youtube.com/watch?v=X984r7IOrgc

The developer somehow shares how he had implemented the animation in his reply on one of the comments. He could not show the source code yet though. Hope this helps.

i used android canvas and some code for positioning image tiles. it uses and data adapter pattern (like for all AdapterViews). each tile has it's position - page, row and column. draging changes tiles positions. - karooolek

vida
  • 4,459
  • 1
  • 22
  • 27
  • You shouldn't just give a link to another site as an answer, since the site may go out of date in the future. Instead, click the "edit" link on this answer and include the essential parts of the solution from that page here. See: http://meta.stackexchange.com/q/8259 – Peter O. Feb 13 '12 at 04:34
0

There are a few animations in the Android API Demo, including some animations for gridview. You might want to check the examples in com.example.android.apis.view.

NewProggie
  • 1,015
  • 1
  • 10
  • 24