public void OnStop()
 {
     if (Stopped != null)
     {
         Stopped(Activity);
     }
     AccelerometerListener.StopListening();
 }
 public void OnStart()
 {
     if (Started != null)
     {
         Started(Activity);
     }
     AccelerometerListener.StartListening(Input);
 }
 public void OnDestroy()
 {
     if (Destroying != null)
     {
         Destroying(Activity);
     }
     AccelerometerListener.StopListening();
     Activity = null;
 }
Beispiel #4
0
 public static void StopListening()
 {
     if (listener != null)
     {
         var activity      = Lime.ActivityDelegate.Instance.Activity;
         var sensorManager = (SensorManager)activity.GetSystemService(Android.Content.Context.SensorService);
         sensorManager.UnregisterListener(listener);
         listener = null;
     }
 }
Beispiel #5
0
 public void OnDestroy()
 {
     if (Destroying != null)
     {
         Destroying(Activity);
     }
     AccelerometerListener.StopListening();
     Application.SupportedDeviceOrientationsChanged -= RestrictSupportedOrientationsWith;
     Activity = null;
 }
Beispiel #6
0
 public void OnPause()
 {
     AudioSystem.Active = false;
     GameView.ClearFocus();
     if (Paused != null)
     {
         Paused(Activity);
     }
     AccelerometerListener.StopListening();
 }
Beispiel #7
0
 public static void StartListening(Input input)
 {
     if (listener == null)
     {
         listener = new AccelerometerListener()
         {
             input = input
         };
         var activity      = Lime.ActivityDelegate.Instance.Activity;
         var sensorManager = (SensorManager)activity.GetSystemService(Android.Content.Context.SensorService);
         sensorManager.RegisterListener(listener, sensorManager.GetDefaultSensor(SensorType.Accelerometer), SensorDelay.Ui);
     }
 }
Beispiel #8
0
 public void OnResume()
 {
     AudioSystem.Active = true;
     if (!GameView.IsFocused)
     {
         GameView.RequestFocus();
     }
     AccelerometerListener.StartListening(Input);
     if (Resumed != null)
     {
         Resumed(Activity);
     }
 }