summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/PagedViewWidget.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2013-08-22 16:15:50 -0700
committerWinson Chung <winsonc@google.com>2013-08-23 12:13:02 -0700
commit892c74d460ad98c6306420e1127c9aa3e505ba25 (patch)
tree5abbb89efdad34335ef876284d520f6c7a705e3f /src/com/android/launcher3/PagedViewWidget.java
parentfe14e04987a8baf77f0ffbd6d66839f33a4f0474 (diff)
downloadandroid_packages_apps_Trebuchet-892c74d460ad98c6306420e1127c9aa3e505ba25.tar.gz
android_packages_apps_Trebuchet-892c74d460ad98c6306420e1127c9aa3e505ba25.tar.bz2
android_packages_apps_Trebuchet-892c74d460ad98c6306420e1127c9aa3e505ba25.zip
Fixing folders to always show in view, removing old assets and references to LauncherModel count.
Diffstat (limited to 'src/com/android/launcher3/PagedViewWidget.java')
-rw-r--r--src/com/android/launcher3/PagedViewWidget.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/launcher3/PagedViewWidget.java b/src/com/android/launcher3/PagedViewWidget.java
index bd40c5cf5..220a9f75f 100644
--- a/src/com/android/launcher3/PagedViewWidget.java
+++ b/src/com/android/launcher3/PagedViewWidget.java
@@ -106,6 +106,9 @@ public class PagedViewWidget extends LinearLayout {
public void applyFromAppWidgetProviderInfo(AppWidgetProviderInfo info,
int maxWidth, int[] cellSpan, WidgetPreviewLoader loader) {
+ LauncherAppState app = LauncherAppState.getInstance();
+ DeviceProfile grid = app.getDynamicGrid().getDeviceProfile();
+
mIsAppWidget = true;
mInfo = info;
final ImageView image = (ImageView) findViewById(R.id.widget_preview);
@@ -116,8 +119,8 @@ public class PagedViewWidget extends LinearLayout {
name.setText(info.label);
final TextView dims = (TextView) findViewById(R.id.widget_dims);
if (dims != null) {
- int hSpan = Math.min(cellSpan[0], LauncherModel.getCellCountX());
- int vSpan = Math.min(cellSpan[1], LauncherModel.getCellCountY());
+ int hSpan = Math.min(cellSpan[0], (int) grid.numColumns);
+ int vSpan = Math.min(cellSpan[1], (int) grid.numRows);
dims.setText(String.format(mDimensionsFormatString, hSpan, vSpan));
}
mWidgetPreviewLoader = loader;