diff options
author | Daniel Sandler <dsandler@android.com> | 2013-06-25 15:13:26 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2013-06-27 15:17:11 -0400 |
commit | e4f9891f01bdc10d8f96e4e2429e2f4d0558238b (patch) | |
tree | 3de05f7433f52bfcade535ab4aa5176675588d56 /src/com/android/launcher3/PagedViewCellLayout.java | |
parent | fe7750b5d6cb76a3aa7b1b479e4cc243653fa0c1 (diff) | |
download | android_packages_apps_Trebuchet-e4f9891f01bdc10d8f96e4e2429e2f4d0558238b.tar.gz android_packages_apps_Trebuchet-e4f9891f01bdc10d8f96e4e2429e2f4d0558238b.tar.bz2 android_packages_apps_Trebuchet-e4f9891f01bdc10d8f96e4e2429e2f4d0558238b.zip |
Lazily instantiate LauncherAppState.
The application context for LauncherAppState is supplied by
the application whenever it starts; don't ask for an
instance before that.
Change-Id: I1ca8ea04238a357a682f79250f08813ead7ae532
Diffstat (limited to 'src/com/android/launcher3/PagedViewCellLayout.java')
-rw-r--r-- | src/com/android/launcher3/PagedViewCellLayout.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/com/android/launcher3/PagedViewCellLayout.java b/src/com/android/launcher3/PagedViewCellLayout.java index 423b1cfec..9aa246793 100644 --- a/src/com/android/launcher3/PagedViewCellLayout.java +++ b/src/com/android/launcher3/PagedViewCellLayout.java @@ -24,8 +24,6 @@ import android.view.View; import android.view.ViewDebug; import android.view.ViewGroup; -import com.android.launcher3.R; - /** * An abstraction of the original CellLayout which supports laying out items * which span multiple cells into a grid-like layout. Also supports dimming @@ -459,8 +457,9 @@ public class PagedViewCellLayout extends ViewGroup implements Page { this.cellVSpan = cellVSpan; } - public void setup(int cellWidth, int cellHeight, int widthGap, int heightGap, - int hStartPadding, int vStartPadding) { + public void setup(Context context, + int cellWidth, int cellHeight, int widthGap, int heightGap, + int hStartPadding, int vStartPadding) { final int myCellHSpan = cellHSpan; final int myCellVSpan = cellVSpan; @@ -472,7 +471,7 @@ public class PagedViewCellLayout extends ViewGroup implements Page { height = myCellVSpan * cellHeight + ((myCellVSpan - 1) * heightGap) - topMargin - bottomMargin; - if (LauncherAppState.isScreenLarge()) { + if (LauncherAppState.getInstance().isScreenLarge()) { x = hStartPadding + myCellX * (cellWidth + widthGap) + leftMargin; y = vStartPadding + myCellY * (cellHeight + heightGap) + topMargin; } else { |