void Animate(LibraryHoloCircularProgressBar.HoloCircularProgressBar progressBar, Android.Animation.Animator.IAnimatorListener listener,float progress, int duration) { _progressBarAnimator = ObjectAnimator.OfFloat(progressBar, "progress", progress); _progressBarAnimator.SetDuration(duration); progressBar1 = progressBar; progress1 = progress; _progressBarAnimator.AddListener (this); if (listener != null) { _progressBarAnimator.AddListener(listener); } _progressBarAnimator.Reverse(); _progressBarAnimator.AddUpdateListener (this); progressBar.SetMarkerProgress(progress); _progressBarAnimator.Start(); }
private void hideBubble() { if(currentAnimator != null) currentAnimator.Cancel(); currentAnimator = (ObjectAnimator)ObjectAnimator.OfFloat(bubble,"alpha",1f,0f).SetDuration(BUBBLE_ANIMATION_DURATION); currentAnimator.AddListener(new MyListener(this)); currentAnimator.Start(); }
public ExpandHelper(Context context, Callback callback, int small, int large) { this.smallSize = small; this.maximumStretch = Math.Max (smallSize, 1) * StretchInterval; this.largeSize = large; this.context = context; this.callback = callback; this.scaler = new ViewScaler(); this.gravity = GravityFlags.Top; //this.scaleAnimation = ObjectAnimator.OfFloat (scaler, "Height", 0f); this.scaleAnimation = ValueAnimator.OfFloat (0f); this.scaleAnimation.Update += (sender, e) => scaler.Height = (float)e.Animation.AnimatedValue; this.scaleAnimation.SetDuration (ExpandDuration); AnimatorListenerAdapter glowVisibilityController = new AnimatorListener (); glowTopAnimation = ObjectAnimator.OfFloat (null, "alpha", 0f); glowTopAnimation.AddListener (glowVisibilityController); glowBottomAnimation = ObjectAnimator.OfFloat (null, "alpha", 0f); glowBottomAnimation.AddListener (glowVisibilityController); glowAnimationSet = new AnimatorSet(); glowAnimationSet.Play (glowTopAnimation).With(glowBottomAnimation); glowAnimationSet.SetDuration(GlowDuration); detector = new DoubleSwipeDetector(context, new GestureDetector (this)); }