Example usage for android.widget HorizontalScrollView getLocationOnScreen

List of usage examples for android.widget HorizontalScrollView getLocationOnScreen

Introduction

In this page you can find the example usage for android.widget HorizontalScrollView getLocationOnScreen.

Prototype

public void getLocationOnScreen(@Size(2) int[] outLocation) 

Source Link

Document

Computes the coordinates of this view on the screen.

Usage

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);
}