List of usage examples for android.widget HorizontalScrollView getLocationOnScreen
public void getLocationOnScreen(@Size(2) int[] outLocation)
Computes the coordinates of this view on the screen.
From source file:org.catrobat.paintroid.test.integration.BaseIntegrationTestClass.java
private void scrollToolBarToLeft() { HorizontalScrollView scrollView = (HorizontalScrollView) mSolo.getView(R.id.bottom_bar_scroll_view); int[] screenLocation = { 0, 0 }; scrollView.getLocationOnScreen(screenLocation); int getAwayFromNavigationDrawer = 60; float fromX = screenLocation[0] + getAwayFromNavigationDrawer; float toX = screenLocation[0] + scrollView.getWidth(); float yPos = screenLocation[1] + (scrollView.getHeight() / 2.0f); mSolo.drag(fromX, toX, yPos, yPos, 1); }