feat: add pre hook and post hook for DoubleTap action

This commit is contained in:
lilong.129
2025-05-09 23:06:45 +08:00
parent 3715cbb432
commit f7ec4a06b4
6 changed files with 21 additions and 13 deletions

View File

@@ -326,11 +326,12 @@ func (ad *ADBDriver) TapAbsXY(x, y float64, opts ...option.ActionOption) error {
func (ad *ADBDriver) DoubleTap(x, y float64, opts ...option.ActionOption) error {
log.Info().Float64("x", x).Float64("y", y).Msg("ADBDriver.DoubleTap")
var err error
x, y, err = handlerDoubleTap(ad, x, y, opts...)
actionOptions := option.NewActionOptions(opts...)
x, y, err := preHandler_DoubleTap(ad, actionOptions, x, y)
if err != nil {
return err
}
defer postHandler(ad, actionOptions)
// adb shell input tap x y
xStr := fmt.Sprintf("%.1f", x)