I can scroll until get the specified text by the following code
driver.find_element_by_android_uiautomator( 'new UiScrollable(new UiSelector().scrollable(true).instance(0)).getChildByText(new UiSelector().className("android.widget.TextView"), "my_text")').click()
But I want to scroll only the current visible window so that it's not visible. Like left one is visible when I go to the screen. After a full scroll, I want everything from my first screen to become invisible and the next elements to become visible.
My main goal is to count the total number of messages but by elements selector I can get only currently visible items on the screen. So my idea is to count all elements from first screen then full scroll and count elements from the second scroll and add with previous one