本文整理汇总了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;
}
示例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");
}
}
}
示例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);
}
});
}
示例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();
}
}
示例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);
}
示例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);
});
}
示例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));
}
示例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);
}
}