diff options
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Hotseat.java | 23 | ||||
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Workspace.java | 2 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Hotseat.java b/src/com/cyanogenmod/trebuchet/Hotseat.java index 84a8796..2ae3a23 100644 --- a/src/com/cyanogenmod/trebuchet/Hotseat.java +++ b/src/com/cyanogenmod/trebuchet/Hotseat.java @@ -63,15 +63,22 @@ public class Hotseat extends PagedView { TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.Hotseat, defStyle, 0); - Resources r = context.getResources(); - mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, DEFAULT_CELL_COUNT_X); - mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, DEFAULT_CELL_COUNT_Y); - mCellCountX = PreferencesProvider.Interface.Dock.getNumberIcons(mCellCountX); - mAllAppsButtonRank = r.getInteger(R.integer.hotseat_all_apps_index); - mTransposeLayoutWithOrientation = - r.getBoolean(R.bool.hotseat_transpose_layout_with_orientation); + mTransposeLayoutWithOrientation = + context.getResources().getBoolean(R.bool.hotseat_transpose_layout_with_orientation); mIsLandscape = context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; + mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, !mIsLandscape ? DEFAULT_CELL_COUNT_X : DEFAULT_CELL_COUNT_Y); + mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, !mIsLandscape ? DEFAULT_CELL_COUNT_Y : DEFAULT_CELL_COUNT_X); + int cellCount = PreferencesProvider.Interface.Dock.getNumberIcons(0); + if (cellCount > 0) { + if (!mIsLandscape) { + mCellCountX = cellCount; + } else { + mCellCountY = cellCount; + } + } + + mVertical = mIsLandscape; LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); @@ -117,7 +124,7 @@ public class Hotseat extends PagedView { return hasVerticalHotseat() ? 0 : rank; } int getCellYFromOrder(int rank) { - return hasVerticalHotseat() ? (mCellCountY - (rank + 1)) : 0; + return hasVerticalHotseat() ? rank : 0; } @Override diff --git a/src/com/cyanogenmod/trebuchet/Workspace.java b/src/com/cyanogenmod/trebuchet/Workspace.java index 05567e2..7c30386 100644 --- a/src/com/cyanogenmod/trebuchet/Workspace.java +++ b/src/com/cyanogenmod/trebuchet/Workspace.java @@ -679,8 +679,8 @@ public class Workspace extends SmoothPagedView // 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); - y = mLauncher.getHotseat().getCellYFromOrder(y); } else { if (!mHideIconLabels) { // Show titles if not in the hotseat |