forked from dotnet/android-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewAnimationActivity.cs
25 lines (23 loc) · 1.02 KB
/
ViewAnimationActivity.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
namespace com.xamarin.evolve2013.animationsdemo
{
using Android.App;
using Android.OS;
using Android.Views.Animations;
using Android.Widget;
[Activity(Theme = "@android:style/Theme.Holo.Light.DarkActionBar", Label = "@string/title_viewanimation")]
public class ViewAnimationActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.activity_imageandbutton);
FindViewById<ImageView>(Resource.Id.imageView1).SetImageResource(Resource.Drawable.ship2_2);
Button button = FindViewById<Button>(Resource.Id.button1);
button.Text = Resources.GetString(Resource.String.title_hyperspace);
button.Click += (sender, args) =>{
Animation hyperspaceAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.hyperspace);
FindViewById<ImageView>(Resource.Id.imageView1).StartAnimation(hyperspaceAnimation);
};
}
}
}