summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/AppsContainerRecyclerView.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/AppsContainerRecyclerView.java')
-rw-r--r--src/com/android/launcher3/AppsContainerRecyclerView.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher3/AppsContainerRecyclerView.java b/src/com/android/launcher3/AppsContainerRecyclerView.java
index 31942b36d..109be7e02 100644
--- a/src/com/android/launcher3/AppsContainerRecyclerView.java
+++ b/src/com/android/launcher3/AppsContainerRecyclerView.java
@@ -80,6 +80,8 @@ public class AppsContainerRecyclerView extends BaseContainerRecyclerView {
private Rect mBackgroundPadding = new Rect();
private ScrollPositionState mScrollPosState = new ScrollPositionState();
+ private Launcher mLauncher;
+
public AppsContainerRecyclerView(Context context) {
this(context, null);
}
@@ -96,6 +98,7 @@ public class AppsContainerRecyclerView extends BaseContainerRecyclerView {
int defStyleRes) {
super(context, attrs, defStyleAttr);
+ mLauncher = (Launcher) context;
Resources res = context.getResources();
int fastScrollerSize = res.getDimensionPixelSize(R.dimen.apps_view_fast_scroll_popup_size);
mScrollbar = res.getDrawable(R.drawable.apps_list_scrollbar_thumb);
@@ -129,7 +132,7 @@ public class AppsContainerRecyclerView extends BaseContainerRecyclerView {
mNumAppsPerRow = numAppsPerRow;
mNumPredictedAppsPerRow = numPredictedAppsPerRow;
- DeviceProfile grid = LauncherAppState.getInstance().getDynamicGrid().getDeviceProfile();
+ DeviceProfile grid = mLauncher.getDeviceProfile();
RecyclerView.RecycledViewPool pool = getRecycledViewPool();
int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx);
pool.setMaxRecycledViews(AppsGridAdapter.PREDICTION_BAR_SPACER_TYPE, 1);