Loading quickstep/src/com/android/quickstep/TouchInteractionService.java +1 −2 Original line number Diff line number Diff line Loading @@ -564,8 +564,7 @@ public class TouchInteractionService extends Service implements PluginListener<O } else { mUncheckedConsumer = InputConsumer.NO_OP; } } else if (mDeviceState.canTriggerOneHandedAction(event) && !mDeviceState.isOneHandedModeActive()) { } else if (mDeviceState.canTriggerOneHandedAction(event)) { // Consume gesture event for triggering one handed feature. mUncheckedConsumer = new OneHandedModeInputConsumer(this, mDeviceState, InputConsumer.NO_OP, mInputMonitorCompat); Loading src/com/android/launcher3/DeviceProfile.java +10 −5 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; import static com.android.launcher3.ResourceUtils.pxFromDp; import static com.android.launcher3.Utilities.dpiFromPx; import static com.android.launcher3.Utilities.pxFromSp; import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR; import static com.android.launcher3.util.WindowManagerCompat.MIN_TABLET_WIDTH; import android.annotation.SuppressLint; Loading Loading @@ -394,7 +395,8 @@ public class DeviceProfile { } private void updateHotseatIconSize(int hotseatIconSizePx) { hotseatCellHeightPx = hotseatIconSizePx; // Ensure there is enough space for folder icons, which have a slightly larger radius. hotseatCellHeightPx = (int) Math.ceil(hotseatIconSizePx * ICON_OVERLAP_FACTOR); if (isVerticalBarLayout()) { hotseatBarSizePx = hotseatIconSizePx + hotseatBarSidePaddingStartPx + hotseatBarSidePaddingEndPx; Loading Loading @@ -473,7 +475,7 @@ public class DeviceProfile { if (workspaceCellPaddingY < iconTextHeight) { iconTextSizePx = 0; iconDrawablePaddingPx = 0; cellHeightPx = iconSizePx; cellHeightPx = (int) Math.ceil(iconSizePx * ICON_OVERLAP_FACTOR); autoResizeAllAppsCells(); } } Loading Loading @@ -560,7 +562,8 @@ public class DeviceProfile { desiredWorkspaceLeftRightMarginPx = (int) (desiredWorkspaceLeftRightOriginalPx * scale); } else { cellWidthPx = iconSizePx + iconDrawablePaddingPx; cellHeightPx = iconSizePx + iconDrawablePaddingPx cellHeightPx = (int) Math.ceil(iconSizePx * ICON_OVERLAP_FACTOR) + iconDrawablePaddingPx + Utilities.calculateTextHeight(iconTextSizePx); int cellPaddingY = (getCellSize().y - cellHeightPx) / 2; if (iconDrawablePaddingPx > cellPaddingY && !isVerticalLayout Loading Loading @@ -844,14 +847,16 @@ public class DeviceProfile { return isVerticalBarLayout(); } public int getCellHeight(@ContainerType int containerType) { public int getCellContentHeight(@ContainerType int containerType) { switch (containerType) { case CellLayout.WORKSPACE: return cellHeightPx; case CellLayout.FOLDER: return folderCellHeightPx; case CellLayout.HOTSEAT: return hotseatCellHeightPx; // The hotseat is the only container where the cell height is going to be // different from the content within that cell. return iconSizePx; default: // ?? return 0; Loading src/com/android/launcher3/Hotseat.java +2 −2 Original line number Diff line number Diff line Loading @@ -207,8 +207,8 @@ public class Hotseat extends CellLayout implements Insettable { ? dp.workspacePadding.bottom : dp.hotseatBarSizePx - dp.hotseatCellHeightPx - mQsbHeight; if (dp.isScalableGrid && dp.qsbBottomMarginPx <= freeSpace) { return dp.qsbBottomMarginPx; if (dp.isScalableGrid) { return Math.min(dp.qsbBottomMarginPx, freeSpace); } else { return (int) (freeSpace * QSB_CENTER_FACTOR) + (dp.isTaskbarPresent ? dp.taskbarSize Loading src/com/android/launcher3/ShortcutAndWidgetContainer.java +1 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ public class ShortcutAndWidgetContainer extends ViewGroup implements FolderIcon. public int getCellContentHeight() { return Math.min(getMeasuredHeight(), mActivity.getDeviceProfile().getCellHeight(mContainerType)); mActivity.getDeviceProfile().getCellContentHeight(mContainerType)); } public void measureChild(View child) { Loading src/com/android/launcher3/dragndrop/FolderAdaptiveIcon.java +11 −2 Original line number Diff line number Diff line Loading @@ -21,11 +21,11 @@ import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import android.annotation.TargetApi; import android.graphics.Bitmap; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.AdaptiveIconDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Build; import android.util.Log; Loading Loading @@ -129,10 +129,19 @@ public class FolderAdaptiveIcon extends AdaptiveIconDrawable { canvas.restore(); }); Bitmap bgBitmap = BitmapRenderer.createHardwareBitmap(dragViewSize.x, dragViewSize.y, (canvas) -> { Paint p = new Paint(); p.setColor(bg.getBgColor()); canvas.drawCircle(dragViewSize.x / 2f, dragViewSize.y / 2f, bg.getRadius(), p); }); ShiftedBitmapDrawable badge = new ShiftedBitmapDrawable(badgeBmp, 0, 0); ShiftedBitmapDrawable foreground = new ShiftedBitmapDrawable(previewBitmap, 0, 0); ShiftedBitmapDrawable background = new ShiftedBitmapDrawable(bgBitmap, 0, 0); return new FolderAdaptiveIcon(new ColorDrawable(bg.getBgColor()), foreground, badge, mask); return new FolderAdaptiveIcon(background, foreground, badge, mask); } @Override Loading Loading
quickstep/src/com/android/quickstep/TouchInteractionService.java +1 −2 Original line number Diff line number Diff line Loading @@ -564,8 +564,7 @@ public class TouchInteractionService extends Service implements PluginListener<O } else { mUncheckedConsumer = InputConsumer.NO_OP; } } else if (mDeviceState.canTriggerOneHandedAction(event) && !mDeviceState.isOneHandedModeActive()) { } else if (mDeviceState.canTriggerOneHandedAction(event)) { // Consume gesture event for triggering one handed feature. mUncheckedConsumer = new OneHandedModeInputConsumer(this, mDeviceState, InputConsumer.NO_OP, mInputMonitorCompat); Loading
src/com/android/launcher3/DeviceProfile.java +10 −5 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION; import static com.android.launcher3.ResourceUtils.pxFromDp; import static com.android.launcher3.Utilities.dpiFromPx; import static com.android.launcher3.Utilities.pxFromSp; import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.ICON_OVERLAP_FACTOR; import static com.android.launcher3.util.WindowManagerCompat.MIN_TABLET_WIDTH; import android.annotation.SuppressLint; Loading Loading @@ -394,7 +395,8 @@ public class DeviceProfile { } private void updateHotseatIconSize(int hotseatIconSizePx) { hotseatCellHeightPx = hotseatIconSizePx; // Ensure there is enough space for folder icons, which have a slightly larger radius. hotseatCellHeightPx = (int) Math.ceil(hotseatIconSizePx * ICON_OVERLAP_FACTOR); if (isVerticalBarLayout()) { hotseatBarSizePx = hotseatIconSizePx + hotseatBarSidePaddingStartPx + hotseatBarSidePaddingEndPx; Loading Loading @@ -473,7 +475,7 @@ public class DeviceProfile { if (workspaceCellPaddingY < iconTextHeight) { iconTextSizePx = 0; iconDrawablePaddingPx = 0; cellHeightPx = iconSizePx; cellHeightPx = (int) Math.ceil(iconSizePx * ICON_OVERLAP_FACTOR); autoResizeAllAppsCells(); } } Loading Loading @@ -560,7 +562,8 @@ public class DeviceProfile { desiredWorkspaceLeftRightMarginPx = (int) (desiredWorkspaceLeftRightOriginalPx * scale); } else { cellWidthPx = iconSizePx + iconDrawablePaddingPx; cellHeightPx = iconSizePx + iconDrawablePaddingPx cellHeightPx = (int) Math.ceil(iconSizePx * ICON_OVERLAP_FACTOR) + iconDrawablePaddingPx + Utilities.calculateTextHeight(iconTextSizePx); int cellPaddingY = (getCellSize().y - cellHeightPx) / 2; if (iconDrawablePaddingPx > cellPaddingY && !isVerticalLayout Loading Loading @@ -844,14 +847,16 @@ public class DeviceProfile { return isVerticalBarLayout(); } public int getCellHeight(@ContainerType int containerType) { public int getCellContentHeight(@ContainerType int containerType) { switch (containerType) { case CellLayout.WORKSPACE: return cellHeightPx; case CellLayout.FOLDER: return folderCellHeightPx; case CellLayout.HOTSEAT: return hotseatCellHeightPx; // The hotseat is the only container where the cell height is going to be // different from the content within that cell. return iconSizePx; default: // ?? return 0; Loading
src/com/android/launcher3/Hotseat.java +2 −2 Original line number Diff line number Diff line Loading @@ -207,8 +207,8 @@ public class Hotseat extends CellLayout implements Insettable { ? dp.workspacePadding.bottom : dp.hotseatBarSizePx - dp.hotseatCellHeightPx - mQsbHeight; if (dp.isScalableGrid && dp.qsbBottomMarginPx <= freeSpace) { return dp.qsbBottomMarginPx; if (dp.isScalableGrid) { return Math.min(dp.qsbBottomMarginPx, freeSpace); } else { return (int) (freeSpace * QSB_CENTER_FACTOR) + (dp.isTaskbarPresent ? dp.taskbarSize Loading
src/com/android/launcher3/ShortcutAndWidgetContainer.java +1 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,7 @@ public class ShortcutAndWidgetContainer extends ViewGroup implements FolderIcon. public int getCellContentHeight() { return Math.min(getMeasuredHeight(), mActivity.getDeviceProfile().getCellHeight(mContainerType)); mActivity.getDeviceProfile().getCellContentHeight(mContainerType)); } public void measureChild(View child) { Loading
src/com/android/launcher3/dragndrop/FolderAdaptiveIcon.java +11 −2 Original line number Diff line number Diff line Loading @@ -21,11 +21,11 @@ import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import android.annotation.TargetApi; import android.graphics.Bitmap; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Path; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.AdaptiveIconDrawable; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.os.Build; import android.util.Log; Loading Loading @@ -129,10 +129,19 @@ public class FolderAdaptiveIcon extends AdaptiveIconDrawable { canvas.restore(); }); Bitmap bgBitmap = BitmapRenderer.createHardwareBitmap(dragViewSize.x, dragViewSize.y, (canvas) -> { Paint p = new Paint(); p.setColor(bg.getBgColor()); canvas.drawCircle(dragViewSize.x / 2f, dragViewSize.y / 2f, bg.getRadius(), p); }); ShiftedBitmapDrawable badge = new ShiftedBitmapDrawable(badgeBmp, 0, 0); ShiftedBitmapDrawable foreground = new ShiftedBitmapDrawable(previewBitmap, 0, 0); ShiftedBitmapDrawable background = new ShiftedBitmapDrawable(bgBitmap, 0, 0); return new FolderAdaptiveIcon(new ColorDrawable(bg.getBgColor()), foreground, badge, mask); return new FolderAdaptiveIcon(background, foreground, badge, mask); } @Override Loading