Beispiel #1
0
        public override void OnAnimationEnd(Animator animation)
        {
            base.OnAnimationEnd(animation);

            // forward on this message to our parent
            NavbarToolbar.OnAnimationEnd( animation );
        }
 public void OnAnimationEnd(Animator animation)
 {
     if (onComplete != null)
     {
         onComplete();
     }
 }
Beispiel #3
0
        public void DrawMask(View target, Canvas maskCanvas, Color maskColor, Point position, int radius, Animator animator)
        {
            // draw solid background
            maskCanvas.DrawColor(maskColor);

            // erase focus area
            maskCanvas.DrawCircle(position.X, position.Y, radius, eraserPaint);
        }
        public void DrawMask(View target, Canvas maskCanvas, Color maskColor, Point position, int radius, Animator animator)
        {
            var valueAnimator = animator as ValueAnimator;
            var bounce = valueAnimator != null ? (float)valueAnimator.AnimatedValue : target.Alpha;

            // draw solid background
            maskCanvas.DrawColor(maskColor);

            // erase focus area
            maskCanvas.DrawCircle(position.X, position.Y, radius * bouncy.GetInterpolation(bounce), eraserPaint);
        }
 public static void AttachEvents(Animator animator, Action started, Action ended)
 {
     if (started != null)
     {
         animator.AnimationStart += delegate
         {
             started();
         };
     }
     if (ended != null)
     {
         animator.AnimationEnd += delegate
         {
             ended();
         };
     }
 }
        /**
         * Merges given Animators into one array.
         */
        //@NonNull
        public static Animator[] concatAnimators(Animator[] childAnimators, Animator[] animators, Animator alphaAnimator)
        {
            Animator[] allAnimators = new Animator[childAnimators.Length + animators.Length + 1];
            int i;

            for (i = 0; i < childAnimators.Length; ++i)
            {
                allAnimators[i] = childAnimators[i];
            }

            foreach (Animator animator in animators)
            {
                allAnimators[i] = animator;
                ++i;
            }

            allAnimators[allAnimators.Length - 1] = alphaAnimator;
            return allAnimators;
        }
Beispiel #7
0
 public void OnAnimationStart(Android.Animation.Animator animation)
 {
 }
Beispiel #8
0
 public void startProgress(long paramLong, Animator.IAnimatorListener paramAnimatorListener)
 {
     startProgress(paramLong, new AccelerateDecelerateInterpolator(), paramAnimatorListener);
 }
