change: update function optional parameters to DataOptions

This commit is contained in:
xucong.053
2022-10-16 23:31:13 +08:00
parent 1ed4fcd1e0
commit 2df2792fe4
13 changed files with 149 additions and 150 deletions

View File

@@ -573,7 +573,7 @@ func (ud *uiaDriver) _swipe(startX, startY, endX, endY interface{}, options ...D
}
// append options in post data for extra uiautomator configurations
// e.g. use WithPressDuration to set pressForDuration
// e.g. use WithPressDurationOption to set pressForDuration
for _, option := range options {
option(data)
}
@@ -590,7 +590,7 @@ func (ud *uiaDriver) _swipe(startX, startY, endX, endY interface{}, options ...D
// per step. So for a 100 steps, the swipe will take about 1/2 second to complete.
// `steps` is the number of move steps sent to the system
func (ud *uiaDriver) Swipe(fromX, fromY, toX, toY int, options ...DataOption) error {
options = append(options, WithSteps(12))
options = append(options, WithStepsOption(12))
return ud.SwipeFloat(float64(fromX), float64(fromY), float64(toX), float64(toY), options...)
}