Loading quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +1 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public abstract class BaseQuickstepLauncher extends Launcher super.onCreate(savedInstanceState); SysUINavigationMode.INSTANCE.get(this).addModeChangeListener(this); addMultiWindowModeChangedListener(mDepthController); } @Override Loading quickstep/src/com/android/launcher3/statehandlers/DepthController.java +29 −3 Original line number Diff line number Diff line Loading @@ -20,11 +20,15 @@ import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.os.IBinder; import android.util.FloatProperty; import android.view.View; import android.view.ViewTreeObserver; import com.android.launcher3.BaseActivity; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; Loading @@ -41,7 +45,8 @@ import com.android.systemui.shared.system.WallpaperManagerCompat; /** * Controls blur and wallpaper zoom, for the Launcher surface only. */ public class DepthController implements StateHandler<LauncherState> { public class DepthController implements StateHandler<LauncherState>, BaseActivity.MultiWindowModeChangedListener { public static final FloatProperty<DepthController> DEPTH = new FloatProperty<DepthController>("depth") { Loading Loading @@ -104,6 +109,9 @@ public class DepthController implements StateHandler<LauncherState> { */ private float mDepth; // Workaround for animating the depth when multiwindow mode changes. private boolean mIgnoreStateChangesDuringMultiWindowAnimation = false; private View.OnAttachStateChangeListener mOnAttachListener; public DepthController(Launcher l) { Loading Loading @@ -171,7 +179,7 @@ public class DepthController implements StateHandler<LauncherState> { @Override public void setState(LauncherState toState) { if (mSurface == null) { if (mSurface == null || mIgnoreStateChangesDuringMultiWindowAnimation) { return; } Loading @@ -186,7 +194,8 @@ public class DepthController implements StateHandler<LauncherState> { PendingAnimation animation) { if (mSurface == null || config.onlyPlayAtomicComponent() || config.hasAnimationFlag(SKIP_DEPTH_CONTROLLER)) { || config.hasAnimationFlag(SKIP_DEPTH_CONTROLLER) || mIgnoreStateChangesDuringMultiWindowAnimation) { return; } Loading Loading @@ -231,4 +240,21 @@ public class DepthController implements StateHandler<LauncherState> { .apply(); } } @Override public void onMultiWindowModeChanged(boolean isInMultiWindowMode) { mIgnoreStateChangesDuringMultiWindowAnimation = true; ObjectAnimator mwAnimation = ObjectAnimator.ofFloat(this, DEPTH, mLauncher.getStateManager().getState().getDepth(mLauncher, isInMultiWindowMode)) .setDuration(300); mwAnimation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mIgnoreStateChangesDuringMultiWindowAnimation = false; } }); mwAnimation.setAutoCancel(true); mwAnimation.start(); } } src/com/android/launcher3/LauncherState.java +10 −1 Original line number Diff line number Diff line Loading @@ -226,7 +226,16 @@ public abstract class LauncherState implements BaseState<LauncherState> { * 0 means completely zoomed in, without blurs. 1 is zoomed out, with blurs. */ public final float getDepth(Context context) { if (BaseDraggingActivity.fromContext(context).getDeviceProfile().isMultiWindowMode) { return getDepth(context, BaseDraggingActivity.fromContext(context).getDeviceProfile().isMultiWindowMode); } /** * Returns the amount of blur and wallpaper zoom for this state with {@param isMultiWindowMode}. * @see #getDepth(Context). */ public final float getDepth(Context context, boolean isMultiWindowMode) { if (isMultiWindowMode) { return 0; } return getDepthUnchecked(context); Loading Loading
quickstep/src/com/android/launcher3/BaseQuickstepLauncher.java +1 −0 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ public abstract class BaseQuickstepLauncher extends Launcher super.onCreate(savedInstanceState); SysUINavigationMode.INSTANCE.get(this).addModeChangeListener(this); addMultiWindowModeChangedListener(mDepthController); } @Override Loading
quickstep/src/com/android/launcher3/statehandlers/DepthController.java +29 −3 Original line number Diff line number Diff line Loading @@ -20,11 +20,15 @@ import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.states.StateAnimationConfig.ANIM_DEPTH; import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.os.IBinder; import android.util.FloatProperty; import android.view.View; import android.view.ViewTreeObserver; import com.android.launcher3.BaseActivity; import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.R; Loading @@ -41,7 +45,8 @@ import com.android.systemui.shared.system.WallpaperManagerCompat; /** * Controls blur and wallpaper zoom, for the Launcher surface only. */ public class DepthController implements StateHandler<LauncherState> { public class DepthController implements StateHandler<LauncherState>, BaseActivity.MultiWindowModeChangedListener { public static final FloatProperty<DepthController> DEPTH = new FloatProperty<DepthController>("depth") { Loading Loading @@ -104,6 +109,9 @@ public class DepthController implements StateHandler<LauncherState> { */ private float mDepth; // Workaround for animating the depth when multiwindow mode changes. private boolean mIgnoreStateChangesDuringMultiWindowAnimation = false; private View.OnAttachStateChangeListener mOnAttachListener; public DepthController(Launcher l) { Loading Loading @@ -171,7 +179,7 @@ public class DepthController implements StateHandler<LauncherState> { @Override public void setState(LauncherState toState) { if (mSurface == null) { if (mSurface == null || mIgnoreStateChangesDuringMultiWindowAnimation) { return; } Loading @@ -186,7 +194,8 @@ public class DepthController implements StateHandler<LauncherState> { PendingAnimation animation) { if (mSurface == null || config.onlyPlayAtomicComponent() || config.hasAnimationFlag(SKIP_DEPTH_CONTROLLER)) { || config.hasAnimationFlag(SKIP_DEPTH_CONTROLLER) || mIgnoreStateChangesDuringMultiWindowAnimation) { return; } Loading Loading @@ -231,4 +240,21 @@ public class DepthController implements StateHandler<LauncherState> { .apply(); } } @Override public void onMultiWindowModeChanged(boolean isInMultiWindowMode) { mIgnoreStateChangesDuringMultiWindowAnimation = true; ObjectAnimator mwAnimation = ObjectAnimator.ofFloat(this, DEPTH, mLauncher.getStateManager().getState().getDepth(mLauncher, isInMultiWindowMode)) .setDuration(300); mwAnimation.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { mIgnoreStateChangesDuringMultiWindowAnimation = false; } }); mwAnimation.setAutoCancel(true); mwAnimation.start(); } }
src/com/android/launcher3/LauncherState.java +10 −1 Original line number Diff line number Diff line Loading @@ -226,7 +226,16 @@ public abstract class LauncherState implements BaseState<LauncherState> { * 0 means completely zoomed in, without blurs. 1 is zoomed out, with blurs. */ public final float getDepth(Context context) { if (BaseDraggingActivity.fromContext(context).getDeviceProfile().isMultiWindowMode) { return getDepth(context, BaseDraggingActivity.fromContext(context).getDeviceProfile().isMultiWindowMode); } /** * Returns the amount of blur and wallpaper zoom for this state with {@param isMultiWindowMode}. * @see #getDepth(Context). */ public final float getDepth(Context context, boolean isMultiWindowMode) { if (isMultiWindowMode) { return 0; } return getDepthUnchecked(context); Loading