@Override protected void onWindowVisibilityChanged(final int visibility) { // Ignore transitions between View.GONE and View.INVISIBLE if (Visibility.hasScreenVisibilityChanged(mScreenVisibility, visibility)) { mScreenVisibility = visibility; setAdVisibility(mScreenVisibility); } }
private void setAdVisibility(final int visibility) { if (mAdViewController == null) { return; } if (Visibility.isScreenVisible(visibility)) { mAdViewController.unpauseRefresh(); } else { mAdViewController.pauseRefresh(); } }