コード例 #1
0
 internal static void OnChanged(AccelerometerChangedEventArgs e)
 {
     if (useSyncContext)
     {
         MainThread.BeginInvokeOnMainThread(() => ReadingChanged?.Invoke(null, e));
     }
     else
     {
         ReadingChanged?.Invoke(null, e);
     }
 }
コード例 #2
0
        internal static void OnChanged(AccelerometerChangedEventArgs e)
        {
            if (useSyncContext)
            {
                MainThread.BeginInvokeOnMainThread(() => ReadingChanged?.Invoke(null, e));
            }
            else
            {
                ReadingChanged?.Invoke(null, e);
            }

            if (ShakeDetected != null)
            {
                ProcessShakeEvent(e.Reading.Acceleration);
            }
        }
コード例 #3
0
        internal static void OnChanged(AccelerometerChangedEventArgs e)
        {
            if (ReadingChanged == null)
            {
                return;
            }

            if (UseSyncContext)
            {
                Platform.BeginInvokeOnMainThread(() => ReadingChanged?.Invoke(e));
            }
            else
            {
                ReadingChanged?.Invoke(e);
            }
        }
コード例 #4
0
        internal static void OnChanged(AccelerometerChangedEventArgs e)
        {
            var handler = ReadingChanged;

            if (handler == null)
            {
                return;
            }

            if (useSyncContext)
            {
                MainThread.BeginInvokeOnMainThread(() => handler?.Invoke(e));
            }
            else
            {
                handler?.Invoke(e);
            }
        }
コード例 #5
0
        private void AccelerometerReadingChanged(object sender, Essentials.AccelerometerChangedEventArgs e)
        {
            var v = e.Reading.Acceleration;

            CurrentState = new Vector3(v.X, v.Y, v.Z);
        }