summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/Hotseat.java
diff options
context:
space:
mode:
authorAndrew Flynn <flynn@google.com>2012-02-29 13:33:22 -0800
committerAndrew Flynn <flynn@google.com>2012-02-29 17:30:37 -0800
commit0dca1ec41479a74f8da080224fa0c7eacab674d6 (patch)
treebad4a2d319a11c4da938122bd994485a59d0dc2a /src/com/android/launcher2/Hotseat.java
parent79b79dd57911b9f79d4fb872e70d37ee90b0cc64 (diff)
downloadandroid_packages_apps_Trebuchet-0dca1ec41479a74f8da080224fa0c7eacab674d6.tar.gz
android_packages_apps_Trebuchet-0dca1ec41479a74f8da080224fa0c7eacab674d6.tar.bz2
android_packages_apps_Trebuchet-0dca1ec41479a74f8da080224fa0c7eacab674d6.zip
New small/large screen division for Launcher.
Previously the dp division between the two was set at 600dp (7" tablets). This has now been bumped up to 720dp (10" tablets). Change-Id: I1f0419e504fc3bb606156c1cf6fbe03956274184
Diffstat (limited to 'src/com/android/launcher2/Hotseat.java')
-rw-r--r--src/com/android/launcher2/Hotseat.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/launcher2/Hotseat.java b/src/com/android/launcher2/Hotseat.java
index f7fa38007..add62c004 100644
--- a/src/com/android/launcher2/Hotseat.java
+++ b/src/com/android/launcher2/Hotseat.java
@@ -29,13 +29,13 @@ import com.android.launcher.R;
public class Hotseat extends FrameLayout {
private static final String TAG = "Hotseat";
- private static final int sAllAppsButtonRank = 2; // In the middle of the dock
private Launcher mLauncher;
private CellLayout mContent;
private int mCellCountX;
private int mCellCountY;
+ private int mAllAppsButtonRank;
private boolean mIsLandscape;
public Hotseat(Context context) {
@@ -53,6 +53,7 @@ public class Hotseat extends FrameLayout {
R.styleable.Hotseat, defStyle, 0);
mCellCountX = a.getInt(R.styleable.Hotseat_cellCountX, -1);
mCellCountY = a.getInt(R.styleable.Hotseat_cellCountY, -1);
+ mAllAppsButtonRank = context.getResources().getInteger(R.integer.hotseat_all_apps_index);
mIsLandscape = context.getResources().getConfiguration().orientation ==
Configuration.ORIENTATION_LANDSCAPE;
}
@@ -77,8 +78,8 @@ public class Hotseat extends FrameLayout {
int getCellYFromOrder(int rank) {
return mIsLandscape ? (mContent.getCountY() - (rank + 1)) : 0;
}
- public static boolean isAllAppsButtonRank(int rank) {
- return rank == sAllAppsButtonRank;
+ public boolean isAllAppsButtonRank(int rank) {
+ return rank == mAllAppsButtonRank;
}
@Override
@@ -88,6 +89,7 @@ public class Hotseat extends FrameLayout {
if (mCellCountY < 0) mCellCountY = LauncherModel.getCellCountY();
mContent = (CellLayout) findViewById(R.id.layout);
mContent.setGridSize(mCellCountX, mCellCountY);
+ mContent.setIsHotseat(true);
resetLayout();
}
@@ -126,9 +128,9 @@ public class Hotseat extends FrameLayout {
// 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
- int x = getCellXFromOrder(sAllAppsButtonRank);
- int y = getCellYFromOrder(sAllAppsButtonRank);
+ int x = getCellXFromOrder(mAllAppsButtonRank);
+ int y = getCellYFromOrder(mAllAppsButtonRank);
mContent.addViewToCellLayout(allAppsButton, -1, 0, new CellLayout.LayoutParams(x,y,1,1),
- true);
+ true, true);
}
}