Start() public method

public Start ( ) : void
return void
コード例 #1
0
        //================================================================
        //Getter and Setter
        //================================================================

        //================================================================
        //Methodes
        //================================================================
        #region
        public void Animation()
        {
            animation.Start();
            if (StartAnimation != null)
            {
                StartAnimation(this);
            }
        }
コード例 #2
0
ファイル: TutorialOverlay.cs プロジェクト: yurkinh/FlappyBird
        public override void Show()
        {
            base.Show();

            fadeAnimator.Start(0f, 1f, TutorialFadeInterpolator, TutorialFadeDuration);

            Finished = false;
            Visible  = true;
        }
コード例 #3
0
ファイル: GameOverOverlay.cs プロジェクト: pav0n/FlappyBird
        public override void Show()
        {
            base.Show();

            fadeAnimator.Start(0f, 1f, FlashInterpolator, FlashDuration);

            offset      = InitialBounceOffset;
            offsetSpeed = InitialBounceSpeed;

            Visible  = true;
            Finished = false;
        }
コード例 #4
0
 public void OnAnimationEnd(Animation animation)
 {
     if (_isCollapsing)
     {
         _context.compactCalendarController.setAnimatingHeight(false);
         _context.compactCalendarController.setAnimatingIndicators(true);
         _animIndicator.Start();
     }
     else
     {
         _context.compactCalendarController.setAnimatingIndicators(false);
     }
 }
コード例 #5
0
ファイル: TaskActivity.cs プロジェクト: nisheed75/GrowSure
        void StartCategoryFromClickOn(View view)
        {
            InitCategoryFragment();
            FragmentManager.BeginTransaction().Replace(Resource.Id.category_fragment_container, categoryFragment, FragmentTag).Commit();
            View fragmentContainer = FindViewById(Resource.Id.category_fragment_container);
            int  centerX           = (view.Left + view.Right) / 2;
            int  centerY           = (view.Top + view.Bottom) / 2;
            int  finalRadius       = Math.Max(fragmentContainer.Width, fragmentContainer.Height);

            circularReveal = ViewAnimationUtils.CreateCircularReveal(
                fragmentContainer, centerX, centerY, 0, finalRadius);
            fragmentContainer.Visibility = ViewStates.Visible;
            view.Visibility = ViewStates.Gone;

            EventHandler handler = null;

            handler += (sender, e) => {
                //icon.Visibility = ViewStates.Gone;
                circularReveal.AnimationEnd -= handler;
            };
            circularReveal.AnimationEnd += handler;

            circularReveal.Start();

            toolbar.Elevation = 0;
        }
コード例 #6
0
        public static void AnimateVisibility(bool show, View view)
        {
            if ((show && view.Visibility == ViewStates.Visible) || !show && view.Visibility != ViewStates.Visible)
            {
                return;
            }

            int   cx     = view.Width / 2;
            int   cy     = view.Height / 2;
            float radius = (float)Math.Hypot(cx, cy);

            if (show)
            {
                Animator anim = ViewAnimationUtils.CreateCircularReveal(view, cx, cy, 0, radius);
                view.Visibility = ViewStates.Visible;
                anim.Start();
            }
            else
            {
                try
                {
                    Animator anim =
                        ViewAnimationUtils.CreateCircularReveal(view, cx, cy, radius, 0);
                    anim.AnimationEnd += delegate { view.Visibility = ViewStates.Invisible; };
                    anim.Start();
                }
                catch (System.Exception)
                {
                    view.Visibility = ViewStates.Invisible;
                }
            }
        }
コード例 #7
0
ファイル: NavToolbar.cs プロジェクト: J3057/MobileApp
        void InternalReveal(bool revealed)
        {
            // make sure we're not doubly requesting the same thing. That would
            // cause a hitch in the animation.
            if (Revealed != revealed)
            {
                Revealed = revealed;

                // if we're currently animating, cancel the animation
                if (Animator != null)
                {
                    Animator.Cancel( );
                }

                int yOffset = revealed ? 0 : ButtonLayout.LayoutParameters.Height;

                // setup an animation from our current mask scale to the new one.
                Animator = ValueAnimator.OfInt((int)ButtonLayout.GetY( ), yOffset);

                Animator.AddUpdateListener(this);
                Animator.AddListener(new NavToolbarAnimationListener()
                {
                    NavbarToolbar = this
                });
                Animator.SetDuration((long)(PrivateSubNavToolbarConfig.SlideRate * 1000.0f));

                Animator.Start( );
            }
        }
