Skip to content

Instantly share code, notes, and snippets.

@onyxmueller
Created January 18, 2012 17:16
Show Gist options
  • Save onyxmueller/3cc77d8c00fd070aff24 to your computer and use it in GitHub Desktop.
Save onyxmueller/3cc77d8c00fd070aff24 to your computer and use it in GitHub Desktop.
Example code for PullToRefreshListView Issue #2
AnimationSet set = new AnimationSet(true);
set.setInterpolator(new AccelerateDecelerateInterpolator());
ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.50f, Animation.RELATIVE_TO_SELF, 0.50f);
scaleAnimation.setDuration(1000);
set.addAnimation(scaleAnimation);
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotateAnimation.setRepeatMode(Animation.REVERSE);
rotateAnimation.setDuration(1000);
set.addAnimation(rotateAnimation);
_pullToRefreshListView.setLayoutAnimation(new LayoutAnimationController(set, 0.25f));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment