Only A example for a merge request dtmilano/AndroidViewClient#135
In this example, MainActivity add a new window via WindowManager.addView, this window is visible but not focusable.
This commit add a window id to view, so view can compute the right coordinate even if it is in a non-focusable window. Otherwise it will use the focused window's coordinate, which is no correct since the focused window is not the window it resides.
The following script only works for this example with the modification mentioned above.
#! /usr/bin/env python
from com.dtmilano.android.viewclient import ViewClient
kwargs1 = {'verbose': True, 'ignoresecuredevice': True}
kwargs2 = {'startviewserver': True, 'forceviewserveruse': True, 'autodump': False, 'ignoreuiautomatorkilled': True}
vc = ViewClient(*ViewClient.connectToDeviceOrExit(**kwargs1), **kwargs2)
#vc.device.startActivity(component="individual.aurthconan.addwindowexample/individual.aurthconan.addwindowexample.MainActivity")
vc.dump("individual.aurthconan.addwindowexample.floatingwindow")
boom = vc.findViewWithText("BOOM!")
boom.touch()