コード例 #8
0
ファイル: ImageSlide.cs プロジェクト: ThinhVu/Mmosoft.Oops
        private void FlyOut()
        {
            // setup to reduce size of new image
            currentImgRect = ImageDisplayModeHelper.GetImageRect(
                this.ClientRectangle,
                new Rectangle(Point.Empty, imgs[currentIndex].Size),
                DisplayMode.ScaleLossLessCenter);
            int offsetSizeHor = 40;
            int offsetSizeVer = (int)(offsetSizeHor * 1f * currentImgRect.Height / currentImgRect.Width);

            vNewHor = -1f * offsetSizeHor / step;
            vNewVer = -1f * offsetSizeVer / step;

            //
            newImgRect = ImageDisplayModeHelper.GetImageRect(
                this.ClientRectangle,
                new Rectangle(Point.Empty, imgs[newIndex].Size),
                DisplayMode.ScaleLossLessCenter);
            // setup prev image on the left
            newImgRect = newImgRect.AdjustXF(-newImgRect.Right);
            // and move direction is to the right
            direction   = 1;
            s           = (int)(0.5 * (this.Width + newImgRect.Width));
            vCurrentHor = s / step;

            flyoutAnim.Start();
        }
コード例 #9
0
ファイル: ImageSlide.cs プロジェクト: ThinhVu/Mmosoft.Oops
        private void FlyIn()
        {
            if (currentIndex > -1)
            {
                currentImgRect = ImageDisplayModeHelper.GetImageRect(
                    this.ClientRectangle,
                    new Rectangle(Point.Empty, imgs[currentIndex].Size),
                    DisplayMode.ScaleLossLessCenter);
                direction   = -1;
                s           = (int)(0.5 * (this.Width + currentImgRect.Width));
                vCurrentHor = s / step + ((s % step == 0) ? 0 : 1);
            }

            //
            newImgRect = ImageDisplayModeHelper.GetImageRect(
                this.ClientRectangle,
                new Rectangle(Point.Empty, imgs[newIndex].Size),
                DisplayMode.ScaleLossLessCenter);

            int offsetSizeHor = 40;
            int offsetSizeVer = (int)(offsetSizeHor * 1f * newImgRect.Height / newImgRect.Width);

            vNewHor    = 1f * offsetSizeHor / step;
            vNewVer    = 1f * offsetSizeVer / step;
            newImgRect = newImgRect.AdjustSizeFromCenter(-offsetSizeHor, -offsetSizeVer);
            flyinAnim.Start();
        }
コード例 #10
0
        // Sets the checked/unchecked state of the FAB.
        /// <summary>
        /// Sets the checked.
        /// </summary>
        public void SetChecked()
        {
            // If trying to change to the current state, ignore
            if (this.check == true)
            {
                return;
            }
            this.check = true;

            if (currentapiVersion >= BuildVersionCodes.Lollipop)
            {
                Animator anim = CreateAnimator();
                anim.SetDuration(Resources.GetInteger(Android.Resource.Integer.ConfigShortAnimTime));
                anim.Start();
                //				revealView.SetBackgroundColor (check ? new Color(Resource.Color.fab_color_2 )
                //					: new Color(Resource.Color.fab_color_1));
                revealView.Visibility = ViewStates.Visible;
            }
            else
            {
                Animation anim = AnimationUtils.LoadAnimation(Context,
                                                              Resource.Animation.fab_anim2);
                anim.AnimationEnd += (object sender, Animation.AnimationEndEventArgs e) =>
                {
                    this.check = false;
                    DoOnCheckChanged();
                };
                StartAnimation(anim);
            }
        }
コード例 #11
0
        // Sets the checked/unchecked state of the FAB.
        public void SetChecked(bool check)
        {
            // If trying to change to the current state, ignore
            if (check == this.check)
            {
                return;
            }
            this.check = check;

            // Create and start the ValueAnimator that shows the new state
            Animator anim = CreateAnimator();

            anim.SetDuration(Resources.GetInteger(Android.Resource.Integer.ConfigShortAnimTime));
            anim.Start();

            // Set the new background color of the View to be revealed
            revealView.SetBackgroundColor(check ? Resources.GetColor(Resource.Color.fab_color_2)
                : Resources.GetColor(Resource.Color.fab_color_1));

            //Show the View to be revealed. Note that the animation has started already.
            revealView.Visibility = ViewStates.Visible;

            if (onCheckedChangeListener != null)
            {
                onCheckedChangeListener.OnCheckedChanged(this, check);
            }
        }
