Exemple #1
0
        /// <summary>
        /// Handles execution of Rotated event
        /// </summary>
        /// <param name="args">RotaryEvent Args</param>
        private void RotaryEventManager_Rotated(ElmSharp.Wearable.RotaryEventArgs args)
        {
            _currentMoveTime = DateTime.Now;
            var span = _currentMoveTime - _lastMoveTime;

            _lastMoveTime = _currentMoveTime;
            if (span.TotalMilliseconds <= 4)
            {
                return;
            }

            if (args.IsClockwise)
            {
                if (_currentScreen == 3)
                {
                    return;
                }

                SwitchScreen(_currentScreen + 1);
            }
            else
            {
                if (_currentScreen == 0)
                {
                    return;
                }

                SwitchScreen(_currentScreen - 1);
            }
        }
Exemple #2
0
 void OnRotaryEventChanged(ElmSharp.Wearable.RotaryEventArgs e)
 {
     if (_currentRotaryFocusObject is IRotaryEventReceiver receiver)
     {
         receiver.Rotate(new RotaryEventArgs {
             IsClockwise = e.IsClockwise
         });
     }
 }
Exemple #3
0
 /// <summary>
 /// Rotated event handler
 /// </summary>
 /// <param name="args">Rotary event arguments.</param>
 private void OnRotated(ElmSharp.Wearable.RotaryEventArgs args)
 {
     if (args.IsClockwise)
     {
         ZoomLevel++;
     }
     else
     {
         ZoomLevel--;
     }
 }
Exemple #4
0
 void OnRotaryEventChanged(ElmSharp.Wearable.RotaryEventArgs e)
 {
     _rotaryReceiver?.Rotate(new RotaryEventArgs {
         IsClockwise = e.IsClockwise
     });
 }