示例#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);
            }
        }
示例#2
0
 void OnRotaryEventChanged(ElmSharp.Wearable.RotaryEventArgs e)
 {
     if (_currentRotaryFocusObject is IRotaryEventReceiver receiver)
     {
         receiver.Rotate(new RotaryEventArgs {
             IsClockwise = e.IsClockwise
         });
     }
 }
示例#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--;
     }
 }
示例#4
0
 void OnRotaryEventChanged(ElmSharp.Wearable.RotaryEventArgs e)
 {
     _rotaryReceiver?.Rotate(new RotaryEventArgs {
         IsClockwise = e.IsClockwise
     });
 }