Android-DraggableGridViewPager icon indicating copy to clipboard operation
Android-DraggableGridViewPager copied to clipboard

LayoutAnimationController results in slow animations

Open stephenohair opened this issue 11 years ago • 1 comments

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 avatar Nov 30 '14 12:11 stephenohair

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.

stephenohair avatar Nov 30 '14 12:11 stephenohair