Created
August 12, 2016 15:48
-
-
Save caseykulm/45306fb960c9ac1e431729451855e048 to your computer and use it in GitHub Desktop.
isVisibleOnScreen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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