package com.reactnativenavigation.utils;

import android.view.View;

import com.reactnativenavigation.views.ContentView;

public class ViewVisibilityChecker {

    public static boolean check(View view) {
        final int top = getTopRelativeToContentView(view);
        final int scrollYInScreen = getScrollYInScreen(view);
        return top + view.getHeight() > scrollYInScreen;
    }

    private static int getTopRelativeToContentView(View view) {
        return view instanceof ContentView ? 0 : view.getTop() + getTopRelativeToContentView((View) view.getParent());
    }

    private static int getScrollYInScreen(View view) {
        return view instanceof ContentView ? 0 : view.getScrollY() + getScrollYInScreen((View) view.getParent());
    }
}

@@ -35,16 +35,60 @@
 utils;%0A%0A
+import android.support.annotation.Nullable;%0A
 import a
@@ -229,16 +229,26 @@
 n check(
+@Nullable 
 View vie
@@ -244,32 +244,96 @@
 le View view) %7B%0A
+        if (view == null) %7B%0A            return false;%0A        %7D%0A
         final in

Add null check to ViewVisibilityChecker