@@ -0,0 +1,1211 @@
+package org.azavea.views;%0A%0Aimport android.content.Context;%0Aimport android.util.AttributeSet;%0Aimport android.view.View;%0Aimport android.widget.ScrollView;%0A%0Apublic class NotifyingScrollView extends ScrollView %7B%0A%0A%09private OnScrollToBottomListener bottomListener = null;%0A%09%0A%09public interface OnScrollToBottomListener %7B%0A%09%09void OnScrollToBottom();%0A%09%7D%0A%09public NotifyingScrollView(Context context, AttributeSet attrs) %7B%0A%09%09super(context, attrs);%0A%09%7D%0A%09%0A%09public void setOnScrollToBottomListener(OnScrollToBottomListener listener) %7B%0A%09        bottomListener = listener;%0A%09%7D%0A%09   %0A%09public void onScrollToBottom() %7B%7D%0A%0A%09@Override%0A%09protected void onScrollChanged(int l, int t, int oldl, int oldt) %0A%09%7B%0A%09        // Grab the last child placed in the ScrollView, we need it to determinate the bottom position.%0A%09        View view = (View) getChildAt(getChildCount()-1);%0A%09        %0A%09        // Calculate the scrolldiff%0A%09        int diff = (view.getBottom()-(getHeight()+getScrollY()));%0A%09        %0A%09        if( diff == 0 )%0A%09        %7B%0A%09        %09if (bottomListener != null) %7B%0A%09        %09%09bottomListener.OnScrollToBottom();%0A%09        %09%7D%0A%09        %7D%0A%09        %0A%09        super.onScrollChanged(l, t, oldl, oldt);%0A%09        this.onScrollToBottom();%0A%09%7D%0A%7D%0A

Extend ScrollView for a view which notifies on reaching the bottom