is ScrollView To Bottom - Android User Interface

Android examples for User Interface:ScrollView

Description

is ScrollView To Bottom

Demo Code


import android.widget.ScrollView;

public class Main {
  public static boolean isScrollViewToBottom(ScrollView scrollView) {
    if (scrollView != null) {
      int scrollContentHeight = scrollView.getScrollY()
          + scrollView.getMeasuredHeight() - scrollView.getPaddingTop()
          - scrollView.getPaddingBottom();
      int realContentHeight = scrollView.getChildAt(0).getMeasuredHeight();
      if (scrollContentHeight == realContentHeight) {
        return true;
      }//from w w w.j av a2s.  c o m
    }
    return false;
  }
}

Related Tutorials