code: private void saveScreenState() {
          clearScreenState();
  
          savedPhotoCount = gridAdapter.getCount();
  
          savedPagerPosition = listAnimator.isLeaving() || pagerAdapter.getCount() == 0
                  ? NO_POSITION : views.pager.getCurrentItem();
  
          if (views.grid.getChildCount() > 0) {
              View child = views.grid.getChildAt(0);
              savedGridPosition = views.grid.getChildAdapterPosition(child);
              savedGridPositionFromTop = child.getTop()
                      - Views.getMarginParams(child).topMargin
                      - views.grid.getPaddingTop();
          }
      }
docs: Saves current screen state: whether we are in a full image mode or not, as well as current
  grid position. So that we can restore UI on configuration change.