I am working on an app where the devs have created an endless circular recycler view. While using the app, you can scroll through the recycler view endlessly. For that, you have to click on any item on the recycler view and scroll. Once you see desired item on the screen, you have to leave your finger, and as soon as you leave your finger, the screen background changes color and a corresponding button is shown on the screen. Now, This is where I face an issue with.
I have used Espresso and Barista libraries to scroll thru the list and I am succeeded in scrolling. I used following code to scroll:
Barista libraries:
scrollListToPosition(R.id.recyclerview, 5);
clickListItem(R.id.recyclerview, 6);
Also, Espresso libraries:
onView(withId(R.id.content_view)).perform(RecyclerViewActions.scrollToPosition(5));
With both the above methods, I am able to scroll through the list and the correct item appears on the screen, but the background color is not changed and the corresponding button is not shown on the screen. (If I compare this behavior with an actual device, this happens when I swipe up with my finger but do not leave the finger on the screen. And as soon as I leave the finger, the color changes and a button appears) So, in short, i am able to scroll but not able to mimic the behavior of leaving the finger from the screen.