コード例 #12
0
        private void Btnattach_Click(object sender, EventArgs e)
        {
            int cx          = (lrevel.Left + lrevel.Right);
            int cy          = (lrevel.Top);
            int startradius = 0;
            int endradius   = Math.Max(lrevel.Width, lrevel.Height);

            animator = ViewAnimationUtils.CreateCircularReveal(lrevel, cx, cy, startradius, endradius);
            animator.SetDuration(400);

            int reverse_startradius = Math.Max(lrevel.Width, lrevel.Height);
            int reverse_endradius   = 0;

            animate = ViewAnimationUtils.CreateCircularReveal(lrevel, cx, cy, reverse_startradius, reverse_endradius);

            if (hidden)
            {
                lrevel.Visibility = ViewStates.Visible;
                hidden            = false;
                animator.Start();
            }
            else
            {
                animate.AddListener(this);
                animate.Start();
                hidden = true;
            }
        }
コード例 #13
0
        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();
            }
        }
コード例 #14
0
        private void showWinnerAnimation(string winnerImageUrl)
        {
            if (_cxPosition == 0)
            {
                _cxPosition  = _ivWinner.MeasuredWidth / 2;
                _cyPosition  = _ivWinner.MeasuredHeight / 2;
                _finalRadius = Math.Max(_ivWinner.Width, val2: _ivWinner.Height);
            }

            Glide
            .With(_activity)
            .Load(winnerImageUrl)
            .Apply(RequestOptions.CenterCropTransform()).Into(_ivWinner);

            _isWinnerRevealing = true;


            Animator anim =
                ViewAnimationUtils.CreateCircularReveal(_groupWinner, _cxPosition, _cyPosition, 0, _finalRadius);

            _groupWinner.Visibility = ViewStates.Visible;
            _winnerView.PlayAnimation();
            anim.SetDuration(2000);
            anim.AddListener(this);
            anim.Start();
        }
コード例 #15
0
        //http://pulse7.net/android/android-create-circular-reveal-animation-and-ripple-effect-like-whatsapp/
        async void HideAnim()
        {
            await Task.Delay(2000);

            // previously invisible view
            View myView = _view.FindViewById(Resource.Id.test);

            // get the center for the clipping circle
            int cx = myView.Width / 2;
            int cy = myView.Height / 2;

            // get the final radius for the clipping circle
            float finalRadius = (float)Math.Sqrt(cx * cx + cy * cy);

            // create the animator for this view (the start radius is zero)
            Animator anim =
                ViewAnimationUtils.CreateCircularReveal(myView, cx, cy, finalRadius, 0);

            // make the view visible and start the animation
            myView.Visibility = ViewStates.Visible;
            anim.Start();

            anim.AnimationEnd += (object sender, EventArgs e) => {
                myView.Visibility = ViewStates.Invisible;
            };
        }
コード例 #16
0
        public async void Initialize()
        {
            this.machine.Frame = 0;

            this.homeState = HomeStates.Home;

            this.title = AssetStore.Title;
            this.maps  = AssetStore.ParallaxMaps;
            this.tiles = AssetStore.Tiles;

            cursor = AssetStore.OpaCursorAnimator;

            this.menuStart.Initialize(machine, cursor, menuEntries);
            this.menu1Por2P.Initialize(machine, cursor, menu1Por2Pentries);

            frameScroll = 0;

            hiScore       = this.machine.BatteryRam.ReadInt((int)BatteryRamAddress.HiScore);
            hiScoreString = "hiscore: " + hiScore;

            this.fontWidth = this.machine.Screen.Font.FontSheet.TileWidth;

            this.machine.Audio.PlayLoop("homeSound");

            await this.machine.ExecuteAsync(() => this.game.SaveNameAndScoreIfNeededAsync());

            cursor.Start();
        }
