public static boolean isViewSelfVisible(View view) {
        if (view == null || view.getWindowVisibility() == View.GONE) {
            return false;
        }
        if (WindowHelper.isDecorView(view.getClass())) {
            return true;
        }
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            boolean viewLocalVisiable = view.getLocalVisibleRect(new Rect());
            if (view.getWidth() <= 0 || view.getHeight() <= 0 || view.getAlpha() <= 0.0f || !viewLocalVisiable) {
                return false;
            }
        }
        if ((view.getVisibility() == View.VISIBLE || view.getAnimation() == null || !view.getAnimation().getFillAfter()) && view.getVisibility() != View.VISIBLE) {
            return false;
        }
        return true;
    }
@Test
    public void isViewSelfVisible() {
        CheckBox textView1 = new CheckBox(mApplication);
        textView1.setVisibility(View.VISIBLE);
        Assert.assertFalse(SAViewUtils.isViewSelfVisible(textView1));
    }