Ejemplo n.º 1
0
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            if (evt.Type == UIEventType.Motion)
            {
                UIAlertController helpControl = UIAlertController.Create("Need Help?", "On this page you will learn over 500 French phrases. Simply choose a category and have fun", UIAlertControllerStyle.Alert);

                UIAlertAction confirmed = UIAlertAction.Create("Cool", UIAlertActionStyle.Default, (Action) =>
                {
                    helpControl.Dispose();
                });

                helpControl.AddAction(confirmed);

                if (this.PresentedViewController == null)
                {
                    SystemSound sound = new SystemSound(4095);
                    sound.PlaySystemSound();
                    this.PresentViewController(helpControl, true, null);
                }
                else if (this.PresentedViewController != null)
                {
                    this.PresentedViewController.DismissViewController(true, () =>
                    {
                        this.PresentedViewController.Dispose();
                        SystemSound sound = new SystemSound(4095);
                        sound.PlaySystemSound();
                        this.PresentViewController(helpControl, true, null);
                    });
                }
            }
        }
Ejemplo n.º 2
0
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            base.MotionEnded(motion, evt);

            var store = AppStore.Instance;
            var cnt   = store.Locations.Count;

            Vibration.Vibrate();
            // Or use specified time
            var duration = TimeSpan.FromSeconds(1);

            Vibration.Vibrate(duration);
            if (cnt == 0)
            {
                LabelLunch.Text = "First enter some Locations, dude!";
                return;
            }
            LabelLunch.Hidden   = true;
            ButtonAccept.Hidden = false;
            var idx = store.Rnd.Next(cnt);

            ButtonAccept.SetTitle(store.Locations[idx].Name, UIControlState.Normal);
            ButtonAccept.Tag = idx;
            store.Locations[idx].Count++;
        }
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         BITHockeyManager.SharedHockeyManager.FeedbackManager.ShowFeedbackComposeView();
     }
 }
Ejemplo n.º 4
0
 public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         BITHockeyManager.SharedHockeyManager.FeedbackManager.ShowFeedbackComposeViewWithGeneratedScreenshot();
     }
 }
Ejemplo n.º 5
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         Debugging.Profiler.Default.Show();
     }
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Method invoked when a motion (a shake) has started.
 /// </summary>
 /// <param name="motion">The motion subtype.</param>
 /// <param name="evt">The event arguments.</param>
 public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
 {
     base.MotionBegan(motion, evt);
     if (motion == UIEventSubtype.MotionShake)
     {
         this.ActualController.HandleGesture(this, new OxyShakeGesture(), new OxyKeyEventArgs());
     }
 }
Ejemplo n.º 7
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         ((ShakablePage)Element).OnShake();
     }
     base.MotionEnded(motion, evt);
 }
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if(motion == UIEventSubtype.MotionShake)
     {
         interactionLabel.Text=  "iPhone was shaken";
         SetTimerToClearMotionLabel();
     }
 }
Ejemplo n.º 9
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         (Delegate as AppDelegate)?.Reset(string.Empty);
     }
     base.MotionEnded(motion, evt);
 }
Ejemplo n.º 10
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     base.MotionEnded(motion, evt);
     if (motion == UIEventSubtype.MotionShake)
     {
         Console.WriteLine($"{this.GetType().Name}.{nameof(MotionEnded)}:  You shook me!");
     }
 }
Ejemplo n.º 11
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         Accelerometer.HandleShake();
     }
     base.MotionEnded(motion, evt);
 }
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            base.MotionEnded(motion, evt);

            if (motion == UIEventSubtype.MotionShake)
            {
                _page.OnShaken(this.Element, EventArgs.Empty);
            }
        }
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         var page = this.Element as TasksPage;
         var vm   = page?.BindingContext as TasksViewModel;
         vm?.TestConflict();
     }
 }
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         if (mainView != null) {
             mainView.ShakeReceived ();
         }
     }
     base.MotionEnded (motion, evt);
 }
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         // TRAINING: Create task list conflict (for development only)
         var page = this.Element as TaskListsPage;
         var vm   = page?.BindingContext as TaskListsViewModel;
         vm?.TestConflict();
     }
 }
