Loading quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java +1 −2 Original line number Diff line number Diff line Loading @@ -282,8 +282,7 @@ public class AppsDividerView extends View implements StateListener<LauncherState @Override public void setInsets(Rect insets, DeviceProfile grid) { int leftRightPadding = grid.desiredWorkspaceLeftRightMarginPx + grid.cellLayoutPaddingLeftRightPx; int leftRightPadding = grid.allAppsLeftRightPadding; setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom()); } Loading quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +1 −2 Original line number Diff line number Diff line Loading @@ -249,8 +249,7 @@ public class PredictionRowView extends LinearLayout implements @Override public void setInsets(Rect insets, DeviceProfile grid) { int leftRightPadding = grid.desiredWorkspaceLeftRightMarginPx + grid.cellLayoutPaddingLeftRightPx; int leftRightPadding = grid.allAppsLeftRightPadding; setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom()); } Loading res/values/attrs.xml +2 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,8 @@ <attr name="borderSpacingDps" format="float" /> <attr name="allAppsCellSpacingDps" format="float" /> <attr name="iconImageSize" format="float" /> <!-- landscapeIconSize defaults to iconImageSize, if not specified --> <attr name="landscapeIconSize" format="float" /> Loading src/com/android/launcher3/DeviceProfile.java +15 −0 Original line number Diff line number Diff line Loading @@ -168,11 +168,13 @@ public class DeviceProfile { public int qsbBottomMarginPx; // All apps public int allAppsCellSpacingPx; public int allAppsOpenVerticalTranslate; public int allAppsCellHeightPx; public int allAppsCellWidthPx; public int allAppsIconSizePx; public int allAppsIconDrawablePaddingPx; public int allAppsLeftRightPadding; public final int numShownAllAppsColumns; public float allAppsIconTextSizePx; Loading Loading @@ -283,6 +285,7 @@ public class DeviceProfile { folderContentPaddingTop = res.getDimensionPixelSize(R.dimen.folder_content_padding_top); setCellLayoutBorderSpacing(pxFromDp(inv.borderSpacing, mMetrics, 1f)); allAppsCellSpacingPx = pxFromDp(inv.allAppsCellSpacing, mMetrics, 1f); cellLayoutBorderSpacingOriginalPx = cellLayoutBorderSpacingPx; folderCellLayoutBorderSpacingPx = cellLayoutBorderSpacingPx; Loading Loading @@ -547,6 +550,17 @@ public class DeviceProfile { + textHeight + (topBottomPadding * 2); } private void updateAllAppsWidth() { if (isTwoPanels) { int usedWidth = (allAppsCellWidthPx * numShownAllAppsColumns) + (allAppsCellSpacingPx * (numShownAllAppsColumns + 1)); allAppsLeftRightPadding = Math.max(1, (availableWidthPx - usedWidth) / 2); } else { allAppsLeftRightPadding = desiredWorkspaceLeftRightMarginPx + cellLayoutPaddingLeftRightPx; } } /** * Returns the amount of extra (or unused) vertical space. */ Loading Loading @@ -666,6 +680,7 @@ public class DeviceProfile { allAppsCellHeightPx = getCellSize().y; } allAppsCellWidthPx = allAppsIconSizePx + allAppsIconDrawablePaddingPx; updateAllAppsWidth(); if (isVerticalLayout) { hideWorkspaceLabelsIfNotEnoughSpace(); Loading src/com/android/launcher3/InvariantDeviceProfile.java +19 −8 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ public class InvariantDeviceProfile { public float iconTextSize; public float allAppsIconSize; public float allAppsIconTextSize; public float allAppsCellSpacing; public boolean isSplitDisplay; public float minCellHeight; Loading Loading @@ -153,7 +154,8 @@ public class InvariantDeviceProfile { */ public List<DeviceProfile> supportedProfiles = Collections.EMPTY_LIST; @Nullable public DevicePaddings devicePaddings; @Nullable public DevicePaddings devicePaddings; public Point defaultWallpaperSize; public Rect defaultWidgetPadding; Loading @@ -161,7 +163,8 @@ public class InvariantDeviceProfile { private final ArrayList<OnIDPChangeListener> mChangeListeners = new ArrayList<>(); @VisibleForTesting public InvariantDeviceProfile() {} public InvariantDeviceProfile() { } @TargetApi(23) private InvariantDeviceProfile(Context context) { Loading Loading @@ -219,6 +222,7 @@ public class InvariantDeviceProfile { result.minCellHeight = defaultDisplayOption.minCellHeight; result.minCellWidth = defaultDisplayOption.minCellWidth; result.borderSpacing = defaultDisplayOption.borderSpacing; result.allAppsCellSpacing = defaultDisplayOption.allAppsCellSpacing; initGrid(context, myInfo, result, false); } Loading Loading @@ -283,6 +287,7 @@ public class InvariantDeviceProfile { twoPanelLandscapeMinCellHeightDps = displayOption.twoPanelLandscapeMinCellHeightDps; twoPanelLandscapeMinCellWidthDps = displayOption.twoPanelLandscapeMinCellWidthDps; borderSpacing = displayOption.borderSpacing; allAppsCellSpacing = displayOption.allAppsCellSpacing; numShownHotseatIcons = closestProfile.numHotseatIcons; numDatabaseHotseatIcons = isSplitDisplay Loading Loading @@ -607,7 +612,8 @@ public class InvariantDeviceProfile { // (10/16)x + y = 1.2 // We solve for x and y and end up with a final formula: final float x = (WALLPAPER_WIDTH_TO_SCREEN_RATIO_LANDSCAPE - WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT) / (WALLPAPER_WIDTH_TO_SCREEN_RATIO_LANDSCAPE - WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT) / (ASPECT_RATIO_LANDSCAPE - ASPECT_RATIO_PORTRAIT); final float y = WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT - x * ASPECT_RATIO_PORTRAIT; return x * aspectRatio + y; Loading Loading @@ -719,6 +725,7 @@ public class InvariantDeviceProfile { private float twoPanelPortraitMinCellWidthDps; private float twoPanelLandscapeMinCellHeightDps; private float twoPanelLandscapeMinCellWidthDps; private float allAppsCellSpacing; private float borderSpacing; private final float[] iconSizes = new float[COUNT_TOTAL]; Loading Loading @@ -750,6 +757,8 @@ public class InvariantDeviceProfile { R.styleable.ProfileDisplayOption_twoPanelLandscapeMinCellWidthDps, twoPanelPortraitMinCellWidthDps); borderSpacing = a.getFloat(R.styleable.ProfileDisplayOption_borderSpacingDps, 0); allAppsCellSpacing = a.getFloat(R.styleable.ProfileDisplayOption_allAppsCellSpacingDps, borderSpacing); iconSizes[INDEX_DEFAULT] = a.getFloat(R.styleable.ProfileDisplayOption_iconImageSize, 0); Loading Loading @@ -810,6 +819,7 @@ public class InvariantDeviceProfile { twoPanelLandscapeMinCellHeightDps *= w; twoPanelLandscapeMinCellWidthDps *= w; borderSpacing *= w; allAppsCellSpacing *= w; return this; } Loading @@ -825,6 +835,7 @@ public class InvariantDeviceProfile { twoPanelLandscapeMinCellHeightDps += p.twoPanelLandscapeMinCellHeightDps; twoPanelLandscapeMinCellWidthDps += p.twoPanelLandscapeMinCellWidthDps; borderSpacing += p.borderSpacing; allAppsCellSpacing += p.allAppsCellSpacing; return this; } } Loading Loading
quickstep/src/com/android/launcher3/appprediction/AppsDividerView.java +1 −2 Original line number Diff line number Diff line Loading @@ -282,8 +282,7 @@ public class AppsDividerView extends View implements StateListener<LauncherState @Override public void setInsets(Rect insets, DeviceProfile grid) { int leftRightPadding = grid.desiredWorkspaceLeftRightMarginPx + grid.cellLayoutPaddingLeftRightPx; int leftRightPadding = grid.allAppsLeftRightPadding; setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom()); } Loading
quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +1 −2 Original line number Diff line number Diff line Loading @@ -249,8 +249,7 @@ public class PredictionRowView extends LinearLayout implements @Override public void setInsets(Rect insets, DeviceProfile grid) { int leftRightPadding = grid.desiredWorkspaceLeftRightMarginPx + grid.cellLayoutPaddingLeftRightPx; int leftRightPadding = grid.allAppsLeftRightPadding; setPadding(leftRightPadding, getPaddingTop(), leftRightPadding, getPaddingBottom()); } Loading
res/values/attrs.xml +2 −0 Original line number Diff line number Diff line Loading @@ -193,6 +193,8 @@ <attr name="borderSpacingDps" format="float" /> <attr name="allAppsCellSpacingDps" format="float" /> <attr name="iconImageSize" format="float" /> <!-- landscapeIconSize defaults to iconImageSize, if not specified --> <attr name="landscapeIconSize" format="float" /> Loading
src/com/android/launcher3/DeviceProfile.java +15 −0 Original line number Diff line number Diff line Loading @@ -168,11 +168,13 @@ public class DeviceProfile { public int qsbBottomMarginPx; // All apps public int allAppsCellSpacingPx; public int allAppsOpenVerticalTranslate; public int allAppsCellHeightPx; public int allAppsCellWidthPx; public int allAppsIconSizePx; public int allAppsIconDrawablePaddingPx; public int allAppsLeftRightPadding; public final int numShownAllAppsColumns; public float allAppsIconTextSizePx; Loading Loading @@ -283,6 +285,7 @@ public class DeviceProfile { folderContentPaddingTop = res.getDimensionPixelSize(R.dimen.folder_content_padding_top); setCellLayoutBorderSpacing(pxFromDp(inv.borderSpacing, mMetrics, 1f)); allAppsCellSpacingPx = pxFromDp(inv.allAppsCellSpacing, mMetrics, 1f); cellLayoutBorderSpacingOriginalPx = cellLayoutBorderSpacingPx; folderCellLayoutBorderSpacingPx = cellLayoutBorderSpacingPx; Loading Loading @@ -547,6 +550,17 @@ public class DeviceProfile { + textHeight + (topBottomPadding * 2); } private void updateAllAppsWidth() { if (isTwoPanels) { int usedWidth = (allAppsCellWidthPx * numShownAllAppsColumns) + (allAppsCellSpacingPx * (numShownAllAppsColumns + 1)); allAppsLeftRightPadding = Math.max(1, (availableWidthPx - usedWidth) / 2); } else { allAppsLeftRightPadding = desiredWorkspaceLeftRightMarginPx + cellLayoutPaddingLeftRightPx; } } /** * Returns the amount of extra (or unused) vertical space. */ Loading Loading @@ -666,6 +680,7 @@ public class DeviceProfile { allAppsCellHeightPx = getCellSize().y; } allAppsCellWidthPx = allAppsIconSizePx + allAppsIconDrawablePaddingPx; updateAllAppsWidth(); if (isVerticalLayout) { hideWorkspaceLabelsIfNotEnoughSpace(); Loading
src/com/android/launcher3/InvariantDeviceProfile.java +19 −8 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ public class InvariantDeviceProfile { public float iconTextSize; public float allAppsIconSize; public float allAppsIconTextSize; public float allAppsCellSpacing; public boolean isSplitDisplay; public float minCellHeight; Loading Loading @@ -153,7 +154,8 @@ public class InvariantDeviceProfile { */ public List<DeviceProfile> supportedProfiles = Collections.EMPTY_LIST; @Nullable public DevicePaddings devicePaddings; @Nullable public DevicePaddings devicePaddings; public Point defaultWallpaperSize; public Rect defaultWidgetPadding; Loading @@ -161,7 +163,8 @@ public class InvariantDeviceProfile { private final ArrayList<OnIDPChangeListener> mChangeListeners = new ArrayList<>(); @VisibleForTesting public InvariantDeviceProfile() {} public InvariantDeviceProfile() { } @TargetApi(23) private InvariantDeviceProfile(Context context) { Loading Loading @@ -219,6 +222,7 @@ public class InvariantDeviceProfile { result.minCellHeight = defaultDisplayOption.minCellHeight; result.minCellWidth = defaultDisplayOption.minCellWidth; result.borderSpacing = defaultDisplayOption.borderSpacing; result.allAppsCellSpacing = defaultDisplayOption.allAppsCellSpacing; initGrid(context, myInfo, result, false); } Loading Loading @@ -283,6 +287,7 @@ public class InvariantDeviceProfile { twoPanelLandscapeMinCellHeightDps = displayOption.twoPanelLandscapeMinCellHeightDps; twoPanelLandscapeMinCellWidthDps = displayOption.twoPanelLandscapeMinCellWidthDps; borderSpacing = displayOption.borderSpacing; allAppsCellSpacing = displayOption.allAppsCellSpacing; numShownHotseatIcons = closestProfile.numHotseatIcons; numDatabaseHotseatIcons = isSplitDisplay Loading Loading @@ -607,7 +612,8 @@ public class InvariantDeviceProfile { // (10/16)x + y = 1.2 // We solve for x and y and end up with a final formula: final float x = (WALLPAPER_WIDTH_TO_SCREEN_RATIO_LANDSCAPE - WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT) / (WALLPAPER_WIDTH_TO_SCREEN_RATIO_LANDSCAPE - WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT) / (ASPECT_RATIO_LANDSCAPE - ASPECT_RATIO_PORTRAIT); final float y = WALLPAPER_WIDTH_TO_SCREEN_RATIO_PORTRAIT - x * ASPECT_RATIO_PORTRAIT; return x * aspectRatio + y; Loading Loading @@ -719,6 +725,7 @@ public class InvariantDeviceProfile { private float twoPanelPortraitMinCellWidthDps; private float twoPanelLandscapeMinCellHeightDps; private float twoPanelLandscapeMinCellWidthDps; private float allAppsCellSpacing; private float borderSpacing; private final float[] iconSizes = new float[COUNT_TOTAL]; Loading Loading @@ -750,6 +757,8 @@ public class InvariantDeviceProfile { R.styleable.ProfileDisplayOption_twoPanelLandscapeMinCellWidthDps, twoPanelPortraitMinCellWidthDps); borderSpacing = a.getFloat(R.styleable.ProfileDisplayOption_borderSpacingDps, 0); allAppsCellSpacing = a.getFloat(R.styleable.ProfileDisplayOption_allAppsCellSpacingDps, borderSpacing); iconSizes[INDEX_DEFAULT] = a.getFloat(R.styleable.ProfileDisplayOption_iconImageSize, 0); Loading Loading @@ -810,6 +819,7 @@ public class InvariantDeviceProfile { twoPanelLandscapeMinCellHeightDps *= w; twoPanelLandscapeMinCellWidthDps *= w; borderSpacing *= w; allAppsCellSpacing *= w; return this; } Loading @@ -825,6 +835,7 @@ public class InvariantDeviceProfile { twoPanelLandscapeMinCellHeightDps += p.twoPanelLandscapeMinCellHeightDps; twoPanelLandscapeMinCellWidthDps += p.twoPanelLandscapeMinCellWidthDps; borderSpacing += p.borderSpacing; allAppsCellSpacing += p.allAppsCellSpacing; return this; } } Loading