refactor: move action options

This commit is contained in:
lilong.129
2025-05-25 00:15:18 +08:00
parent 97dad38b7b
commit 4ff2692f02
15 changed files with 230 additions and 230 deletions
+4 -4
View File
@@ -312,7 +312,7 @@ func (ad *ADBDriver) TapAbsXY(x, y float64, opts ...option.ActionOption) error {
if err != nil {
return err
}
defer postHandler(ad, ACTION_TapAbsXY, actionOptions)
defer postHandler(ad, option.ACTION_TapAbsXY, actionOptions)
// adb shell input tap x y
xStr := fmt.Sprintf("%.1f", x)
@@ -331,7 +331,7 @@ func (ad *ADBDriver) DoubleTap(x, y float64, opts ...option.ActionOption) error
if err != nil {
return err
}
defer postHandler(ad, ACTION_DoubleTapXY, actionOptions)
defer postHandler(ad, option.ACTION_DoubleTapXY, actionOptions)
// adb shell input tap x y
xStr := fmt.Sprintf("%.1f", x)
@@ -380,7 +380,7 @@ func (ad *ADBDriver) Drag(fromX, fromY, toX, toY float64, opts ...option.ActionO
if err != nil {
return err
}
defer postHandler(ad, ACTION_Drag, actionOptions)
defer postHandler(ad, option.ACTION_Drag, actionOptions)
duration := 200.0
if actionOptions.Duration > 0 {
@@ -412,7 +412,7 @@ func (ad *ADBDriver) Swipe(fromX, fromY, toX, toY float64, opts ...option.Action
if err != nil {
return err
}
defer postHandler(ad, ACTION_Swipe, actionOptions)
defer postHandler(ad, option.ACTION_Swipe, actionOptions)
// adb shell input swipe fromX fromY toX toY
_, err = ad.runShellCommand(