Created
August 29, 2013 18:53
-
-
Save Redth/6381995 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Android.App; | |
| using Android.Content; | |
| using Android.Runtime; | |
| using Android.Views; | |
| using Android.Widget; | |
| using Android.OS; | |
| namespace EggsTest | |
| { | |
| [Activity (Label = "EggsTest", MainLauncher = true)] | |
| public class MainActivity : Activity | |
| { | |
| EggsToGo.Easter easter; | |
| protected override void OnCreate (Bundle bundle) | |
| { | |
| base.OnCreate (bundle); | |
| // Set our view from the "main" layout resource | |
| SetContentView (Resource.Layout.Main); | |
| var easyEgg = new EggsToGo.CustomEgg ("Easy").WatchForSequence(EggsToGo.Command.SwipeUp(), EggsToGo.Command.SwipeUp(), EggsToGo.Command.Tap(), EggsToGo.Command.Tap()); | |
| easter = new EggsToGo.Easter (new EggsToGo.KonamiCode(), easyEgg); | |
| easter.EggDetected += (command) => RunOnUiThread (() => AndroidHUD.AndHUD.Shared.ShowSuccess(this, "Detected Egg! " + command.Name, AndroidHUD.MaskType.Black, TimeSpan.FromSeconds(3))); | |
| easter.CommandDetected += cmd => AndroidHUD.AndHUD.Shared.ShowToast (this, cmd.Value, AndroidHUD.MaskType.Clear, TimeSpan.FromMilliseconds (300), false); | |
| } | |
| public override bool OnTouchEvent (MotionEvent e) | |
| { | |
| easter.OnTouchEvent (e); | |
| return base.OnTouchEvent (e); | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment