From 53b9dc7f0ff23e926ab9a2ff2f79d9291d36a53e Mon Sep 17 00:00:00 2001 From: nebkat Date: Mon, 24 Dec 2012 13:46:02 +0000 Subject: Hotseat: Lanscape layout fixes Change-Id: I160e16e5d56e9722e210f3f3e9cf4413493c78a8 --- src/com/cyanogenmod/trebuchet/Hotseat.java | 5 ++++- src/com/cyanogenmod/trebuchet/Workspace.java | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/com/cyanogenmod/trebuchet') diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java index e6fe065a0..600c254d8 100644 --- a/src/com/cyanogenmod/trebuchet/Hotseat.java +++ b/src/com/cyanogenmod/trebuchet/Hotseat.java @@ -70,7 +70,7 @@ public class Hotseat extends PagedView { mCellCount = cellCount; } - mVertical = mIsLandscape; + mVertical = hasVerticalHotseat(); LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); @@ -118,6 +118,9 @@ public class Hotseat extends PagedView { int getCellYFromOrder(int rank) { return hasVerticalHotseat() ? (mCellCount - rank - 1) : 0; } + int getScreenFromOrder(int screen) { + return hasVerticalHotseat() ? (getChildCount() - screen - 1) : screen; + } @Override protected void onFinishInflate() { diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java index 7c30386d9..fa0c9ecce 100644 --- a/src/com/cyanogenmod/trebuchet/Workspace.java +++ b/src/com/cyanogenmod/trebuchet/Workspace.java @@ -663,6 +663,11 @@ public class Workspace extends SmoothPagedView final CellLayout layout; if (container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) { + // Note: We do this to ensure that the hotseat is always laid out in the orientation + // of the hotseat in order regardless of which orientation they were added + y = mLauncher.getHotseat().getCellYFromOrder(x); + x = mLauncher.getHotseat().getCellXFromOrder(x); + screen = mLauncher.getHotseat().getScreenFromOrder(screen); if (screen < 0 || screen >= mLauncher.getHotseat().getChildCount()) { layout = (CellLayout) mLauncher.getHotseat().getLayout(); } else { @@ -676,11 +681,6 @@ public class Workspace extends SmoothPagedView } else if (child instanceof BubbleTextView) { ((BubbleTextView) child).setTextVisible(false); } - - // Note: We do this to ensure that the hotseat is always laid out in the orientation - // of the hotseat in order regardless of which orientation they were added - y = mLauncher.getHotseat().getCellYFromOrder(x); - x = mLauncher.getHotseat().getCellXFromOrder(x); } else { if (!mHideIconLabels) { // Show titles if not in the hotseat -- cgit v1.2.3