Set proper height of the widget tray container for preloading.
- previous height value was 0 before, now set it to proper height.
However, getExtraLayoutSpace still worked because the super method set
extra space (1 screen worth) only when ScrollState is non idle.
Change-Id: Ifbaa6a105fe392735e106996d1f08276e678ebcb
diff --git a/src/com/android/launcher3/widget/WidgetsContainerView.java b/src/com/android/launcher3/widget/WidgetsContainerView.java
index f8d7d92..00fb225 100644
--- a/src/com/android/launcher3/widget/WidgetsContainerView.java
+++ b/src/com/android/launcher3/widget/WidgetsContainerView.java
@@ -33,6 +33,7 @@
import com.android.launcher3.BaseContainerView;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeleteDropTarget;
+import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DragController;
import com.android.launcher3.DragSource;
import com.android.launcher3.DropTarget.DragObject;
@@ -122,8 +123,9 @@
mView.setLayoutManager(new LinearLayoutManager(getContext()) {
@Override
protected int getExtraLayoutSpace(State state) {
+ DeviceProfile grid = LauncherAppState.getInstance().getDynamicGrid().getDeviceProfile();
return super.getExtraLayoutSpace(state)
- + WidgetsContainerView.this.getHeight() * PRELOAD_SCREEN_HEIGHT_MULTIPLE;
+ + grid.availableHeightPx * PRELOAD_SCREEN_HEIGHT_MULTIPLE;
}
});
mPadding.set(getPaddingLeft(), getPaddingTop(), getPaddingRight(),