Beispiel #9
0
        public void Reset (SummaryReportView data)
        {
            this.data = data;

            // Cancel old animation
            if (currentRevealAnimation != null) {
                currentRevealAnimation.Cancel ();
                currentRevealAnimation = null;
            }
            if (currentSelectAnimation != null) {
                currentSelectAnimation.Cancel ();
                currentSelectAnimation = null;
            }

            var totalSlices = data == null || data.CollapsedProjects == null ? 0 : data.CollapsedProjects.Count;

            SetActiveSlice (-1, updateStats: false);
            backgroundView.Visibility = ViewStates.Visible;
            backgroundView.Radius = defaultRadius;

            ResetSlices (totalSlices);
            if (totalSlices > 0) {
                var totalTime = data.CollapsedProjects.Sum (x => x.TotalTime);
                var startAngle = 0f;

                for (var i = 0; i < totalSlices; i++) {
                    var slice = slices [i];
                    var project = data.CollapsedProjects [i];
                    var percentOfAll = (float)project.TotalTime / totalTime;

                    slice.Visibility = ViewStates.Gone;
                    slice.Radius = defaultRadius;
                    if (project.Color == ProjectModel.GroupedProjectColorIndex) {
                        slice.Color = Color.ParseColor (ProjectModel.GroupedProjectColor);
                    } else {
                        slice.Color = Color.ParseColor (ProjectModel.HexColors [project.Color % ProjectModel.HexColors.Length]);
                    }
                    slice.StartAngle = startAngle;
                    startAngle += percentOfAll * 360;
                }
            }

            // Detect state
            var isLoading = data == null || data.IsLoading;
            var isEmpty = !isLoading && totalSlices == 0;

            if (isLoading) {
                // Loading state
                loadingOverlayView.Visibility = ViewStates.Visible;
                loadingOverlayView.Alpha = 1f;

                emptyOverlayView.Visibility = ViewStates.Gone;
                statsOverlayView.Visibility = ViewStates.Gone;
            } else if (isEmpty) {
                // Error state
                loadingOverlayView.Visibility = ViewStates.Visible;
                loadingOverlayView.Alpha = 1f;

                emptyOverlayView.Visibility = ViewStates.Visible;
                emptyOverlayView.Alpha = 0f;

                statsOverlayView.Visibility = ViewStates.Gone;

                // Animate overlay in
                var scene = new AnimatorSet ();

                var fadeIn = ObjectAnimator.OfFloat (emptyOverlayView, "alpha", 0f, 1f).SetDuration (500);
                var fadeOut = ObjectAnimator.OfFloat (loadingOverlayView, "alpha", 1f, 0f).SetDuration (500);
                fadeOut.AnimationEnd += delegate {
                    loadingOverlayView.Visibility = ViewStates.Gone;
                };

                scene.Play (fadeOut);
                scene.Play (fadeIn).After (3 * fadeOut.Duration / 4);

                currentRevealAnimation = scene;
                scene.Start();
            } else {
                // Normal state
                var scene = new AnimatorSet ();

                // Fade loading message out
                statsOverlayView.Visibility = ViewStates.Visible;
                statsOverlayView.Alpha = 0f;

                var fadeOverlayOut = ObjectAnimator.OfFloat (loadingOverlayView, "alpha", 1f, 0f).SetDuration (500);
                fadeOverlayOut.AnimationEnd += delegate {
                    loadingOverlayView.Visibility = ViewStates.Gone;
                };
                scene.Play (fadeOverlayOut);

                var fadeOverlayIn = ObjectAnimator.OfFloat (statsOverlayView, "alpha", 0f, 1f).SetDuration (500);
                scene.Play (fadeOverlayIn).After (3 * fadeOverlayOut.Duration / 4);

                var donutReveal = ValueAnimator.OfFloat (0, 360);
                donutReveal.SetDuration (750);
                donutReveal.Update += (sender, e) => ShowSlices ((float)e.Animation.AnimatedValue);
                scene.Play (donutReveal).After (fadeOverlayOut.Duration / 2);

                currentRevealAnimation = scene;
                scene.Start();
            }

            UpdateStats ();
            RequestLayout ();
        }
			public override void OnAnimationEnd (Animator animation)
			{
				_onAnimationEnd (animation);
			}
Beispiel #11
0
        public void OnAnimationEnd( Animator animation )
        {
            Animating = false;

            InputViewChecker.BringToFront( );

            // based on the position, set the springboard flag
            if ( View.GetX( ) == 0 )
            {
                SpringboardRevealed = false;
                NavToolbar.Suspend( false );

                ToggleInputViewChecker( false );
            }
            else
            {
                SpringboardRevealed = true;
                NavToolbar.Suspend( true );

                if ( MainActivity.IsLandscapeWide( ) == false )
                {
                    ToggleInputViewChecker( true );
                }
            }

            // notify the task regarding what happened
            ActiveTask.SpringboardDidAnimate( SpringboardRevealed );
        }
Beispiel #12
0
		public void OnAnimationCancel(Animator animation) {
			mView.SetLayerType(LayerType.None, null);
		}
