Loading quickstep/src/com/android/launcher3/uioverrides/BackgroundAppState.java +2 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ public class BackgroundAppState extends OverviewState { if (launcher.getDeviceProfile().isVerticalBarLayout()) { return super.getVerticalProgress(launcher); } int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher.getDeviceProfile()); int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher, launcher.getDeviceProfile()); AllAppsTransitionController controller = launcher.getAllAppsController(); float scrollRange = Math.max(controller.getShiftRange(), 1); float progressDelta = (transitionLength / scrollRange); Loading quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java +2 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,8 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr mCurrentAnimation = AnimatorPlaybackController.wrap(mPendingAnimation.anim, maxAccuracy, onCancelRunnable); mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation); totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher.getDeviceProfile()); totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher, mLauncher.getDeviceProfile()); } else { mCurrentAnimation = mLauncher.getStateManager() .createAnimationToNewWorkspace(mToState, builder, maxAccuracy, this::clearState, Loading quickstep/src/com/android/quickstep/ActivityControlHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right; return dp.hotseatBarSizePx + hotseatInset; } else { return LayoutUtils.getShelfTrackingDistance(dp); return LayoutUtils.getShelfTrackingDistance(context, dp); } } Loading quickstep/src/com/android/quickstep/util/LayoutUtils.java +12 −4 Original line number Diff line number Diff line Loading @@ -21,14 +21,15 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Rect; import androidx.annotation.AnyThread; import androidx.annotation.IntDef; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.config.FeatureFlags; import java.lang.annotation.Retention; import androidx.annotation.AnyThread; import androidx.annotation.IntDef; public class LayoutUtils { private static final int MULTI_WINDOW_STRATEGY_HALF_SCREEN = 1; Loading Loading @@ -112,7 +113,14 @@ public class LayoutUtils { Math.round(x + outWidth), Math.round(y + outHeight)); } public static int getShelfTrackingDistance(DeviceProfile dp) { public static int getShelfTrackingDistance(Context context, DeviceProfile dp) { if (FeatureFlags.SWIPE_HOME.get()) { // Track the bottom of the window rather than the top of the shelf. int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom; int spaceBetweenShelfAndRecents = (int) context.getResources().getDimension( R.dimen.task_card_vert_space); return shelfHeight + spaceBetweenShelfAndRecents; } // Start from a third of bottom inset to provide some shelf overlap. return dp.hotseatBarSizePx + dp.getInsets().bottom / 3 - dp.edgeMarginPx * 2; } Loading src/com/android/launcher3/config/BaseFlags.java +4 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ abstract class BaseFlags { public static final TogglableFlag ENABLE_QUICKSTEP_LIVE_TILE = new TogglableFlag( "ENABLE_QUICKSTEP_LIVE_TILE", false, "Enable live tile in Quickstep overview"); public static final ToggleableGlobalSettingsFlag SWIPE_HOME = new ToggleableGlobalSettingsFlag("SWIPE_HOME", false, "[WIP] Swiping up on the nav bar goes home. Swipe and hold goes to recent apps."); public static void initialize(Context context) { // Avoid the disk read for user builds if (Utilities.IS_DEBUG_DEVICE) { Loading Loading
quickstep/src/com/android/launcher3/uioverrides/BackgroundAppState.java +2 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,8 @@ public class BackgroundAppState extends OverviewState { if (launcher.getDeviceProfile().isVerticalBarLayout()) { return super.getVerticalProgress(launcher); } int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher.getDeviceProfile()); int transitionLength = LayoutUtils.getShelfTrackingDistance(launcher, launcher.getDeviceProfile()); AllAppsTransitionController controller = launcher.getAllAppsController(); float scrollRange = Math.max(controller.getShiftRange(), 1); float progressDelta = (transitionLength / scrollRange); Loading
quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java +2 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,8 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr mCurrentAnimation = AnimatorPlaybackController.wrap(mPendingAnimation.anim, maxAccuracy, onCancelRunnable); mLauncher.getStateManager().setCurrentUserControlledAnimation(mCurrentAnimation); totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher.getDeviceProfile()); totalShift = LayoutUtils.getShelfTrackingDistance(mLauncher, mLauncher.getDeviceProfile()); } else { mCurrentAnimation = mLauncher.getStateManager() .createAnimationToNewWorkspace(mToState, builder, maxAccuracy, this::clearState, Loading
quickstep/src/com/android/quickstep/ActivityControlHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -216,7 +216,7 @@ public interface ActivityControlHelper<T extends BaseDraggingActivity> { int hotseatInset = dp.isSeascape() ? targetInsets.left : targetInsets.right; return dp.hotseatBarSizePx + hotseatInset; } else { return LayoutUtils.getShelfTrackingDistance(dp); return LayoutUtils.getShelfTrackingDistance(context, dp); } } Loading
quickstep/src/com/android/quickstep/util/LayoutUtils.java +12 −4 Original line number Diff line number Diff line Loading @@ -21,14 +21,15 @@ import android.content.Context; import android.content.res.Resources; import android.graphics.Rect; import androidx.annotation.AnyThread; import androidx.annotation.IntDef; import com.android.launcher3.DeviceProfile; import com.android.launcher3.R; import com.android.launcher3.config.FeatureFlags; import java.lang.annotation.Retention; import androidx.annotation.AnyThread; import androidx.annotation.IntDef; public class LayoutUtils { private static final int MULTI_WINDOW_STRATEGY_HALF_SCREEN = 1; Loading Loading @@ -112,7 +113,14 @@ public class LayoutUtils { Math.round(x + outWidth), Math.round(y + outHeight)); } public static int getShelfTrackingDistance(DeviceProfile dp) { public static int getShelfTrackingDistance(Context context, DeviceProfile dp) { if (FeatureFlags.SWIPE_HOME.get()) { // Track the bottom of the window rather than the top of the shelf. int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom; int spaceBetweenShelfAndRecents = (int) context.getResources().getDimension( R.dimen.task_card_vert_space); return shelfHeight + spaceBetweenShelfAndRecents; } // Start from a third of bottom inset to provide some shelf overlap. return dp.hotseatBarSizePx + dp.getInsets().bottom / 3 - dp.edgeMarginPx * 2; } Loading
src/com/android/launcher3/config/BaseFlags.java +4 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,10 @@ abstract class BaseFlags { public static final TogglableFlag ENABLE_QUICKSTEP_LIVE_TILE = new TogglableFlag( "ENABLE_QUICKSTEP_LIVE_TILE", false, "Enable live tile in Quickstep overview"); public static final ToggleableGlobalSettingsFlag SWIPE_HOME = new ToggleableGlobalSettingsFlag("SWIPE_HOME", false, "[WIP] Swiping up on the nav bar goes home. Swipe and hold goes to recent apps."); public static void initialize(Context context) { // Avoid the disk read for user builds if (Utilities.IS_DEBUG_DEVICE) { Loading