Ejemplo n.º 16
0
		public override void MotionEnded (UIEventSubtype motion, UIEvent evt)
		{
			if (motion == UIEventSubtype.MotionShake) {
				// Do your application-specific shake response here...
				if (BitMobile.Application.ApplicationContext.Context != null && BitMobile.Application.ApplicationContext.Context.ValueStack != null) {
					string workflow = BitMobile.Application.ApplicationContext.Context.Workflow.Name;
					BitMobile.Application.ApplicationContext.Context.ValueStack.TryCallScript ("Events", "OnApplicationShake", workflow);
				}
			}
		}
        public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
        {
            base.MotionBegan (motion, evt);
            if (motion != UIEventSubtype.MotionShake) {
                return;
            }

            Console.WriteLine("Device started shaking!");
            CircleColor = UIColor.Red;
        }
Ejemplo n.º 18
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         if (mainView != null)
         {
             mainView.ShakeReceived();
         }
     }
     base.MotionEnded(motion, evt);
 }
Ejemplo n.º 19
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         // Do your application-specific shake response here...
         if (ApplicationContext.Current != null && ApplicationContext.Current.ValueStack != null)
         {
             string workflow = ApplicationContext.Current.Workflow.Name;
             BusinessProcessContext.Current.GlobalEventsController.OnApplicationShake(workflow);
         }
     }
 }
Ejemplo n.º 20
0
		// Called after the iOS determines the motion wasn't noise (such as walking up stairs).
		public override void MotionEnded (UIEventSubtype motion, UIEvent evt)
		{
			Console.WriteLine("Motion Ended");
			base.MotionEnded(motion, evt);

			// if the motion was a shake
			if(motion == UIEventSubtype.MotionShake) {
				Console.Write("Shake Detected");

				lblShakeStatus.Text = "Shook!";
			}
		}
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     Console.WriteLine("Motion detected");
     if (motion == UIEventSubtype.MotionShake)
     {
         Console.WriteLine("and was a shake");
         labelLastUpdated.Text = "All shook up! Updating...";
         // never appears
         // Do your application-specific shake response here...
         Update();
     }
 }
Ejemplo n.º 22
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     Console.WriteLine("Motion detected");
     if (motion == UIEventSubtype.MotionShake)
     {
         Console.WriteLine("and was a shake");
         //labelLastUpdated.Text = "All shook up! Updating..."; // never appears
         // Do your application-specific shake response here...
         var ice = new ICEViewController();
         this.PresentModalViewController(ice, true);
     }
 }
Ejemplo n.º 23
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         // Do your application-specific shake response here...
         if (BitMobile.Application.ApplicationContext.Context != null && BitMobile.Application.ApplicationContext.Context.ValueStack != null)
         {
             string workflow = BitMobile.Application.ApplicationContext.Context.Workflow.Name;
             BitMobile.Application.ApplicationContext.Context.ValueStack.TryCallScript("Events", "OnApplicationShake", workflow);
         }
     }
 }
Ejemplo n.º 24
0
        // Called after the iOS determines the motion wasn't noise (such as walking up stairs).
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            Console.WriteLine("Motion Ended");
            base.MotionEnded(motion, evt);

            // if the motion was a shake
            if (motion == UIEventSubtype.MotionShake)
            {
                Console.Write("Shake Detected");

                lblShakeStatus.Text = "Shook!";
            }
        }
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            base.MotionEnded(motion, evt);

            if (evt.Subtype == UIEventSubtype.MotionShake)
            {
#if DEBUG
                Debug.WriteLine("**shake**");
#endif

                mImageScrollView.ClearSegments();
            }
        }
Ejemplo n.º 26
0
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            Console.WriteLine("Motion detected");
            if (motion ==  UIEventSubtype.MotionShake)
            {
                Console.WriteLine("and was a shake");
                //labelLastUpdated.Text = "All shook up! Updating..."; // never appears
                // Do your application-specific shake response here...
                var ice = new ICEViewController();
                this.PresentModalViewController (ice, true);

            }
        }
Ejemplo n.º 27
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         if (sharedManager.IsHidden)
         {
             sharedManager.ShowExplorer();
         }
         else
         {
             sharedManager.HideExplorer();
         }
     }
 }
Ejemplo n.º 28
0
 public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         Console.WriteLine("Device started shaking");
         if (CircleColor != UIColor.Red)
         {
             CircleColor = UIColor.Red;
         }
         else
         {
             CircleColor = UIColor.LightGray;
         }
     }
 }
        // Called after the iOS determines the motion wasn't noise (such as walking up stairs).
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            base.MotionEnded(motion, evt);
            if (!ButtonKitty.Enabled)
            {
                return;
            }

            // if the motion was a shake
            if (motion == UIEventSubtype.MotionShake)
            {
                                #if !STARTER
                FlurryAnalytics.Flurry.LogEvent("Otter");
                                #endif
                SetImage(OverflowHelper.Animal.Otter);
            }
        }