Beispiel #13
0
 public void OnAnimationStart(Animator animation)
 {
     var h = AnimationStart;
     if (h != null)
         h (animation, EventArgs.Empty);
 }
			public void OnAnimationEnd (Animator animation)
			{
				if (OnAnimationEndAction != null) {
					OnAnimationEndAction (animation);
				}
			}
			public void OnAnimationCancel (Animator animation)
			{
				if (OnAnimationCancelAction != null) {
					OnAnimationCancelAction (animation);
				}
			}
 public void OnAnimationEnd(Animator animation)
 {
     if (_isShow)
         _dragGesture.LayoutShowStatus ();
     else
         _dragGesture.LayoutHideStatus ();
 }
 //@Override
 public void onAnimationEnd( Animator animation) {
     mUndoView.Visibility=ViewStates.Gone;
     minst.finalizeDismiss();
 }
Beispiel #18
0
 public void OnAnimationRepeat(Android.Animation.Animator animation)
 {
 }
 //@Override
 public  override void OnAnimationEnd(Animator animation)
 {
     minst.mActiveDismissCount--;
     minst.finalizeDismiss();
 }
			public void OnAnimationRepeat (Animator animation)
			{
				if (OnAnimationRepeatAction != null) {
					OnAnimationRepeatAction (animation);
				}
			}
Beispiel #21
0
 public void OnAnimationCancel(Animator animation)
 {
     var h = AnimationCancel;
     if (h != null)
         h (animation, EventArgs.Empty);
 }
			public void OnAnimationStart (Animator animation)
			{
				if (OnAnimationStartAction != null) {
					OnAnimationStartAction (animation);
				}
			}
Beispiel #23
0
		public void OnAnimationStart(Animator animation) {
			mView.SetLayerType(LayerType.Hardware, null);
		}
Beispiel #24
0
 public override void OnAnimationEnd(Animator animation)
 {
     barView.Visibility = ViewStates.Gone;
     message = null;
 }
Beispiel #25
0
		public void OnAnimationRepeat(Animator animation) {

		}
 public void OnAnimationCancel(Animator animation)
 {
 }
Beispiel #27
0
 public override void OnAnimationEnd(Animator animation)
 {
     base.OnAnimationEnd(animation);
     scroll.bubble.Visibility = ViewStates.Invisible;
     scroll.currentAnimator = null;
 }
Beispiel #28
0
 public void OnAnimationEnd(Android.Animation.Animator animation)
 {
     OnStop();
 }
			public override void OnAnimationEnd (Animator animation)
			{
				b.RefreshDrawableState ();

				b.revealView.Visibility = ViewStates.Gone;
				// Reset the touch point as the next call to setChecked might not come
				// from a tap.
				b.touchPoint = null;
			}
 public void OnAnimationStart(Animator animation)
 {
 }
