I have a ScrollView which holds a series of Views. I would like to be able to determine if a view is currently visible (if any part of it is curre
ScrollView
Views
public static int getVisiblePercent(View v) { if (v.isShown()) { Rect r = new Rect(); v.getGlobalVisibleRect(r); double sVisible = r.width() * r.height(); double sTotal = v.getWidth() * v.getHeight(); return (int) (100 * sVisible / sTotal); } else { return -1; } }