refactor: handlerDoubleTap

This commit is contained in:
lilong.129
2025-05-06 00:52:47 +08:00
parent 48e3d9002e
commit 71dac459e6
7 changed files with 48 additions and 30 deletions

View File

@@ -326,12 +326,10 @@ 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 = convertToAbsolutePoint(ad, x, y)
x, y, err = handlerDoubleTap(ad, x, y, opts...)
if err != nil {
return err
}
actionOptions := option.NewActionOptions(opts...)
x, y = actionOptions.ApplyTapOffset(x, y)
// adb shell input tap x y
xStr := fmt.Sprintf("%.1f", x)