Beispiel #31
0
        private void SetActiveSlice (int value, bool animate = false, bool updateStats = true)
        {
            if (slices.Count == 1 || value >= slices.Count) {
                value = -1;
            }

            if (value == activeSlice) {
                return;
            }

            activeSlice = value;
            Clickable = activeSlice >= 0;

            if (updateStats) {
                UpdateStats ();
            }

            if (animate) {
                // Finish currently running animations
                if (currentSelectAnimation != null) {
                    currentSelectAnimation.Cancel ();
                }

                // Animate changes
                var scene = new AnimatorSet ();
                for (var i = 0; i < slices.Count; i++) {
                    var slice = slices [i];

                    if (i == activeSlice) {
                        // Slice activating animations
                        if (slice.Alpha < 1) {
                            var fadeIn = ObjectAnimator.OfFloat (slice, "alpha", slice.Alpha, 1).SetDuration (500);
                            scene.Play (fadeIn);
                        }
                        if (slice.ScaleX != ActiveSliceScale) {
                            var scaleXUp = ObjectAnimator.OfFloat (slice, "scaleX", slice.ScaleX, ActiveSliceScale).SetDuration (500);
                            scene.Play (scaleXUp);
                        }
                        if (slice.ScaleY != ActiveSliceScale) {
                            var scaleYUp = ObjectAnimator.OfFloat (slice, "scaleY", slice.ScaleY, ActiveSliceScale).SetDuration (500);
                            scene.Play (scaleYUp);
                        }
                    } else if (activeSlice >= 0) {
                        // Slice deactivating animations
                        if (slice.Alpha > 0.5f) {
                            var fadeOut = ObjectAnimator.OfFloat (slice, "alpha", slice.Alpha, 0.5f).SetDuration (300);
                            scene.Play (fadeOut);
                        }
                        if (slice.ScaleX != NonActiveSliceScale) {
                            var scaleXDown = ObjectAnimator.OfFloat (slice, "scaleX", slice.ScaleX, NonActiveSliceScale).SetDuration (300);
                            scene.Play (scaleXDown);
                        }
                        if (slice.ScaleY != NonActiveSliceScale) {
                            var scaleYDown = ObjectAnimator.OfFloat (slice, "scaleY", slice.ScaleY, NonActiveSliceScale).SetDuration (300);
                            scene.Play (scaleYDown);
                        }
                    } else {
                        // No slice selected animations
                        if (slice.Alpha < 1) {
                            var fadeIn = ObjectAnimator.OfFloat (slice, "alpha", slice.Alpha, 1).SetDuration (300);
                            scene.Play (fadeIn);
                        }
                        if (slice.ScaleX != 1) {
                            var scaleXDown = ObjectAnimator.OfFloat (slice, "scaleX", slice.ScaleX, 1f).SetDuration (300);
                            scene.Play (scaleXDown);
                        }
                        if (slice.ScaleY != 1) {
                            var scaleYDown = ObjectAnimator.OfFloat (slice, "scaleY", slice.ScaleY, 1f).SetDuration (300);
                            scene.Play (scaleYDown);
                        }
                    }
                }

                currentSelectAnimation = scene;
                scene.Start ();
            }

            // Notify listeners
            if (ActiveSliceChanged != null) {
                ActiveSliceChanged (this, EventArgs.Empty);
            }
        }
        private void ShowSyncError (bool visible)
        {
            if (currentAnimation != null) {
                currentAnimation.Cancel();
                currentAnimation = null;
            }

            if (visible && syncErrorBar.Visibility == ViewStates.Gone) {
                var slideIn = ObjectAnimator.OfFloat (syncErrorBar, "translationY", 100f, 0f).SetDuration (500);
                slideIn.AnimationStart += delegate {
                    syncErrorBar.Visibility = ViewStates.Visible;
                };
                currentAnimation = slideIn;
                currentAnimation.Start ();
            } else if (!visible && syncErrorBar.Visibility == ViewStates.Visible) {
                var slideOut = ObjectAnimator.OfFloat (syncErrorBar, "translationY", syncErrorBar.TranslationY, 100f).SetDuration (500);
                slideOut.AnimationEnd += delegate {
                    syncErrorBar.Visibility = ViewStates.Gone;
                };
                currentAnimation = slideOut;
                currentAnimation.Start ();
            }
        }
Beispiel #33
0
 public void startProgress(long paramLong, ITimeInterpolator paramTimeInterpolator, Animator.IAnimatorListener paramAnimatorListener)
 {
     hideIndeterminateSlider(true);
     this.slider.TranslationX = 0.0F;
     showSlider(false);
     int i = Resources.DisplayMetrics.WidthPixels;
     FrameLayout.LayoutParams localLayoutParams = (FrameLayout.LayoutParams) this.slider.LayoutParameters;
     localLayoutParams.Width= i;
     localLayoutParams.SetMargins(-i, 0, 0, 0);
     this.slider.LayoutParameters = localLayoutParams;
     this.progressAnimator = this.slider.Animate().TranslationX(i).SetDuration(paramLong).SetInterpolator(paramTimeInterpolator).SetListener(paramAnimatorListener);
 }
Beispiel #34
0
 public void OnAnimationCancel(Android.Animation.Animator animation)
 {
     OnStop();
 }