Loading res/values/dimens.xml +29 −23 Original line number Diff line number Diff line Loading @@ -63,6 +63,11 @@ <dimen name="drop_target_top_margin">32dp</dimen> <dimen name="drop_target_bottom_margin">16dp</dimen> <!-- App Widget resize frame --> <!-- Button drop target bar --> <dimen name="button_drop_target_min_text_size">10sp</dimen> <dimen name="button_drop_target_resize_text_increment">1sp</dimen> <!-- App Widget resize frame --> <dimen name="widget_handle_margin">13dp</dimen> <dimen name="resize_frame_background_padding">24dp</dimen> Loading Loading @@ -136,6 +141,7 @@ <dimen name="all_apps_paged_view_top_padding">40dp</dimen> <dimen name="all_apps_personal_work_tabs_vertical_margin">16dp</dimen> <dimen name="all_apps_icon_drawable_padding">8dp</dimen> <!-- The size of corner radius of the arrow in the arrow toast. --> <dimen name="arrow_toast_corner_radius">2dp</dimen> <dimen name="arrow_toast_elevation">2dp</dimen> Loading res/xml/device_profiles.xml +20 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ launcher:minHeightDps="300" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -42,6 +44,8 @@ launcher:minHeightDps="400" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> </grid-option> Loading @@ -63,6 +67,8 @@ launcher:minHeightDps="420" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -71,6 +77,8 @@ launcher:minHeightDps="450" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -79,6 +87,8 @@ launcher:minHeightDps="491.33" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -87,6 +97,8 @@ launcher:minHeightDps="567" launcher:iconImageSize="54" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -95,6 +107,8 @@ launcher:minHeightDps="567" launcher:iconImageSize="54" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> </grid-option> Loading @@ -116,6 +130,8 @@ launcher:minHeightDps="694" launcher:iconImageSize="56" launcher:iconTextSize="14.4" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -124,6 +140,8 @@ launcher:minHeightDps="694" launcher:iconImageSize="56" launcher:iconTextSize="14.4" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -132,6 +150,8 @@ launcher:minHeightDps="400" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> </grid-option> Loading src/com/android/launcher3/DeviceProfile.java +14 −17 Original line number Diff line number Diff line Loading @@ -255,7 +255,6 @@ public class DeviceProfile { mInsets.set(windowBounds.insets); isScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode; // Determine device posture. mInfo = info; isTablet = info.isTablet(windowBounds); Loading Loading @@ -313,7 +312,6 @@ public class DeviceProfile { allAppsShiftRange = isTablet ? heightPx - allAppsTopPadding : res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate); folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale); folderContentPaddingLeftRight = res.getDimensionPixelSize(R.dimen.folder_content_padding_left_right); Loading Loading @@ -795,12 +793,6 @@ public class DeviceProfile { allAppsBorderSpacePx = new Point( pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics, scale), pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics, scale)); if (isScalableGrid) { allAppsIconSizePx = pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics); allAppsIconTextSizePx = pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics); allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx; // AllApps cells don't have real space between cells, // so we add the border space to the cell height allAppsCellHeightPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].y, mMetrics, scale) Loading @@ -808,14 +800,19 @@ public class DeviceProfile { // but width is just the cell, // the border is added in #updateAllAppsContainerWidth allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics, scale); if (isScalableGrid) { allAppsIconSizePx = pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics); allAppsIconTextSizePx = pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics); allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx; } else { float invIconSizeDp = inv.iconSize[mTypeIndex]; float invIconTextSizeSp = inv.iconTextSize[mTypeIndex]; float invIconSizeDp = inv.allAppsIconSize[mTypeIndex]; float invIconTextSizeSp = inv.allAppsIconTextSize[mTypeIndex]; allAppsIconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics, scale)); allAppsIconTextSizePx = (int) (pxFromSp(invIconTextSizeSp, mMetrics) * scale); allAppsIconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale); allAppsCellWidthPx = allAppsIconSizePx + (2 * allAppsIconDrawablePaddingPx); allAppsCellHeightPx = getCellSize().y; allAppsIconDrawablePaddingPx = res.getDimensionPixelSize(R.dimen.all_apps_icon_drawable_padding); } updateAllAppsContainerWidth(res); Loading Loading
res/values/dimens.xml +29 −23 Original line number Diff line number Diff line Loading @@ -63,6 +63,11 @@ <dimen name="drop_target_top_margin">32dp</dimen> <dimen name="drop_target_bottom_margin">16dp</dimen> <!-- App Widget resize frame --> <!-- Button drop target bar --> <dimen name="button_drop_target_min_text_size">10sp</dimen> <dimen name="button_drop_target_resize_text_increment">1sp</dimen> <!-- App Widget resize frame --> <dimen name="widget_handle_margin">13dp</dimen> <dimen name="resize_frame_background_padding">24dp</dimen> Loading Loading @@ -136,6 +141,7 @@ <dimen name="all_apps_paged_view_top_padding">40dp</dimen> <dimen name="all_apps_personal_work_tabs_vertical_margin">16dp</dimen> <dimen name="all_apps_icon_drawable_padding">8dp</dimen> <!-- The size of corner radius of the arrow in the arrow toast. --> <dimen name="arrow_toast_corner_radius">2dp</dimen> <dimen name="arrow_toast_elevation">2dp</dimen> Loading
res/xml/device_profiles.xml +20 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,8 @@ launcher:minHeightDps="300" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -42,6 +44,8 @@ launcher:minHeightDps="400" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> </grid-option> Loading @@ -63,6 +67,8 @@ launcher:minHeightDps="420" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -71,6 +77,8 @@ launcher:minHeightDps="450" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -79,6 +87,8 @@ launcher:minHeightDps="491.33" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -87,6 +97,8 @@ launcher:minHeightDps="567" launcher:iconImageSize="54" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -95,6 +107,8 @@ launcher:minHeightDps="567" launcher:iconImageSize="54" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> </grid-option> Loading @@ -116,6 +130,8 @@ launcher:minHeightDps="694" launcher:iconImageSize="56" launcher:iconTextSize="14.4" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -124,6 +140,8 @@ launcher:minHeightDps="694" launcher:iconImageSize="56" launcher:iconTextSize="14.4" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> <display-option Loading @@ -132,6 +150,8 @@ launcher:minHeightDps="400" launcher:iconImageSize="48" launcher:iconTextSize="13.0" launcher:allAppsBorderSpace="16" launcher:allAppsCellHeight="104" launcher:canBeDefault="true" /> </grid-option> Loading
src/com/android/launcher3/DeviceProfile.java +14 −17 Original line number Diff line number Diff line Loading @@ -255,7 +255,6 @@ public class DeviceProfile { mInsets.set(windowBounds.insets); isScalableGrid = inv.isScalable && !isVerticalBarLayout() && !isMultiWindowMode; // Determine device posture. mInfo = info; isTablet = info.isTablet(windowBounds); Loading Loading @@ -313,7 +312,6 @@ public class DeviceProfile { allAppsShiftRange = isTablet ? heightPx - allAppsTopPadding : res.getDimensionPixelSize(R.dimen.all_apps_starting_vertical_translate); folderLabelTextScale = res.getFloat(R.dimen.folder_label_text_scale); folderContentPaddingLeftRight = res.getDimensionPixelSize(R.dimen.folder_content_padding_left_right); Loading Loading @@ -795,12 +793,6 @@ public class DeviceProfile { allAppsBorderSpacePx = new Point( pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].x, mMetrics, scale), pxFromDp(inv.allAppsBorderSpaces[mTypeIndex].y, mMetrics, scale)); if (isScalableGrid) { allAppsIconSizePx = pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics); allAppsIconTextSizePx = pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics); allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx; // AllApps cells don't have real space between cells, // so we add the border space to the cell height allAppsCellHeightPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].y, mMetrics, scale) Loading @@ -808,14 +800,19 @@ public class DeviceProfile { // but width is just the cell, // the border is added in #updateAllAppsContainerWidth allAppsCellWidthPx = pxFromDp(inv.allAppsCellSize[mTypeIndex].x, mMetrics, scale); if (isScalableGrid) { allAppsIconSizePx = pxFromDp(inv.allAppsIconSize[mTypeIndex], mMetrics); allAppsIconTextSizePx = pxFromSp(inv.allAppsIconTextSize[mTypeIndex], mMetrics); allAppsIconDrawablePaddingPx = iconDrawablePaddingOriginalPx; } else { float invIconSizeDp = inv.iconSize[mTypeIndex]; float invIconTextSizeSp = inv.iconTextSize[mTypeIndex]; float invIconSizeDp = inv.allAppsIconSize[mTypeIndex]; float invIconTextSizeSp = inv.allAppsIconTextSize[mTypeIndex]; allAppsIconSizePx = Math.max(1, pxFromDp(invIconSizeDp, mMetrics, scale)); allAppsIconTextSizePx = (int) (pxFromSp(invIconTextSizeSp, mMetrics) * scale); allAppsIconDrawablePaddingPx = (int) (iconDrawablePaddingOriginalPx * scale); allAppsCellWidthPx = allAppsIconSizePx + (2 * allAppsIconDrawablePaddingPx); allAppsCellHeightPx = getCellSize().y; allAppsIconDrawablePaddingPx = res.getDimensionPixelSize(R.dimen.all_apps_icon_drawable_padding); } updateAllAppsContainerWidth(res); Loading