public override bool OnTouchEvent(MotionEvent e) { if (!Enabled) { return(false); } switch (e.Action) { case MotionEventActions.Down: StartTrackingTouch?.Invoke(this, new StartTrackingTouchEventArgs(this)); Selected = true; Pressed = true; Progress = Max - (int)(Max * e.GetY() / Height); System.Diagnostics.Debug.WriteLine("> Down: " + Progress); break; case MotionEventActions.Move: Progress = Max - (int)(Max * e.GetY() / Height); System.Diagnostics.Debug.WriteLine("> Move: " + Progress); break; case MotionEventActions.Up: StopTrackingTouch?.Invoke(this, new StopTrackingTouchEventArgs(this)); Selected = false; Pressed = false; Progress = Max - (int)(Max * e.GetY() / Height); System.Diagnostics.Debug.WriteLine("> Up: " + Progress); break; case MotionEventActions.Cancel: Selected = false; Pressed = false; System.Diagnostics.Debug.WriteLine("> Cancel: " + Progress); break; } return(true); }
public void OnStartTrackingTouch(SeekBar seekBar) { StartTrackingTouch?.Invoke(seekBar); }