I’d like to perform a vertical swipe on Android to scroll a RecyclerView.
The approach with scrollIntoView
wouldn’t work because I’d like to get the list of all elements rather than scroll to the concrete element.
Also the keyboard is shown at the screen. I don’t want to hide it before scrolling.
I can get element’s location and size using Appium API. Also API allows to check if keyboard is present.
But the element coordinates include points hidden by the keyboard so the following approach wouldn’t work:
location = element.location
size = element.size
x = location['x'] + size['width'] / 2
element_height = size['height']
start_y = location['y'] + element_height * 0.8 # this returns a point hided by the keyboard
end_y = location['y'] + element_height * 0.2
How can I get the size of the keyboard so I could perform scroll only in the visible area?