Example usage for android.widget HorizontalScrollView getDrawingRect

List of usage examples for android.widget HorizontalScrollView getDrawingRect

Introduction

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

Prototype

public void getDrawingRect(Rect outRect) 

Source Link

Document

Return the visible drawing bounds of your view.

Usage

From source file:com.raspi.chatapp.ui.chatting.SendImageFragment.java

private boolean isViewVisible(HorizontalScrollView scrollView, View view) {
    Rect scrollBounds = new Rect();
    scrollView.getDrawingRect(scrollBounds);
    float vLeft = view.getLeft();
    float vRight = view.getWidth() + vLeft;
    return scrollBounds.left < vLeft && scrollBounds.right > vRight;
}