Skip to content

Commit d8b67e3

Browse files
committed
Fixed drag on device before coordinates are translated
- Fixed storage location for API >= 23
1 parent 3685d43 commit d8b67e3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/com/dtmilano/android/culebron.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from com.dtmilano.android.common import profileEnd
2727
from com.dtmilano.android.concertina import Concertina
2828

29-
__version__ = '11.4.0'
29+
__version__ = '11.5.0'
3030

3131
import sys
3232
import threading
@@ -1181,15 +1181,16 @@ def onCtrlK(self, event):
11811181

11821182
def drag(self, start, end, duration, steps, units=Unit.DIP):
11831183
self.showVignette()
1184+
# the operation on this current device is always done in PX
1185+
# so let's do it before any conversion takes place
1186+
self.device.drag(start, end, duration, steps)
11841187
if units == Unit.DIP:
11851188
x0 = round(start[0] / self.device.display['density'], 2)
11861189
y0 = round(start[1] / self.device.display['density'], 2)
11871190
x1 = round(end[0] / self.device.display['density'], 2)
11881191
y1 = round(end[1] / self.device.display['density'], 2)
11891192
start = (x0, y0)
11901193
end = (x1, y1)
1191-
# the operation on this current device is always done in PX
1192-
self.device.drag(start, end, duration, steps)
11931194
if self.vc.uiAutomatorHelper:
11941195
self.printOperation(None, Operation.SWIPE_UI_AUTOMATOR_HELPER, x0, y0, x1, y1, steps, units,
11951196
self.device.display['orientation'])

src/com/dtmilano/android/viewclient.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3209,7 +3209,11 @@ def dump(self, window=-1, sleep=1):
32093209
if api >= 23:
32103210
# In API 23 the process' stdout,in and err are connected to the socket not to the pts as in
32113211
# previous versions, so we can't redirect to /dev/tty
3212-
received = self.device.shell('uiautomator dump %s /sdcard/window_dump.xml >/dev/null && cat /sdcard/window_dump.xml' % ('--compressed' if self.compressedDump else ''))
3212+
# Also, if we want to write to /sdcard/something it fails event though /sdcard is a symlink
3213+
pathname = '/storage/self'
3214+
filename = 'window_dump.xml'
3215+
cmd = 'uiautomator dump %s %s/%s >/dev/null && cat %s/%s' % ('--compressed' if self.compressedDump else '', pathname, filename, pathname, filename)
3216+
received = self.device.shell(cmd)
32133217
else:
32143218
# NOTICE:
32153219
# Using /dev/tty this works even on devices with no sdcard

0 commit comments

Comments
 (0)