summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-09-13 11:14:45 -0700
committerWinson Chung <winsonc@google.com>2013-09-13 11:40:05 -0700
commit11a1a53651924b544513f1f6971a735b18d67539 (patch)
treeb949b9438dd1b47c01e56574d2dc13fbd9cad7a1 /src/com/android/launcher3/CellLayout.java
parentc639f8cdab11c603e25b5ae38282dddcb939d401 (diff)
downloadandroid_packages_apps_Trebuchet-11a1a53651924b544513f1f6971a735b18d67539.tar.gz
android_packages_apps_Trebuchet-11a1a53651924b544513f1f6971a735b18d67539.tar.bz2
android_packages_apps_Trebuchet-11a1a53651924b544513f1f6971a735b18d67539.zip
Fixing issue with folders not showing up.
- Add long click on empty spaces in hotseat to show overview mode - Limit the height of all apps to the workspace + hotseat size - Fixing some comments Change-Id: Ie5a97a8b04e449385e2b3f6230079aebf8e15d5a
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 682c2ed2e..04f4d8154 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -64,6 +64,8 @@ public class CellLayout extends ViewGroup {
private Launcher mLauncher;
private int mCellWidth;
private int mCellHeight;
+ private int mFixedCellWidth;
+ private int mFixedCellHeight;
private int mCountX;
private int mCountY;
@@ -193,8 +195,8 @@ public class CellLayout extends ViewGroup {
DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.CellLayout, defStyle, 0);
- mCellWidth = -1;
- mCellHeight = -1;
+ mCellWidth = mCellHeight = -1;
+ mFixedCellHeight = mFixedCellHeight = -1;
mWidthGap = mOriginalWidthGap = 0;
mHeightGap = mOriginalHeightGap = 0;
mMaxGap = Integer.MAX_VALUE;
@@ -310,8 +312,8 @@ public class CellLayout extends ViewGroup {
}
public void setCellDimensions(int width, int height) {
- mCellWidth = width;
- mCellHeight = height;
+ mFixedCellWidth = mCellWidth = width;
+ mFixedCellHeight = mCellHeight = height;
mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap, mHeightGap,
mCountX, mCountY);
}
@@ -947,13 +949,15 @@ public class CellLayout extends ViewGroup {
int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec);
int widthSize = MeasureSpec.getSize(widthMeasureSpec);
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
- int cw = grid.calculateCellWidth(widthSize, mCountX);
- int ch = grid.calculateCellHeight(heightSize, mCountY);
- if (cw != mCellWidth || ch != mCellHeight) {
- mCellWidth = cw;
- mCellHeight = ch;
- mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap,
- mHeightGap, mCountX, mCountY);
+ if (mFixedCellWidth < 0 || mFixedCellHeight < 0) {
+ int cw = grid.calculateCellWidth(widthSize, mCountX);
+ int ch = grid.calculateCellHeight(heightSize, mCountY);
+ if (cw != mCellWidth || ch != mCellHeight) {
+ mCellWidth = cw;
+ mCellHeight = ch;
+ mShortcutsAndWidgets.setCellDimensions(mCellWidth, mCellHeight, mWidthGap,
+ mHeightGap, mCountX, mCountY);
+ }
}
int newWidth = widthSize;