`private boolean isViewVisible(View host, Rect window, boolean fullVisible) {// Make sure our host view is attached to a visible window.
if (host.getWindowVisibility() == View.VISIBLE) {// An invisible predecessor or one with alpha zero means
// that this view is not visible to the user. Object current = host;
while (current instanceof View) {View view = (View) current;
// We have attach info so this view is attached and there is no
// need to check whether we reach to ViewRootImpl on the way up. if (view.getAlpha() <= 0 || view.getVisibility() != View.VISIBLE) {return false;
}current = view.getParent();
}// Check if the view is visible in window.
// host.getWindowVisibleDisplayFrame(mWindowRect); Rect visibleRect = new Rect();
if (fullVisible) {// Check if the view is entirely visible.
if (!host.getLocalVisibleRect(visibleR