Skip to content

Commit

Permalink
Add launcher drag example
Browse files Browse the repository at this point in the history
  • Loading branch information
dtmilano committed Feb 27, 2024
1 parent e8eae4b commit 8a1994a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/helper/launcher-drag-youtube-icon.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /usr/bin/env python3

from com.dtmilano.android.viewclient import ViewClient

helper = ViewClient.view_client_helper()
oid = helper.ui_device.find_object(ui_selector="desc@YouTube").oid
t, l, r, b = helper.ui_object.get_bounds(oid=oid)
s_x = int(l + (r - l)/2)
s_y = int(t + (b - t)/2)
e_x = 300
e_y = 700
helper.ui_device.drag(s_x, s_y, e_x, e_y, 50)

0 comments on commit 8a1994a

Please sign in to comment.