summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedViewWidget.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-05-01 15:10:11 -0700
committerWinson Chung <winsonc@google.com>2012-05-01 16:26:51 -0700
commite3e03bcd313ba8060f2832b6a16dea6fd6d532ea (patch)
treea4cbcbf874b25137eb4b46098dca9bc26aaded80 /src/com/android/launcher2/PagedViewWidget.java
parentd65b23089c90edcf2808ccccf8f918b6155cc2ec (diff)
downloadandroid_packages_apps_Trebuchet-e3e03bcd313ba8060f2832b6a16dea6fd6d532ea.tar.gz
android_packages_apps_Trebuchet-e3e03bcd313ba8060f2832b6a16dea6fd6d532ea.tar.bz2
android_packages_apps_Trebuchet-e3e03bcd313ba8060f2832b6a16dea6fd6d532ea.zip
Fixing issue where widgets larger than the workspace were now bounded when dropped. (Bug 6424463);
Change-Id: I8dcabd084d79697933f873d44bb390f608780c3b
Diffstat (limited to 'src/com/android/launcher2/PagedViewWidget.java')
-rw-r--r--src/com/android/launcher2/PagedViewWidget.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher2/PagedViewWidget.java b/src/com/android/launcher2/PagedViewWidget.java
index 670717e49..774bf1f2c 100644
--- a/src/com/android/launcher2/PagedViewWidget.java
+++ b/src/com/android/launcher2/PagedViewWidget.java
@@ -92,7 +92,9 @@ public class PagedViewWidget extends LinearLayout {
name.setText(info.label);
final TextView dims = (TextView) findViewById(R.id.widget_dims);
if (dims != null) {
- dims.setText(String.format(mDimensionsFormatString, cellSpan[0], cellSpan[1]));
+ int hSpan = Math.min(cellSpan[0], LauncherModel.getCellCountX());
+ int vSpan = Math.min(cellSpan[1], LauncherModel.getCellCountY());
+ dims.setText(String.format(mDimensionsFormatString, hSpan, vSpan));
}
}