MCPcopy Create free account
hub / github.com/zai-org/Open-AutoGLM / _handle_swipe

Method _handle_swipe

phone_agent/actions/handler.py:175–188  ·  view source on GitHub ↗

Handle swipe action.

(self, action: dict, width: int, height: int)

Source from the content-addressed store, hash-verified

173 return ActionResult(True, False)
174
175 def _handle_swipe(self, action: dict, width: int, height: int) -> ActionResult:
176 """Handle swipe action."""
177 start = action.get("start")
178 end = action.get("end")
179
180 if not start or not end:
181 return ActionResult(False, False, "Missing swipe coordinates")
182
183 start_x, start_y = self._convert_relative_to_absolute(start, width, height)
184 end_x, end_y = self._convert_relative_to_absolute(end, width, height)
185
186 device_factory = get_device_factory()
187 device_factory.swipe(start_x, start_y, end_x, end_y, device_id=self.device_id)
188 return ActionResult(True, False)
189
190 def _handle_back(self, action: dict, width: int, height: int) -> ActionResult:
191 """Handle back button action."""

Callers

nothing calls this directly

Calls 4

get_device_factoryFunction · 0.90
swipeMethod · 0.80
ActionResultClass · 0.70

Tested by

no test coverage detected