Skip to content

Instantly share code, notes, and snippets.

@caseykulm
Created August 12, 2016 15:48
Show Gist options
  • Save caseykulm/45306fb960c9ac1e431729451855e048 to your computer and use it in GitHub Desktop.
Save caseykulm/45306fb960c9ac1e431729451855e048 to your computer and use it in GitHub Desktop.
isVisibleOnScreen
public class ViewUtil {
static boolean isVisibleOnScreen(View view, Rect rect, Point globalOffset) {
if (view == null) {
throw new IllegalArgumentException("view must not be null");
}
boolean isVisibleOnScreen = view.getGlobalVisibleRect(rect, globalOffset);
return isVisibleOnScreen;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment