本文整理汇总了C#中ImageView.Animate方法的典型用法代码示例。如果您正苦于以下问题:C# ImageView.Animate方法的具体用法?C# ImageView.Animate怎么用?C# ImageView.Animate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView.Animate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AnimateGuitarIntro
/// <summary>
/// Animates the guitar intro which should last 10 seconds.
/// </summary>
/// <param name="guitarImage">The object which contains the image of the guitar.</param>
public void AnimateGuitarIntro(ImageView guitarImage)
{
int target_ScrollX = 230;
int target_ScrollY = -5;
float target_ScaleX = 4.5f; //5;
float target_ScaleY = 4.5f; //5;
int target_ScrollX_2nd = 150; //135;
int msDuration = 4000;
int msDelay = 1000;
guitarImage.Animate()
.SetDuration(msDuration)
.SetStartDelay(msDelay)
.ScrollX(guitarImage, target_ScrollX)
.ScrollY(guitarImage, target_ScrollY)
.ScaleX(target_ScaleX)
.ScaleY(target_ScaleY)
.WithEndAction(new Runnable(() =>
{
guitarImage.Animate()
.SetDuration(msDuration)
.SetStartDelay(msDelay)
.ScrollX(guitarImage, target_ScrollX_2nd)
.WithEndAction(new Runnable(() => {
OnIntroAnimationFinished(this, new EventArgs());
}))
.Start();
}))
.Start();
}
示例2: InitLayout
void InitLayout(string categoryId) {
SetContentView(Resource.Layout.activity_quiz);
icon = FindViewById<ImageView>(Resource.Id.icon);
int resId = Resources.GetIdentifier(ImageCategory + categoryId, CategoryAdapter.Drawable,
ApplicationContext.PackageName);
icon.SetImageResource(resId);
icon.SetImageResource(resId);
icon.Animate()
.ScaleX(1)
.ScaleY(1)
.Alpha(1)
.SetInterpolator(interpolator)
.SetStartDelay(300)
.Start();
quizFab = FindViewById<FloatingActionButton>(Resource.Id.fab_quiz);
quizFab.SetImageResource(Resource.Drawable.ic_play);
quizFab.Visibility = savedStateIsPlaying ? ViewStates.Gone : ViewStates.Visible;
quizFab.Click += (sender, e) => {
var view = (View)sender;
switch (view.Id) {
case Resource.Id.fab_quiz:
StartQuizFromClickOn(view);
break;
case Resource.Id.submitAnswer:
SubmitAnswer();
break;
case Resource.Id.quiz_done:
FinishAfterTransition();
break;
case Undefined:
var contentDescription = view.ContentDescription;
if (contentDescription != null && contentDescription == GetString(Resource.String.up)) {
OnBackPressed();
break;
}
break;
default:
throw new InvalidOperationException(
"OnClick has not been implemented for " + Resources.GetResourceName(view.Id));
}
};
quizFab.Animate()
.ScaleX(1)
.ScaleY(1)
.SetInterpolator(interpolator)
.SetStartDelay(400)
.Start();
}