コード例 #17
0
        protected void ToggleContent(bool prev)
        {
            int oldElementIndex            = mActiveElementIndex;
            PaperOnboardingPage newElement = prev ? toggleToPreviousElement() : toggleToNextElement();

            if (newElement == null)
            {
                if (prev && mOnLeftOutListener != null)
                {
                    mOnLeftOutListener.OnLeftOut();
                }
                if (!prev && mOnRightOutListener != null)
                {
                    mOnRightOutListener.OnRightOut();
                }
                return;
            }

            int newPagerPosX = calculateNewPagerPosition(mActiveElementIndex);

            // 1 - animate BG
            AnimatorSet bgAnimation = createBGAnimatorSet(newElement.BackgroundColor);

            // 2 - animate pager position
            Animator pagerMoveAnimation = ObjectAnimator.OfFloat(mPagerIconsContainer, "x", mPagerIconsContainer.GetX(), newPagerPosX);

            pagerMoveAnimation.SetDuration(ANIM_PAGER_BAR_MOVE_TIME);

            // 3 - animate pager icons
            AnimatorSet pagerIconAnimation = createPagerIconAnimation(oldElementIndex, mActiveElementIndex);

            // 4 animate content text
            ViewGroup newContentText = createContentTextView(newElement);

            mContentTextContainer.AddView(newContentText);
            AnimatorSet contentTextShowAnimation = createContentTextShowAnimation(
                mContentTextContainer.GetChildAt(mContentTextContainer.ChildCount - 2), newContentText);

            // 5 animate content icon
            ImageView newContentIcon = createContentIconView(newElement);

            mContentIconContainer.AddView(newContentIcon);
            AnimatorSet contentIconShowAnimation = createContentIconShowAnimation(
                mContentIconContainer.GetChildAt(mContentIconContainer.ChildCount - 2), newContentIcon);

            // 6 animate centering of all content
            Animator centerContentAnimation = createContentCenteringVerticalAnimation(newContentText, newContentIcon);

            centerContentAnimation.Start();
            bgAnimation.Start();
            pagerMoveAnimation.Start();
            pagerIconAnimation.Start();
            contentIconShowAnimation.Start();
            contentTextShowAnimation.Start();

            if (mOnChangeListener != null)
            {
                mOnChangeListener.OnPageChanged(oldElementIndex, mActiveElementIndex);
            }
        }
コード例 #18
0
        private void addIndicator(Android.Widget.Orientation orientation, int backgroundDrawableId, Animator animator)
        {
            if (animator.IsRunning)
            {
                animator.End();
                animator.Cancel();
            }

            var indicator = new View(Context);

            indicator.SetBackgroundResource(backgroundDrawableId);
            AddView(indicator, mIndicatorWidth, mIndicatorHeight);
            LayoutParams lp = (LayoutParams)indicator.LayoutParameters;

            if (orientation == Android.Widget.Orientation.Horizontal)
            {
                lp.LeftMargin  = mIndicatorMargin;
                lp.RightMargin = mIndicatorMargin;
            }
            else
            {
                lp.TopMargin    = mIndicatorMargin;
                lp.BottomMargin = mIndicatorMargin;
            }

            indicator.LayoutParameters = lp;

            animator.SetTarget(indicator);
            animator.Start();
        }
コード例 #19
0
        /// <summary>
        /// Naissance du bébé
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>

        public void Born(int x, int y, CoinTypes coinType)
        {
            this.IsAlive = true;

            this.coinType = coinType;

            if (coinType == CoinTypes.Coin1)
            {
                coinAnimator = coin1Animator;
            }
            else
            {
                coinAnimator = coin5Animator;
            }

            coinAnimator.AnimationType = AnimationTypes.Manual;
            coinAnimator.Start();

            int yPath = machine.Screen.BoundsClipped.Bottom - y - this.Height - 4;

            var width     = this.machine.GetRandomInteger(10, 70);
            var direction = this.machine.GetRandomInteger(2) == 0 ? -1 : 1;

            // deplacement
            this.pathMove.Initialize(EasingFunctions.QuinticEaseOut, EasingFunctions.BounceEaseOut, width, yPath, direction, 1, 100);
            // temps d'animation : plus c'est le debut plus c'est rapide
            this.pathAnimation.Initialize(EasingFunctions.QuinticEaseOut, EasingFunctions.Linear, 5, 0, 1, 1, 100);

            this.X = x;
            this.Y = y;

            this.originalY = y;
            this.originalX = X;
        }
コード例 #20
0
        /// <summary>
        /// Changed interface pattern to event, so that we can unsubscribe on first call
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CircularGlobalLayout(object sender, EventArgs e)
        {
            ViewTreeObserver.GlobalLayout -= CircularGlobalLayout;

            int revealRadius = (int)Java.Lang.Math.Hypot(Width, Height);
            int startRadius  = 0;

            if (mView != null)
            {
                startRadius = mView.Width / 2;
            }
            else if (mFocusCircleRadius > 0 || mFocusRectangleWidth > 0 || mFocusRectangleHeight > 0)
            {
                mCenterX = mFocusPositionX;
                mCenterY = mFocusPositionY;
            }
            Animator enterAnimator = ViewAnimationUtils.CreateCircularReveal(this, mCenterX, mCenterY, startRadius, revealRadius);

            enterAnimator.SetDuration(mAnimationDuration);

            if (mAnimationListener != null)
            {
                enterAnimator.AnimationEnd += (r, t) =>
                {
                    mAnimationListener.OnEnterAnimationEnd();
                };
            }

            enterAnimator.SetInterpolator(AnimationUtils.LoadInterpolator(mActivity, Android.Resource.Interpolator.AccelerateCubic));
            enterAnimator.Start();
        }
