Support defining X column layout for all apps as a display option.

Bug: 124967099
Change-Id: I7bf576759b3fa4f6ca617fbbd660541c12fd09ac
This commit is contained in:
Jon Miranda
2019-09-16 14:44:14 -07:00
parent 3463d1c5f9
commit 6f7e9702e3
7 changed files with 97 additions and 20 deletions

View File

@@ -180,7 +180,7 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
private final GridLayoutManager mGridLayoutMgr;
private final GridSpanSizer mGridSizer;
private final int mAppsPerRow;
private int mAppsPerRow;
private BindViewCallback mBindViewCallback;
private OnFocusChangeListener mIconFocusListener;
@@ -200,7 +200,11 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
mGridLayoutMgr.setSpanSizeLookup(mGridSizer);
mLayoutInflater = LayoutInflater.from(launcher);
mAppsPerRow = mLauncher.getDeviceProfile().inv.numColumns;
setAppsPerRow(mLauncher.getDeviceProfile().inv.numAllAppsColumns);
}
public void setAppsPerRow(int appsPerRow) {
mAppsPerRow = appsPerRow;
mGridLayoutMgr.setSpanCount(mAppsPerRow);
}