Exemple #1
0
        public void Set(double percentage)
        {
            SettingPercentage?.Invoke(this, new ElementActionEventArgs <AndroidElement>(this, percentage.ToString()));
            int end = WrappedElement.Size.Width;
            int y   = WrappedElement.Location.Y;
            var touchActionsService = ServicesCollection.Current.Resolve <TouchActionsService <AndroidDriver <AndroidElement>, AndroidElement> >();
            int moveTo = (int)((percentage / 100) * end);

            touchActionsService.Press(moveTo, y, 0).Release().Perform();
            PercentageSet?.Invoke(this, new ElementActionEventArgs <AndroidElement>(this, percentage.ToString()));
        }
Exemple #2
0
        public virtual void Set(double value)
        {
            SettingPercentage?.Invoke(this, new ComponentActionEventArgs <IOSElement>(this, value.ToString()));
            int end = WrappedElement.Size.Width;
            int y   = WrappedElement.Location.Y;
            var touchActionsService = ServicesCollection.Current.Resolve <TouchActionsService <IOSDriver <IOSElement>, IOSElement> >();
            int moveTo = (int)((value / 100) * end);

            touchActionsService.Press(moveTo, y, 0).Release().Perform();
            PercentageSet?.Invoke(this, new ComponentActionEventArgs <IOSElement>(this, value.ToString()));
        }