private void onUp(boolean followedByLongPress) {
   if (followedByLongPress) {
     // Avoid showing press-up animations for long-press.
     mAlbumView.setPressedIndex(-1);
   } else {
     mAlbumView.setPressedUp();
   }
 }
  private void onSingleTapUp(int slotIndex) {
    if (!mIsActive) return;

    if (mSelectionManager.inSelectionMode()) {
      MediaItem item = mAlbumDataAdapter.get(slotIndex);
      if (item == null) return; // Item not ready yet, ignore the click
      mSelectionManager.toggle(item.getPath());
      mSlotView.invalidate();
    } else {
      // Render transition in pressed state
      mAlbumView.setPressedIndex(slotIndex);
      mAlbumView.setPressedUp();
      mHandler.sendMessageDelayed(
          mHandler.obtainMessage(MSG_PICK_PHOTO, slotIndex, 0), FadeTexture.DURATION);
    }
  }
  @Override
  protected void onResume() {
    super.onResume();
    mIsActive = true;

    mResumeEffect = mActivity.getTransitionStore().get(KEY_RESUME_ANIMATION);
    if (mResumeEffect != null) {
      mAlbumView.setSlotFilter(mResumeEffect);
      mResumeEffect.setPositionProvider(mPositionProvider);
      mResumeEffect.start();
    }

    setContentPane(mRootPane);

    boolean enableHomeButton =
        (mActivity.getStateManager().getStateCount() > 1) | mParentMediaSetString != null;
    GalleryActionBar actionBar = mActivity.getGalleryActionBar();
    actionBar.setDisplayOptions(enableHomeButton, false);
    if (!mGetContent) {
      actionBar.enableAlbumModeMenu(GalleryActionBar.ALBUM_GRID_MODE_SELECTED, this);
    }

    // Set the reload bit here to prevent it exit this page in clearLoadingBit().
    setLoadingBit(BIT_LOADING_RELOAD);
    mLoadingFailed = false;
    mAlbumDataAdapter.resume();

    mAlbumView.resume();
    mAlbumView.setPressedIndex(-1);
    mActionModeHandler.resume();
    if (!mInitialSynced) {
      setLoadingBit(BIT_LOADING_SYNC);
      mSyncTask = mMediaSet.requestSync(this);
    }
    mInCameraAndWantQuitOnPause = mInCameraApp;
  }
 private void onDown(int index) {
   mAlbumView.setPressedIndex(index);
 }