diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Hotseat.java | 16 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Workspace.java | 21 |
2 files changed, 28 insertions, 9 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java index 5dcbcb1..d5fd0ec 100644 --- a/src/com/cyanogenmod/trebuchet/Hotseat.java +++ b/src/com/cyanogenmod/trebuchet/Hotseat.java @@ -30,6 +30,7 @@ import com.cyanogenmod.trebuchet.preference.PreferencesProvider; public class Hotseat extends PagedView { private int mCellCount; + private int mHotseatPages; private int mDefaultPage; private boolean mTransposeLayoutWithOrientation; @@ -58,10 +59,10 @@ public class Hotseat extends PagedView { mFadeInAdjacentScreens = false; mHandleScrollIndicator = true; - int hotseatPages = PreferencesProvider.Interface.Dock.getNumberPages(); + mHotseatPages = PreferencesProvider.Interface.Dock.getNumberPages(); int defaultPage = PreferencesProvider.Interface.Dock.getDefaultPage(DEFAULT_PAGE); - if (defaultPage >= hotseatPages) { - defaultPage = hotseatPages / 2; + if (defaultPage >= mHotseatPages) { + defaultPage = mHotseatPages / 2; } mCurrentPage = mDefaultPage = defaultPage; @@ -91,7 +92,7 @@ public class Hotseat extends PagedView { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - for (int i = 0; i < hotseatPages; i++) { + for (int i = 0; i < mHotseatPages; i++) { CellLayout cl = (CellLayout) inflater.inflate(R.layout.hotseat_page, null); cl.setChildrenScale(childrenScale); cl.setGridSize((!hasVerticalHotseat() ? mCellCount : 1), (hasVerticalHotseat() ? mCellCount : 1)); @@ -263,12 +264,13 @@ public class Hotseat extends PagedView { } void moveToDefaultScreen(boolean animate) { + int page = hasVerticalHotseat() ? (mHotseatPages - mDefaultPage - 1) : mDefaultPage; if (animate) { - snapToPage(mDefaultPage); + snapToPage(page); } else { - setCurrentPage(mDefaultPage); + setCurrentPage(page); } - getChildAt(mDefaultPage).requestFocus(); + getChildAt(page).requestFocus(); } @Override diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java index a6f9154..20b9953 100644 --- a/src/com/cyanogenmod/trebuchet/Workspace.java +++ b/src/com/cyanogenmod/trebuchet/Workspace.java @@ -1566,16 +1566,17 @@ public class Workspace extends PagedView // On large screens we need to fade the page as it nears its leftmost position alpha = mLeftScreenAlphaInterpolator.getInterpolation(1 - scrollProgress); } - cl.setTranslationX(translationX); cl.setScaleX(scale); cl.setScaleY(scale); cl.setAlpha(alpha); // If the view has 0 alpha, we set it to be invisible so as to prevent - // it from accepting touches + // it from accepting touches. Move the view to its original position to + // prevent overlap between views if (alpha <= 0) { cl.setVisibility(INVISIBLE); + cl.setTranslationX(0); } else if (cl.getVisibility() != VISIBLE) { cl.setVisibility(VISIBLE); } @@ -2231,8 +2232,16 @@ public class Workspace extends PagedView if (mTransitionEffect == TransitionEffect.Stack) { if (i <= mCurrentPage) { cl.setVisibility(VISIBLE); + cl.setAlpha(1.0f); + if (mFadeInAdjacentScreens) { + setCellLayoutFadeAdjacent(cl, 0.0f); + } } else { cl.setVisibility(INVISIBLE); + cl.setAlpha(0.0f); + if (mFadeInAdjacentScreens) { + setCellLayoutFadeAdjacent(cl, 1.0f); + } } } @@ -2294,6 +2303,14 @@ public class Workspace extends PagedView cl.setPivotX(cl.getMeasuredWidth() * 0.5f); cl.setPivotY(cl.getMeasuredHeight() * 0.5f); cl.setVisibility(VISIBLE); + + // Stack Effect + if (mTransitionEffect == TransitionEffect.Stack) { + cl.setAlpha(1.0f); + if (mFadeInAdjacentScreens) { + setCellLayoutFadeAdjacent(cl, 0.0f); + } + } } // Determine the pages alpha during the state transition |