Loading quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +11 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,17 @@ public abstract class BaseQuickstepLauncher extends Launcher } } /** * {@code LauncherOverlayCallbacks} scroll amount. * Indicates transition progress to -1 screen. * @param progress From 0 to 1. */ @Override public void onScrollChanged(float progress) { super.onScrollChanged(progress); mDepthController.onOverlayScrollChanged(progress); } @Override public void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) { Loading quickstep/src/com/android/launcher3/statehandlers/DepthController.java +16 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,10 @@ public class DepthController implements StateHandler<LauncherState>, private boolean mCrossWindowBlursEnabled; private WallpaperManagerCompat mWallpaperManager; private SurfaceControl mSurface; /** * How visible the -1 overlay is, from 0 to 1. */ private float mOverlayScrollProgress; /** * Ratio from 0 to 1, where 0 is fully zoomed out, and 1 is zoomed in. * @see android.service.wallpaper.WallpaperService.Engine#onZoomChanged(float) Loading Loading @@ -255,12 +259,24 @@ public class DepthController implements StateHandler<LauncherState>, } } public void onOverlayScrollChanged(float progress) { // Round out the progress to dedupe frequent, non-perceptable updates int progressI = (int) (progress * 256); float progressF = progressI / 256f; if (Float.compare(mOverlayScrollProgress, progressF) == 0) { return; } mOverlayScrollProgress = progressF; dispatchTransactionSurface(mDepth); } private boolean dispatchTransactionSurface(float depth) { boolean supportsBlur = BlurUtils.supportsBlursOnWindows(); if (supportsBlur && (mSurface == null || !mSurface.isValid())) { return false; } ensureDependencies(); depth = Math.max(depth, mOverlayScrollProgress); IBinder windowToken = mLauncher.getRootView().getWindowToken(); if (windowToken != null) { mWallpaperManager.setWallpaperZoomOut(windowToken, depth); Loading src/com/android/launcher3/Launcher.java +12 −8 Original line number Diff line number Diff line Loading @@ -222,7 +222,8 @@ import java.util.stream.Stream; * Default launcher application. */ public class Launcher extends StatefulActivity<LauncherState> implements LauncherExterns, Callbacks, InvariantDeviceProfile.OnIDPChangeListener, PluginListener<OverlayPlugin> { Callbacks, InvariantDeviceProfile.OnIDPChangeListener, PluginListener<OverlayPlugin>, LauncherOverlayCallbacks { public static final String TAG = "Launcher"; public static final ActivityTracker<Launcher> ACTIVITY_TRACKER = new ActivityTracker<>(); Loading Loading @@ -622,7 +623,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche @Override public void setLauncherOverlay(LauncherOverlay overlay) { if (overlay != null) { overlay.setOverlayCallbacks(new LauncherOverlayCallbacksImpl()); overlay.setOverlayCallbacks(this); } mWorkspace.setLauncherOverlay(overlay); } Loading Loading @@ -1126,14 +1127,17 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche mAppWidgetHost.setActivityResumed(false); } class LauncherOverlayCallbacksImpl implements LauncherOverlayCallbacks { /** * {@code LauncherOverlayCallbacks} scroll amount. * Indicates transition progress to -1 screen. * @param progress From 0 to 1. */ @Override public void onScrollChanged(float progress) { if (mWorkspace != null) { mWorkspace.onOverlayScrollChanged(progress); } } } /** * Restores the previous state, if it exists. Loading Loading
quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +11 −0 Original line number Diff line number Diff line Loading @@ -210,6 +210,17 @@ public abstract class BaseQuickstepLauncher extends Launcher } } /** * {@code LauncherOverlayCallbacks} scroll amount. * Indicates transition progress to -1 screen. * @param progress From 0 to 1. */ @Override public void onScrollChanged(float progress) { super.onScrollChanged(progress); mDepthController.onOverlayScrollChanged(progress); } @Override public void startIntentSenderForResult(IntentSender intent, int requestCode, Intent fillInIntent, int flagsMask, int flagsValues, int extraFlags, Bundle options) { Loading
quickstep/src/com/android/launcher3/statehandlers/DepthController.java +16 −0 Original line number Diff line number Diff line Loading @@ -116,6 +116,10 @@ public class DepthController implements StateHandler<LauncherState>, private boolean mCrossWindowBlursEnabled; private WallpaperManagerCompat mWallpaperManager; private SurfaceControl mSurface; /** * How visible the -1 overlay is, from 0 to 1. */ private float mOverlayScrollProgress; /** * Ratio from 0 to 1, where 0 is fully zoomed out, and 1 is zoomed in. * @see android.service.wallpaper.WallpaperService.Engine#onZoomChanged(float) Loading Loading @@ -255,12 +259,24 @@ public class DepthController implements StateHandler<LauncherState>, } } public void onOverlayScrollChanged(float progress) { // Round out the progress to dedupe frequent, non-perceptable updates int progressI = (int) (progress * 256); float progressF = progressI / 256f; if (Float.compare(mOverlayScrollProgress, progressF) == 0) { return; } mOverlayScrollProgress = progressF; dispatchTransactionSurface(mDepth); } private boolean dispatchTransactionSurface(float depth) { boolean supportsBlur = BlurUtils.supportsBlursOnWindows(); if (supportsBlur && (mSurface == null || !mSurface.isValid())) { return false; } ensureDependencies(); depth = Math.max(depth, mOverlayScrollProgress); IBinder windowToken = mLauncher.getRootView().getWindowToken(); if (windowToken != null) { mWallpaperManager.setWallpaperZoomOut(windowToken, depth); Loading
src/com/android/launcher3/Launcher.java +12 −8 Original line number Diff line number Diff line Loading @@ -222,7 +222,8 @@ import java.util.stream.Stream; * Default launcher application. */ public class Launcher extends StatefulActivity<LauncherState> implements LauncherExterns, Callbacks, InvariantDeviceProfile.OnIDPChangeListener, PluginListener<OverlayPlugin> { Callbacks, InvariantDeviceProfile.OnIDPChangeListener, PluginListener<OverlayPlugin>, LauncherOverlayCallbacks { public static final String TAG = "Launcher"; public static final ActivityTracker<Launcher> ACTIVITY_TRACKER = new ActivityTracker<>(); Loading Loading @@ -622,7 +623,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche @Override public void setLauncherOverlay(LauncherOverlay overlay) { if (overlay != null) { overlay.setOverlayCallbacks(new LauncherOverlayCallbacksImpl()); overlay.setOverlayCallbacks(this); } mWorkspace.setLauncherOverlay(overlay); } Loading Loading @@ -1126,14 +1127,17 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche mAppWidgetHost.setActivityResumed(false); } class LauncherOverlayCallbacksImpl implements LauncherOverlayCallbacks { /** * {@code LauncherOverlayCallbacks} scroll amount. * Indicates transition progress to -1 screen. * @param progress From 0 to 1. */ @Override public void onScrollChanged(float progress) { if (mWorkspace != null) { mWorkspace.onOverlayScrollChanged(progress); } } } /** * Restores the previous state, if it exists. Loading