Skip to content

Instantly share code, notes, and snippets.

@Redth
Created August 20, 2013 15:44
Show Gist options
  • Select an option

  • Save Redth/6283219 to your computer and use it in GitHub Desktop.

Select an option

Save Redth/6283219 to your computer and use it in GitHub Desktop.
public void SetProgress(int i)
{
isSpinning = false;
var newProgress = (int)((float)i / (float)100 * (float)360);
if (version >= Android.OS.BuildVersionCodes.Honeycomb)
{
Android.Animation.ValueAnimator va =
(Android.Animation.ValueAnimator)Android.Animation.ValueAnimator.OfInt (progress, newProgress).SetDuration (250);
va.Update += (sender, e) => {
var interimValue = (int)e.Animation.AnimatedValue;
progress = interimValue;
//Text = Math.Round(((float)interimValue/(float)360)*(float)100) + "%";
Invalidate ();
};
va.Start ();
}
else
progress = newProgress;
spinHandler.SendEmptyMessage(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment