Loading res/values/dimens.xml +1 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ <resources> <!-- Dynamic Grid --> <dimen name="dynamic_grid_edge_margin">16dp</dimen> <dimen name="dynamic_grid_edge_margin">8dp</dimen> <dimen name="dynamic_grid_min_page_indicator_size">32dp</dimen> <dimen name="dynamic_grid_page_indicator_line_height">1dp</dimen> <dimen name="dynamic_grid_page_indicator_gutter_width">50dp</dimen> Loading @@ -30,7 +30,6 @@ <!-- Minimum space between workspace and hotseat in spring loaded mode --> <dimen name="dynamic_grid_min_spring_loaded_space">8dp</dimen> <!-- dynamic_grid_edge_margin / 2 --> <dimen name="dynamic_grid_cell_padding_x">8dp</dimen> <!-- Hotseat --> Loading src/com/android/launcher3/CellLayout.java +4 −4 Original line number Diff line number Diff line Loading @@ -860,10 +860,10 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { // Expand the background drawing bounds by the padding baked into the background drawable mBackground.getPadding(mTempRect); mBackground.setBounds( left - mTempRect.left, top - mTempRect.top, right + mTempRect.right, bottom + mTempRect.bottom); left - mTempRect.left - getPaddingLeft(), top - mTempRect.top - getPaddingTop(), right + mTempRect.right + getPaddingRight(), bottom + mTempRect.bottom + getPaddingBottom()); } /** Loading src/com/android/launcher3/DeviceProfile.java +8 −5 Original line number Diff line number Diff line Loading @@ -71,7 +71,8 @@ public class DeviceProfile { private final float overviewModeIconZoneRatio; // Workspace private int desiredWorkspaceLeftRightMarginPx; private final int desiredWorkspaceLeftRightMarginPx; public final int cellLayoutPaddingLeftRightPx; public final int edgeMarginPx; public final Rect defaultWidgetPadding; private final int defaultPageSpacingPx; Loading Loading @@ -171,7 +172,8 @@ public class DeviceProfile { this.getClass().getName()); defaultWidgetPadding = AppWidgetHostView.getDefaultPaddingForWidget(context, cn, null); edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin); desiredWorkspaceLeftRightMarginPx = edgeMarginPx; desiredWorkspaceLeftRightMarginPx = isVerticalBarLayout() ? 0 : edgeMarginPx; cellLayoutPaddingLeftRightPx = isVerticalBarLayout() ? 0 : edgeMarginPx; pageIndicatorSizePx = res.getDimensionPixelSize( R.dimen.dynamic_grid_min_page_indicator_size); pageIndicatorLandGutterPx = res.getDimensionPixelSize( Loading Loading @@ -513,7 +515,7 @@ public class DeviceProfile { // In portrait, we want the pages spaced such that there is no // overhang of the previous / next page into the current page viewport. // We assume symmetrical padding in portrait mode. return Math.max(defaultPageSpacingPx, getWorkspacePadding(null).left / 2 + 1); return Math.max(defaultPageSpacingPx, getWorkspacePadding(null).left + 1); } } Loading Loading @@ -564,7 +566,7 @@ public class DeviceProfile { lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams(); lp.width = searchBarBounds.x; lp.height = searchBarBounds.y; lp.topMargin = mInsets.top + edgeMarginPx / 2; lp.topMargin = mInsets.top + edgeMarginPx; searchBar.setLayoutParams(lp); // Layout the workspace Loading Loading @@ -615,6 +617,7 @@ public class DeviceProfile { hotseatBarTopPaddingPx, hotseatAdjustment + workspacePadding.right, hotseatBarBottomPaddingPx + mInsets.bottom); } hotseat.setPadding(cellLayoutPaddingLeftRightPx, 0, cellLayoutPaddingLeftRightPx, 0); hotseat.setLayoutParams(lp); // Layout the page indicators Loading Loading @@ -652,7 +655,7 @@ public class DeviceProfile { // Layout the AllAppsRecyclerView View view = launcher.findViewById(R.id.apps_list_view); int paddingLeftRight = hasVerticalBarLayout ? 0 : edgeMarginPx; int paddingLeftRight = desiredWorkspaceLeftRightMarginPx + cellLayoutPaddingLeftRightPx; view.setPadding(paddingLeftRight, view.getPaddingTop(), paddingLeftRight, view.getPaddingBottom()); Loading src/com/android/launcher3/Workspace.java +4 −0 Original line number Diff line number Diff line Loading @@ -666,6 +666,10 @@ public class Workspace extends PagedView newScreen.setOnLongClickListener(mLongClickListener); newScreen.setOnClickListener(mLauncher); newScreen.setSoundEffectsEnabled(false); int paddingLeftRight = mLauncher.getDeviceProfile().cellLayoutPaddingLeftRightPx; newScreen.setPadding(paddingLeftRight, 0, paddingLeftRight, 0); mWorkspaceScreens.put(screenId, newScreen); mScreenOrder.add(insertIndex, screenId); addView(newScreen, insertIndex); Loading Loading
res/values/dimens.xml +1 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ <resources> <!-- Dynamic Grid --> <dimen name="dynamic_grid_edge_margin">16dp</dimen> <dimen name="dynamic_grid_edge_margin">8dp</dimen> <dimen name="dynamic_grid_min_page_indicator_size">32dp</dimen> <dimen name="dynamic_grid_page_indicator_line_height">1dp</dimen> <dimen name="dynamic_grid_page_indicator_gutter_width">50dp</dimen> Loading @@ -30,7 +30,6 @@ <!-- Minimum space between workspace and hotseat in spring loaded mode --> <dimen name="dynamic_grid_min_spring_loaded_space">8dp</dimen> <!-- dynamic_grid_edge_margin / 2 --> <dimen name="dynamic_grid_cell_padding_x">8dp</dimen> <!-- Hotseat --> Loading
src/com/android/launcher3/CellLayout.java +4 −4 Original line number Diff line number Diff line Loading @@ -860,10 +860,10 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { // Expand the background drawing bounds by the padding baked into the background drawable mBackground.getPadding(mTempRect); mBackground.setBounds( left - mTempRect.left, top - mTempRect.top, right + mTempRect.right, bottom + mTempRect.bottom); left - mTempRect.left - getPaddingLeft(), top - mTempRect.top - getPaddingTop(), right + mTempRect.right + getPaddingRight(), bottom + mTempRect.bottom + getPaddingBottom()); } /** Loading
src/com/android/launcher3/DeviceProfile.java +8 −5 Original line number Diff line number Diff line Loading @@ -71,7 +71,8 @@ public class DeviceProfile { private final float overviewModeIconZoneRatio; // Workspace private int desiredWorkspaceLeftRightMarginPx; private final int desiredWorkspaceLeftRightMarginPx; public final int cellLayoutPaddingLeftRightPx; public final int edgeMarginPx; public final Rect defaultWidgetPadding; private final int defaultPageSpacingPx; Loading Loading @@ -171,7 +172,8 @@ public class DeviceProfile { this.getClass().getName()); defaultWidgetPadding = AppWidgetHostView.getDefaultPaddingForWidget(context, cn, null); edgeMarginPx = res.getDimensionPixelSize(R.dimen.dynamic_grid_edge_margin); desiredWorkspaceLeftRightMarginPx = edgeMarginPx; desiredWorkspaceLeftRightMarginPx = isVerticalBarLayout() ? 0 : edgeMarginPx; cellLayoutPaddingLeftRightPx = isVerticalBarLayout() ? 0 : edgeMarginPx; pageIndicatorSizePx = res.getDimensionPixelSize( R.dimen.dynamic_grid_min_page_indicator_size); pageIndicatorLandGutterPx = res.getDimensionPixelSize( Loading Loading @@ -513,7 +515,7 @@ public class DeviceProfile { // In portrait, we want the pages spaced such that there is no // overhang of the previous / next page into the current page viewport. // We assume symmetrical padding in portrait mode. return Math.max(defaultPageSpacingPx, getWorkspacePadding(null).left / 2 + 1); return Math.max(defaultPageSpacingPx, getWorkspacePadding(null).left + 1); } } Loading Loading @@ -564,7 +566,7 @@ public class DeviceProfile { lp = (FrameLayout.LayoutParams) searchBar.getLayoutParams(); lp.width = searchBarBounds.x; lp.height = searchBarBounds.y; lp.topMargin = mInsets.top + edgeMarginPx / 2; lp.topMargin = mInsets.top + edgeMarginPx; searchBar.setLayoutParams(lp); // Layout the workspace Loading Loading @@ -615,6 +617,7 @@ public class DeviceProfile { hotseatBarTopPaddingPx, hotseatAdjustment + workspacePadding.right, hotseatBarBottomPaddingPx + mInsets.bottom); } hotseat.setPadding(cellLayoutPaddingLeftRightPx, 0, cellLayoutPaddingLeftRightPx, 0); hotseat.setLayoutParams(lp); // Layout the page indicators Loading Loading @@ -652,7 +655,7 @@ public class DeviceProfile { // Layout the AllAppsRecyclerView View view = launcher.findViewById(R.id.apps_list_view); int paddingLeftRight = hasVerticalBarLayout ? 0 : edgeMarginPx; int paddingLeftRight = desiredWorkspaceLeftRightMarginPx + cellLayoutPaddingLeftRightPx; view.setPadding(paddingLeftRight, view.getPaddingTop(), paddingLeftRight, view.getPaddingBottom()); Loading
src/com/android/launcher3/Workspace.java +4 −0 Original line number Diff line number Diff line Loading @@ -666,6 +666,10 @@ public class Workspace extends PagedView newScreen.setOnLongClickListener(mLongClickListener); newScreen.setOnClickListener(mLauncher); newScreen.setSoundEffectsEnabled(false); int paddingLeftRight = mLauncher.getDeviceProfile().cellLayoutPaddingLeftRightPx; newScreen.setPadding(paddingLeftRight, 0, paddingLeftRight, 0); mWorkspaceScreens.put(screenId, newScreen); mScreenOrder.add(insertIndex, screenId); addView(newScreen, insertIndex); Loading