@Override
        protected void onLayout(boolean changed, int left, int top, int right, int bottom) {

          int slotViewTop = mActivity.getGalleryActionBar().getHeight() + mConfig.paddingTop;
          int slotViewBottom = bottom - top - mConfig.paddingBottom;
          int slotViewRight = right - left - mConfig.paddingRight;

          if (mShowDetails) {
            mDetailsHelper.layout(left, slotViewTop, right, bottom);
          } else {
            mAlbumView.setHighlightItemPath(null);
          }

          // Set the mSlotView as a reference point to the open animation
          mOpenCenter.setReferencePosition(mConfig.paddingLeft, slotViewTop);
          mSlotView.layout(mConfig.paddingLeft, slotViewTop, slotViewRight, slotViewBottom);
          GalleryUtils.setViewPointMatrix(
              mMatrix, (right - left) / 2, (bottom - top) / 2, -mUserDistance);
        }
 private void hideDetails() {
   mShowDetails = false;
   mDetailsHelper.hide();
   mAlbumView.setHighlightItemPath(null);
   mSlotView.invalidate();
 }