Ejemplo n.º 30
0
 // Erase on Shake
 public override void MotionBegan(UIEventSubtype eType, UIEvent evt)
 {
     if (eType == UIEventSubtype.MotionShake)
     {
         var alert = UIAlertController.Create(
             "Erase Canvas?",
             "This will clear the shared Realm database and erase the canvas. Are you sure you wish to proceed?",
             UIAlertControllerStyle.Alert);
         alert.AddAction(UIAlertAction.Create("Erase", UIAlertActionStyle.Destructive, action => _drawer?.ErasePaths()));
         alert.AddAction(UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, null));
         if (alert.PopoverPresentationController != null)
         {
             alert.PopoverPresentationController.SourceView = View;
         }
         PresentViewController(alert, animated: true, completionHandler: null);
         //// unlike other gesture actions, don't call View.SetNeedsDisplay but let major Realm change prompt redisplay
     }
 }
        private void HandleRemoteControlEvent(UIEventSubtype eventType)
        {
            switch (eventType)
            {
            case UIEventSubtype.RemoteControlPlay:
                _playbackController.Play();
                break;

            case UIEventSubtype.RemoteControlPause:
                _playbackController.Pause();
                break;

            case UIEventSubtype.RemoteControlTogglePlayPause:
                _playbackController.PlayPause();
                break;

            case UIEventSubtype.RemoteControlStop:
                _playbackController.Stop();
                break;

            case UIEventSubtype.RemoteControlNextTrack:
                _playbackController.PlayNext();
                break;

            case UIEventSubtype.RemoteControlPreviousTrack:
                _playbackController.PlayPreviousOrSeekToStart();
                break;

            case UIEventSubtype.RemoteControlBeginSeekingForward:
                StartSeekingForward();
                break;

            case UIEventSubtype.RemoteControlBeginSeekingBackward:
                StartSeekingBackward();
                break;

            case UIEventSubtype.RemoteControlEndSeekingForward:
            case UIEventSubtype.RemoteControlEndSeekingBackward:
                EndSeeking();
                break;
            }
        }
Ejemplo n.º 32
0
        public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
        {
            HypnosisView view = this.View as HypnosisView;

            if (motion == UIEventSubtype.MotionShake)
            {
                Console.WriteLine("Device started shaking");
                if (view.CircleColor != UIColor.Orange)
                {
                    lastSelectedColor          = view.CircleColor;
                    lastSelectedSegmentIndex   = segControl.SelectedSegment;
                    view.CircleColor           = UIColor.Orange;
                    segControl.SelectedSegment = -1;
                }
                else
                {
                    view.CircleColor           = lastSelectedColor;
                    segControl.SelectedSegment = lastSelectedSegmentIndex;
                }
            }
        }
Ejemplo n.º 33
0
 public static Offset <UIEvent> CreateUIEvent(FlatBufferBuilder builder,
                                              UIEventType eventType       = UIEventType.ADD_NAME,
                                              UIEventSubtype eventSubType = UIEventSubtype.NONE,
                                              int nameIdx      = 0,
                                              long timestamp   = 0,
                                              int iteration    = 0,
                                              int epoch        = 0,
                                              short variableId = 0,
                                              Offset <FrameIteration> frameIterOffset = default(Offset <FrameIteration>),
                                              ushort plugin = 0)
 {
     builder.StartObject(9);
     UIEvent.AddTimestamp(builder, timestamp);
     UIEvent.AddFrameIter(builder, frameIterOffset);
     UIEvent.AddEpoch(builder, epoch);
     UIEvent.AddIteration(builder, iteration);
     UIEvent.AddNameIdx(builder, nameIdx);
     UIEvent.AddPlugin(builder, plugin);
     UIEvent.AddVariableId(builder, variableId);
     UIEvent.AddEventSubType(builder, eventSubType);
     UIEvent.AddEventType(builder, eventType);
     return(UIEvent.EndUIEvent(builder));
 }
		public override void MotionEnded (UIEventSubtype motion, UIEvent evt)
		{
			base.MotionEnded (motion, evt);
			DropboxDatabase.Shared.Reset ();
		}
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     base.MotionEnded(motion, evt);
     DropboxDatabase.Shared.Reset();
 }
		// Called after the iOS determines the motion wasn't noise (such as walking up stairs).
		public override void MotionEnded (UIEventSubtype motion, UIEvent evt)
		{


			base.MotionEnded(motion, evt);
			if (!ButtonKitty.Enabled)
				return;

			// if the motion was a shake
			if(motion == UIEventSubtype.MotionShake) {

				FlurryAnalytics.Flurry.LogEvent("Otter");
				SetImage (OverflowHelper.Animal.Otter);
			}
		}
