zzhouj / Android-DraggableGridViewPager

Zaker style grid view pager, support dragging & rearrange, using as zaker's main screen.
MIT License
198 stars 71 forks source link

LayoutAnimationController results in slow animations #2

Open stephenohair opened 9 years ago

stephenohair commented 9 years ago

Hi,

Great work btw. I'm trying to animate the child items as they're added in this DraggableGridViewPager and while it works it's quite slow when it runs the animation in contrast to applying the same animation to a View.GridView. I know that GridView and your DraggableGridViewPager both extend ViewGroup so I'm puzzled at which point the slow down is occurring.

Here is how I apply the controller:

    DraggableGridViewPager pager = (DraggableGridViewPager) findViewById(R.id.app_pager);
    Animation zoomIn = AnimationUtils.loadAnimation(this, R.anim.zoom_in);
    LayoutAnimationController controller = new LayoutAnimationController(zoomIn);
    pager.setLayoutAnimation(controller);

Would you know what could be causing this please?

Regards,

Steve

stephenohair commented 9 years ago

I'm suspecting it's due to the number of items being animated. I have 134 items, 30 per page, 6 pages in total.

I noticed that animations are only applied to on screen items in GridView and ListView. WIth DraggableGridViewPager I can scroll to page 6 and wait about 5-10 secs while all animations apply to every item. Ideally I'd want the animations applied to the first page.

P.S - It appears to speed up the closer to the last page it gets.