コード例 #1
1
ファイル: PhotoTable.java プロジェクト: zst123/p201-packages
  @Override
  public void onLayout(boolean changed, int left, int top, int right, int bottom) {
    super.onLayout(changed, left, top, right, bottom);
    log("onLayout (%d, %d, %d, %d)", left, top, right, bottom);

    mHeight = bottom - top;
    mWidth = right - left;

    mLongSide = (int) (mImageRatio * Math.max(mWidth, mHeight));
    mShortSide = (int) (mImageRatio * Math.min(mWidth, mHeight));

    boolean isLandscape = mWidth > mHeight;
    if (mIsLandscape != isLandscape) {
      for (View photo : mOnTable) {
        if (photo != getSelection()) {
          dropOnTable(photo);
        }
      }
      if (hasSelection()) {
        pickUp(getSelection());
        for (int slot = 0; slot < mOnDeck.length; slot++) {
          if (mOnDeck[slot] != null) {
            placeOnDeck(mOnDeck[slot], slot);
          }
        }
      }
      mIsLandscape = isLandscape;
    }
    start();
  }
コード例 #2
0
ファイル: PhotoTable.java プロジェクト: zst123/p201-packages
 public void selectPrevious() {
   if (mStoryModeEnabled) {
     log("selectPrevious");
     if (hasSelection() && mOnDeck[PREV] != null) {
       placeOnDeck(mSelection, NEXT);
       mSelection = mOnDeck[PREV];
       mOnDeck[PREV] = null;
       promoteSelection();
     }
   } else {
     clearSelection();
   }
 }
コード例 #3
0
ファイル: PhotoTable.java プロジェクト: zst123/p201-packages
 public void selectNext() {
   if (mStoryModeEnabled) {
     log("selectNext");
     if (hasSelection() && mOnDeck[NEXT] != null) {
       placeOnDeck(mSelection, PREV);
       mSelection = mOnDeck[NEXT];
       mOnDeck[NEXT] = null;
       promoteSelection();
     }
   } else {
     clearSelection();
   }
 }