diff options
author | nebkat <nebkat@teamhacksung.org> | 2012-04-05 14:02:03 +0200 |
---|---|---|
committer | nebkat <nebkat@teamhacksung.org> | 2012-12-24 10:12:36 +0000 |
commit | d9cb08dc62e6a816f81d640b4829bb9266a5c38c (patch) | |
tree | a8cacbcfe9b3bd4c8b4c88058e463b0e497cf6cb /src/com/cyanogenmod/trebuchet | |
parent | 3c512865bfc4243ccab4103320407dcd1e58d874 (diff) | |
download | android_packages_apps_Trebuchet-d9cb08dc62e6a816f81d640b4829bb9266a5c38c.tar.gz android_packages_apps_Trebuchet-d9cb08dc62e6a816f81d640b4829bb9266a5c38c.tar.bz2 android_packages_apps_Trebuchet-d9cb08dc62e6a816f81d640b4829bb9266a5c38c.zip |
Hotseat: Fix landscape grid
Conflicts:
src/com/cyanogenmod/trebuchet/Hotseat.java
Change-Id: Ib5fd58b084048b458c82bbf134084354d2e74cd9
Diffstat (limited to 'src/com/cyanogenmod/trebuchet')
-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 84a8796b9..2ae3a23a9 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 05567e25e..7c30386d9 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 |