Ejemplo n.º 37
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
     {
         // Do your application-specific shake response here...
         if (ApplicationContext.Current != null && ApplicationContext.Current.ValueStack != null)
         {
             string workflow = ApplicationContext.Current.Workflow.Name;
             BusinessProcessContext.Current.GlobalEventsController.OnApplicationShake(workflow);
         }
     }
 }
Ejemplo n.º 38
0
 public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake)
         BITHockeyManager.SharedHockeyManager.FeedbackManager.ShowFeedbackComposeViewWithGeneratedScreenshot();
 }
Ejemplo n.º 39
0
        /// <summary>
        /// Method invoked when a motion (shake) has finished.
        /// </summary>
        /// <param name="motion">Motion.</param>
        /// <param name="evt">Evt.</param>
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            base.MotionEnded (motion, evt);

            // If the user shakes the device, kick the ball.
            if(motion == UIEventSubtype.MotionShake)
            {
                // Kick the ball.
                if(this.SKView.Scene != null)
                {
                    var boingScene = this.SKView.Scene as BoingScene;
                    boingScene.KickBall();
                }
            }
        }
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     if (motion ==  UIEventSubtype.MotionShake)
     {
         StartGame();
     }
 }
Ejemplo n.º 41
0
		public override void MotionEnded (UIEventSubtype motion, UIEvent evt)
		{
			TKFeedback.ShowFeedback ();
		}
Ejemplo n.º 42
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     Console.WriteLine ("Motion detected");
     if (motion == UIEventSubtype.MotionShake) {
         Console.WriteLine ("and was a shake");
         labelLastUpdated.Text = "All shook up! Updating...";
         // never appears
         // Do your application-specific shake response here...
         Update ();
     }
 }
Ejemplo n.º 43
0
        public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
        {
            if (motion == UIEventSubtype.MotionShake)
                this.ShakeDevice();

            base.MotionEnded(motion, evt);
        }
Ejemplo n.º 44
0
 public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
 {
     if (motion == UIEventSubtype.MotionShake) {
         Console.WriteLine("Device started shaking");
         if (CircleColor != UIColor.Red)
             CircleColor = UIColor.Red;
         else
             CircleColor = UIColor.LightGray;
     }
 }
Ejemplo n.º 45
0
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     TKFeedback.ShowFeedback();
 }
Ejemplo n.º 46
0
 public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
 {
     HypnosisView view = this.View as HypnosisView;
     if (motion == UIEventSubtype.MotionShake) {
         Console.WriteLine("Device started shaking");
         if (view.CircleColor != UIColor.Orange) {
             lastSelectedColor = view.CircleColor;
             lastSelectedSegmentIndex = segControl.SelectedSegment;
             view.CircleColor = UIColor.Orange;
             segControl.SelectedSegment = -1;
         }
         else {
             view.CircleColor = lastSelectedColor;
             segControl.SelectedSegment = lastSelectedSegmentIndex;
         }
     }
 }
Ejemplo n.º 47
0
 /// <summary>
 /// Method invoked when a motion (a shake) has started.
 /// </summary>
 /// <param name="motion">The motion subtype.</param>
 /// <param name="evt">The event arguments.</param>
 public override void MotionBegan(UIEventSubtype motion, UIEvent evt)
 {
     base.MotionBegan(motion, evt);
     if (motion == UIEventSubtype.MotionShake)
     {
         this.ActualController.HandleGesture(this, new OxyShakeGesture(), new OxyKeyEventArgs());
     }
 }
Ejemplo n.º 48
0
 // >> feedback-motion-cs
 public override void MotionEnded(UIEventSubtype motion, UIEvent evt)
 {
     // >> feedback-initialize-cs
     TKFeedback.ShowFeedback();
     // << feedback-initialize-cs
 }