コード例 #21
0
ファイル: CubeModel.cs プロジェクト: ARLM-Attic/rubiks-cube
        public void Rotate(string action, float duration, bool silent)
        {
            if (string.IsNullOrEmpty(action))
            {
                return;
            }
            action = action.ToUpper();
            if (!CubeOperations.IsValidOp(action))
            {
                return;
            }

            AnimContext animContext = new AnimContext()
            {
                Op       = action,
                Duration = duration,
                Silent   = silent
                           //Change  = rotation
                           //Transform = transform
            };

            //run once

            /*
             * Transform transform = BeforeTransform(animContext);
             * DoTransform(transform, rotation);
             * UpdateCubiePosition(transform);
             */
            //Animation
            _animator.Start(animContext);
        }
コード例 #22
0
ファイル: CubeController.cs プロジェクト: alinen/cube
    public void QueueCommand(string word, float turnRate = 30.0f)
    {
        if (word == "")
        {
            return;
        }

        //Debug.Log(word);

        List <Transform> list;
        Vector3          center;
        Vector3          axis;
        float            amount = 0.0f;

        _cube.SortCubeGroups();
        _cube.CmdToTurn(word, out list, out center, out axis, out amount);
        rotations.Add(new Rotator(list, center, axis, amount, turnRate, word));

        if (rotations.Count == 1) // was previously empty, initialize rotations
        {
            Animator rotator = rotations[0] as Animator;
            rotator.Start();
            current = 0;
        }
    }
コード例 #23
0
        async void showAnim()
        {
            await Task.Delay(1000);

            // previously invisible view
            View myView = _view.FindViewById(Resource.Id.test);

            var prms = myView.LayoutParameters;

            prms.Height             = 300;
            myView.LayoutParameters = prms;

            await Task.Delay(1000);

            prms                    = myView.LayoutParameters;
            prms.Height             = 100;
            myView.LayoutParameters = prms;

            // get the center for the clipping circle
            int cx = myView.Width / 2;
            int cy = myView.Height / 2;

            // get the final radius for the clipping circle
            float finalRadius = (float)Math.Sqrt(cx * cx + cy * cy);

            // create the animator for this view (the start radius is zero)
            Animator anim =
                ViewAnimationUtils.CreateCircularReveal(myView, cx, cy, 0, finalRadius);

            // make the view visible and start the animation
            myView.Visibility = ViewStates.Visible;
            anim.Start();
        }
コード例 #24
0
        public static Task StartAsync(this Animator animator)
        {
            var listener = new TaskAnimationListener();

            animator.AddListener(listener);
            animator.Start();
            return(listener.Task);
        }
コード例 #25
0
ファイル: LoginForm.cs プロジェクト: soundempire/GMR
        public LoginForm(IAuthorizationService authorizationService)
        {
            InitializeComponent();

            Animator.Start();

            _authorizationService = authorizationService;
        }
コード例 #26
0
 private void frmSpectrum_Shown(object sender, EventArgs e)
 {
     // avatar image for spectrum
     circleSpectrumVisualizer1.Img = new Bitmap(System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream("AudioSpectrumAdvance.Assests.avatar.jpg"));
     // background image
     _backgroundImg = new Bitmap(System.Reflection.Assembly.GetEntryAssembly().GetManifestResourceStream("AudioSpectrumAdvance.Assests.bg.jpg"));
     //
     _animator.Start();
 }
コード例 #27
0
        public void Start(Style animStyle = Style.Linear)
        {
            if (Animator != null)
            {
                AnimStyle = animStyle;

                Animator.Start( );
            }
        }
コード例 #28
0
        public void Go(string word, Point from, Point to)
        {
            _from = from;
            _to   = to;

            Text     = word;
            Location = from;
            Visible  = true;
            BringToFront();
            _animator.Start();
        }
コード例 #29
0
ファイル: DuckSprite.cs プロジェクト: samoteph/Sugoi
        /// <summary>
        /// Naissance du bébé
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>

        public void Born(int y)
        {
            this.IsAlive = true;

            this.X = (int)page.ScrollX + this.machine.Screen.BoundsClipped.Right;
            this.Y = y;

            this.originalY = y;
            this.originalX = X;

            walkAnimator.Start();
        }
コード例 #30
0
        private void ShowBubble()
        {
            AnimatorSet animatorSet = new AnimatorSet();

            _bubble.Visibility = ViewStates.Visible;
            if (_animator != null)
            {
                _animator.Cancel();
            }
            _animator = ObjectAnimator.OfFloat(_bubble, "alpha", 0f, 1f).SetDuration(100);
            _animator.Start();
        }