当前位置: 首页>>代码示例>>C#>>正文


C# View.StartAnimation方法代码示例

本文整理汇总了C#中Android.Views.View.StartAnimation方法的典型用法代码示例。如果您正苦于以下问题:C# View.StartAnimation方法的具体用法?C# View.StartAnimation怎么用?C# View.StartAnimation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android.Views.View的用法示例。


在下文中一共展示了View.StartAnimation方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnFling

 public override bool OnFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)
 {
     if (Math.Abs(velocityX) < 500) return false;
     _lastView = _parentActivity.LastView;
     var animationSet = new AnimationSet(true)
     {
         Interpolator = new AccelerateDecelerateInterpolator(),
         Duration = 300,
         FillAfter = true
     };
     var animationRotate = new RotateAnimation(0, Math.Sign(velocityX)*15);
     var animationTranslate = new TranslateAnimation(0, Math.Sign(velocityX)*400,
         0, 10);
     var animationAlpha = new AlphaAnimation(1, 0);
     animationSet.AddAnimation(animationRotate);
     animationSet.AddAnimation(animationTranslate);
     animationSet.AddAnimation(animationAlpha);
     animationSet.AnimationEnd += AnimationSet_AnimationEnd;
     _lastView.StartAnimation(animationSet);
     return true;
 }
开发者ID:RealAikido,项目名称:MobileSamples,代码行数:21,代码来源:GestureListener.cs

示例2: StartAnimation

 public void StartAnimation(View v)
 {
     if (anim is Animation)
     {
         v.StartAnimation((Animation)anim);
     }
     else
     {
         if (anim is Animator)
         {
             var animator = (Animator)anim;
             animator.SetTarget(v);
             animator.Start();
         }
         else
         {
             Log.Error("CompatibilityAnimation", "Animation is neither of type Animator nor Animation");
         }
     }
 }
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:20,代码来源:CompatibilityAnimation.cs

示例3: CallOnGlobalLayout

        private void CallOnGlobalLayout(Crouton crouton, View croutonView)
        {
            var layoutListener = new GlobalLayoutListener();
            layoutListener.OnGlobalLayout(delegate
            {
                if (Build.VERSION.SdkInt < Build.VERSION_CODES.JellyBean)
                {
                    croutonView.ViewTreeObserver.RemoveGlobalOnLayoutListener(layoutListener);
                }
                else
                {
                    croutonView.ViewTreeObserver.RemoveOnGlobalLayoutListener(layoutListener);
                }

                if (crouton.GetInAnimation() != null)
                {
                    croutonView.StartAnimation(crouton.GetInAnimation());
                    AnnounceForAccessibilityCompat(crouton.GetActivity(), crouton.DataContext == null ? "NULL" : crouton.DataContext.ToString());
                    SendMessageDelayed(crouton, REMOVE_CROUTON,
                    crouton.DurationInMilliseconds + crouton.GetInAnimation().Duration);
                }
            });
        }
开发者ID:NimaGhaedsharafi,项目名称:ToastsRTL.Forms.Plugin,代码行数:23,代码来源:Manager.cs

示例4: animateAlphaTranslate

        private void animateAlphaTranslate(View view, float alphaFrom, float alphaTo, float xFrom, float xTo,
            bool requestFocus)
        {
            AnimationSet animationSet = new AnimationSet(true);

            AlphaAnimation fade = new AlphaAnimation(alphaFrom, alphaTo);
            fade.Duration = 350;

            TranslateAnimation slide = new TranslateAnimation(Dimension.RelativeToSelf, xFrom,
                                                              Dimension.RelativeToSelf, xTo,
                                                              Dimension.RelativeToSelf, 0,
                                                              Dimension.RelativeToSelf, 0);

            slide.Duration = 350;

            animationSet.AddAnimation(fade);
            animationSet.AddAnimation(slide);
            view.StartAnimation(animationSet);

            if (requestFocus)
            {
                animationSet.AnimationEnd += (obj, args) => view.RequestFocus();
            }
        }
开发者ID:TheJaniceTong,项目名称:Judo-Xamarin,代码行数:24,代码来源:CardEntryView.cs

示例5: MaximizeView

        private void MaximizeView(View view)
        {
            var animationSet = new AnimationSet(true)
            {
                Interpolator = new AccelerateDecelerateInterpolator(),
                Duration = 500,
                FillAfter = true
            };
            var scaleAnimation = new ScaleAnimation(1f, 1.25f, 1f, 1.25f, Dimension.RelativeToSelf, 0f,
                Dimension.RelativeToSelf, 0f);
            _selectedViewTop = view.Top;
            _selectedViewLeft = view.Left;
            var translateAnimation = new TranslateAnimation(Dimension.RelativeToSelf, 0, Dimension.Absolute, -view.Left,
                Dimension.RelativeToSelf, 0, Dimension.Absolute, -view.Top + _addButton.Height);
            animationSet.AddAnimation(scaleAnimation);
            animationSet.AddAnimation(translateAnimation);

            view.StartAnimation(animationSet);
        }
开发者ID:RealAikido,项目名称:MobileSamples,代码行数:19,代码来源:CustomAnimationActivity.cs

示例6: Fade_In_Txt

 void Fade_In_Txt(View view)
 {
     var fadeIn = AnimationUtils.LoadAnimation (this, Resource.Animation.fade_in_text);
     view.Visibility = ViewStates.Visible ;
     RunOnUiThread (() => {
         view.StartAnimation (fadeIn);
     });
 }
开发者ID:bny-mobile,项目名称:COPILOT,代码行数:8,代码来源:Activity1.cs

示例7: FadeIn

/**
 * Fades the view out. Animation starts right away.
 * @param v the view to be faded out
 */

        public static void FadeIn(View v)
        {
            if (v == null) return;

            v.StartAnimation(FadeInAnimation(500, v));
        }
开发者ID:tomgilder,项目名称:ReactiveTrader,代码行数:11,代码来源:AnimationFactory.cs

示例8: OnTouchUp

        public void OnTouchUp(View view, MotionEvent evt, int position)
        {
            if (ExpandCollapseEnabled && _swipeView == null)
            {
                PerformClick (view, position);
            }
            else if (SwipeToDeleteEnabled)
            {
                Animation swipeEnd = SwipeEndAnimation ();
                if (ShouldDeleteSwipeView ())
                {
                    swipeEnd.AnimationEnd += delegate(object sender, Animation.AnimationEndEventArgs e)
                    {
                        PerformDelete (_swipeView, position);
                    };
                }
                else
                {
                    _swipeView = null;
                }

                view.StartAnimation (swipeEnd);
            }
        }
开发者ID:GrimmRanger,项目名称:FGUtils,代码行数:24,代码来源:SwissListAdapter.cs


注:本文中的Android.Views.View.StartAnimation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。