diff options
author | Adam Cohen <adamcohen@google.com> | 2011-11-16 12:04:53 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-16 12:04:53 -0800 |
commit | 587ae34aabc03e607c2ec2b37b8709bdf9cc33f0 (patch) | |
tree | e551952aab3cac4ac6157af79e41a2797a5a57c6 /src/com/android | |
parent | b655d545b7a3f33ac84381c77c649ec9b6197ab4 (diff) | |
parent | 78dc83e875fdf541881cfb867ec38bee21d546e9 (diff) | |
download | android_packages_apps_Trebuchet-587ae34aabc03e607c2ec2b37b8709bdf9cc33f0.tar.gz android_packages_apps_Trebuchet-587ae34aabc03e607c2ec2b37b8709bdf9cc33f0.tar.bz2 android_packages_apps_Trebuchet-587ae34aabc03e607c2ec2b37b8709bdf9cc33f0.zip |
Merge "Modifying portals in landscape on the phone UI" into ics-mr1
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher2/Folder.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/launcher2/Folder.java b/src/com/android/launcher2/Folder.java index 33b5de17c..a6757d7f1 100644 --- a/src/com/android/launcher2/Folder.java +++ b/src/com/android/launcher2/Folder.java @@ -83,6 +83,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList private FolderIcon mFolderIcon; private int mMaxCountX; private int mMaxCountY; + private int mMaxNumItems; private Rect mNewSize = new Rect(); private Rect mIconRect = new Rect(); private ArrayList<View> mItemsInReadingOrder = new ArrayList<View>(); @@ -121,13 +122,20 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList setAlwaysDrawnWithCacheEnabled(false); mInflater = LayoutInflater.from(context); mIconCache = ((LauncherApplication)context.getApplicationContext()).getIconCache(); - mMaxCountX = LauncherModel.getCellCountX(); - mMaxCountY = LauncherModel.getCellCountY(); + + Resources res = getResources(); + mMaxCountX = res.getInteger(R.integer.folder_max_count_x); + mMaxCountY = res.getInteger(R.integer.folder_max_count_y); + mMaxNumItems = res.getInteger(R.integer.folder_max_num_items); + if (mMaxCountX < 0 || mMaxCountY < 0 || mMaxNumItems < 0) { + mMaxCountX = LauncherModel.getCellCountX(); + mMaxCountY = LauncherModel.getCellCountY(); + mMaxNumItems = mMaxCountX * mMaxCountY; + } mInputMethodManager = (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE); - Resources res = getResources(); mExpandDuration = res.getInteger(R.integer.config_folderAnimDuration); if (sDefaultFolderName == null) { @@ -746,7 +754,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList int oldCountY = countY; if (countX * countY < count) { // Current grid is too small, expand it - if (countX <= countY && countX < mMaxCountX) { + if ((countX <= countY || countY == mMaxCountY) && countX < mMaxCountX) { countX++; } else if (countY < mMaxCountY) { countY++; @@ -764,7 +772,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList } public boolean isFull() { - return getItemCount() >= mMaxCountX * mMaxCountY; + return getItemCount() >= mMaxNumItems; } private void centerAboutIcon() { |