summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Hotseat.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-08-12 16:19:28 -0700
committerWinson Chung <winsonc@google.com>2013-08-20 10:56:05 -0700
commit5f8afe6280eae34620067696173e71943e1a30a3 (patch)
treeeb0ebdf56f2ad0950894424a49de9d1e8dc832e0 /src/com/android/launcher3/Hotseat.java
parent8a6870101c3d99257fc050d11bb69f50f5240622 (diff)
downloadandroid_packages_apps_Trebuchet-5f8afe6280eae34620067696173e71943e1a30a3.tar.gz
android_packages_apps_Trebuchet-5f8afe6280eae34620067696173e71943e1a30a3.tar.bz2
android_packages_apps_Trebuchet-5f8afe6280eae34620067696173e71943e1a30a3.zip
Initial Changes for Dynamic Grid
Change-Id: I9e6f1e5167791cf8dc140778dfa447f86424e9bf
Diffstat (limited to 'src/com/android/launcher3/Hotseat.java')
-rw-r--r--src/com/android/launcher3/Hotseat.java19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index f94ed7829..d28e96f2d 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -37,11 +37,8 @@ public class Hotseat extends FrameLayout {
@SuppressWarnings("unused")
private static final String TAG = "Hotseat";
- private Launcher mLauncher;
private CellLayout mContent;
- private int mCellCountX;
- private int mCellCountY;
private int mAllAppsButtonRank;
private boolean mTransposeLayoutWithOrientation;
@@ -61,9 +58,6 @@ public class Hotseat extends FrameLayout {
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.Hotseat, defStyle, 0);
Resources r = context.getResources();
- mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, -1);
- mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, -1);
- mAllAppsButtonRank = r.getInteger(R.integer.hotseat_all_apps_index);
mTransposeLayoutWithOrientation =
r.getBoolean(R.bool.hotseat_transpose_layout_with_orientation);
mIsLandscape = context.getResources().getConfiguration().orientation ==
@@ -71,7 +65,6 @@ public class Hotseat extends FrameLayout {
}
public void setup(Launcher launcher) {
- mLauncher = launcher;
setOnKeyListener(new HotseatIconKeyEventListener());
}
@@ -101,10 +94,16 @@ public class Hotseat extends FrameLayout {
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- if (mCellCountX < 0) mCellCountX = LauncherModel.getCellCountX();
- if (mCellCountY < 0) mCellCountY = LauncherModel.getCellCountY();
+ LauncherAppState app = LauncherAppState.getInstance();
+ DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+
+ mAllAppsButtonRank = (int) (grid.numHotseatIcons / 2);
mContent = (CellLayout) findViewById(R.id.layout);
- mContent.setGridSize(mCellCountX, mCellCountY);
+ if (grid.isLandscape && !grid.isLargeTablet()) {
+ mContent.setGridSize(1, (int) grid.numHotseatIcons);
+ } else {
+ mContent.setGridSize((int) grid.numHotseatIcons, 1);
+ }
mContent.setIsHotseat(true);
resetLayout();