Loading packages/SystemUI/res/values-sw600dp-land/dimens.xml +4 −0 Original line number Diff line number Diff line Loading @@ -42,4 +42,8 @@ the shade (in alpha) --> <dimen name="lockscreen_shade_scrim_transition_distance">200dp</dimen> <!-- Distance that the full shade transition takes in order for media to fully transition to the shade --> <dimen name="lockscreen_shade_media_transition_distance">200dp</dimen> </resources> packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt +16 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,9 @@ class MediaHierarchyManager @Inject constructor( @TransformationType fun calculateTransformationType(): Int { if (isTransitioningToFullShade) { if (inSplitShade) { return TRANSFORMATION_TYPE_TRANSITION } return TRANSFORMATION_TYPE_FADE } if (previousLocation == LOCATION_LOCKSCREEN && desiredLocation == LOCATION_QS || Loading Loading @@ -961,6 +964,7 @@ class MediaHierarchyManager @Inject constructor( (qsExpansion > 0.0f || inSplitShade) && !onLockscreen -> LOCATION_QS qsExpansion > 0.4f && onLockscreen -> LOCATION_QS !hasActiveMedia -> LOCATION_QS onLockscreen && isSplitShadeExpanding() -> LOCATION_QS onLockscreen && isTransformingToFullShadeAndInQQS() -> LOCATION_QQS onLockscreen && allowedOnLockscreen -> LOCATION_LOCKSCREEN else -> LOCATION_QQS Loading @@ -986,6 +990,10 @@ class MediaHierarchyManager @Inject constructor( return location } private fun isSplitShadeExpanding(): Boolean { return inSplitShade && isTransitioningToFullShade } /** * Are we currently transforming to the full shade and already in QQS */ Loading @@ -993,6 +1001,10 @@ class MediaHierarchyManager @Inject constructor( if (!isTransitioningToFullShade) { return false } if (inSplitShade) { // Split shade doesn't use QQS. return false } return fullShadeTransitionProgress > 0.5f } Loading @@ -1000,6 +1012,10 @@ class MediaHierarchyManager @Inject constructor( * Is the current transformationType fading */ private fun isCurrentlyFading(): Boolean { if (isSplitShadeExpanding()) { // Split shade always uses transition instead of fade. return false } if (isTransitioningToFullShade) { return true } Loading packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +3 −1 Original line number Diff line number Diff line Loading @@ -513,7 +513,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca mContainer.setExpansion(expansion); final float translationScaleY = (mInSplitShade ? 1 : QSAnimator.SHORT_PARALLAX_AMOUNT) * (expansion - 1); boolean onKeyguardAndExpanded = isKeyguardState() && !mShowCollapsedOnKeyguard; boolean onKeyguard = isKeyguardState(); boolean onKeyguardAndExpanded = onKeyguard && !mShowCollapsedOnKeyguard; if (!mHeaderAnimating && !headerWillBeAnimating()) { getView().setTranslationY( onKeyguardAndExpanded Loading Loading @@ -547,6 +548,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca mHeader.updateResources(); } } mQSPanelController.setIsOnKeyguard(onKeyguard); mFooter.setExpansion(onKeyguardAndExpanded ? 1 : expansion); mQSFooterActionController.setExpansion(onKeyguardAndExpanded ? 1 : expansion); mQSPanelController.setRevealExpansion(expansion); Loading packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +24 −2 Original line number Diff line number Diff line Loading @@ -110,6 +110,8 @@ public class QSPanel extends LinearLayout implements Tunable { private final ArrayMap<View, Integer> mChildrenLayoutTop = new ArrayMap<>(); private final Rect mClippingRect = new Rect(); private boolean mUseNewFooter = false; private ViewGroup mMediaHostView; private boolean mShouldMoveMediaOnExpansion = true; public QSPanel(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -289,9 +291,15 @@ public class QSPanel extends LinearLayout implements Tunable { for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (move) { int topOffset; if (child == mMediaHostView && !mShouldMoveMediaOnExpansion) { topOffset = 0; } else { topOffset = tileHeightOffset; } int top = Objects.requireNonNull(mChildrenLayoutTop.get(child)); child.setLeftTopRightBottom(child.getLeft(), top + tileHeightOffset, child.getRight(), top + tileHeightOffset + child.getHeight()); child.setLeftTopRightBottom(child.getLeft(), top + topOffset, child.getRight(), top + topOffset + child.getHeight()); } if (child == mTileLayout) { move = true; Loading Loading @@ -463,6 +471,7 @@ public class QSPanel extends LinearLayout implements Tunable { if (!mUsingMediaPlayer) { return; } mMediaHostView = hostView; ViewGroup newParent = horizontal ? mHorizontalLinearLayout : this; ViewGroup currentParent = (ViewGroup) hostView.getParent(); if (currentParent != newParent) { Loading Loading @@ -656,6 +665,19 @@ public class QSPanel extends LinearLayout implements Tunable { updatePadding(); } /** * Sets whether the media container should move during the expansion of the QS Panel. * * As the QS Panel expands and the QS unsquish, the views below the QS tiles move to adapt to * the new height of the QS tiles. * * In some cases this might not be wanted for media. One example is when there is a transition * animation of the media container happening on split shade lock screen. */ public void setShouldMoveMediaOnExpansion(boolean shouldMoveMediaOnExpansion) { mShouldMoveMediaOnExpansion = shouldMoveMediaOnExpansion; } private class H extends Handler { private static final int ANNOUNCE_FOR_ACCESSIBILITY = 1; Loading packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java +10 −0 Original line number Diff line number Diff line Loading @@ -419,6 +419,16 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr return mView.getBrightnessView(); } /** Sets whether we are currently on lock screen. */ public void setIsOnKeyguard(boolean isOnKeyguard) { boolean isOnSplitShadeLockscreen = mShouldUseSplitNotificationShade && isOnKeyguard; // When the split shade is expanding on lockscreen, the media container transitions from the // lockscreen to QS. // We have to prevent the media container position from moving during the transition to have // a smooth translation animation without stuttering. mView.setShouldMoveMediaOnExpansion(!isOnSplitShadeLockscreen); } /** */ public static final class TileRecord { public TileRecord(QSTile tile, com.android.systemui.plugins.qs.QSTileView tileView) { Loading Loading
packages/SystemUI/res/values-sw600dp-land/dimens.xml +4 −0 Original line number Diff line number Diff line Loading @@ -42,4 +42,8 @@ the shade (in alpha) --> <dimen name="lockscreen_shade_scrim_transition_distance">200dp</dimen> <!-- Distance that the full shade transition takes in order for media to fully transition to the shade --> <dimen name="lockscreen_shade_media_transition_distance">200dp</dimen> </resources>
packages/SystemUI/src/com/android/systemui/media/MediaHierarchyManager.kt +16 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,9 @@ class MediaHierarchyManager @Inject constructor( @TransformationType fun calculateTransformationType(): Int { if (isTransitioningToFullShade) { if (inSplitShade) { return TRANSFORMATION_TYPE_TRANSITION } return TRANSFORMATION_TYPE_FADE } if (previousLocation == LOCATION_LOCKSCREEN && desiredLocation == LOCATION_QS || Loading Loading @@ -961,6 +964,7 @@ class MediaHierarchyManager @Inject constructor( (qsExpansion > 0.0f || inSplitShade) && !onLockscreen -> LOCATION_QS qsExpansion > 0.4f && onLockscreen -> LOCATION_QS !hasActiveMedia -> LOCATION_QS onLockscreen && isSplitShadeExpanding() -> LOCATION_QS onLockscreen && isTransformingToFullShadeAndInQQS() -> LOCATION_QQS onLockscreen && allowedOnLockscreen -> LOCATION_LOCKSCREEN else -> LOCATION_QQS Loading @@ -986,6 +990,10 @@ class MediaHierarchyManager @Inject constructor( return location } private fun isSplitShadeExpanding(): Boolean { return inSplitShade && isTransitioningToFullShade } /** * Are we currently transforming to the full shade and already in QQS */ Loading @@ -993,6 +1001,10 @@ class MediaHierarchyManager @Inject constructor( if (!isTransitioningToFullShade) { return false } if (inSplitShade) { // Split shade doesn't use QQS. return false } return fullShadeTransitionProgress > 0.5f } Loading @@ -1000,6 +1012,10 @@ class MediaHierarchyManager @Inject constructor( * Is the current transformationType fading */ private fun isCurrentlyFading(): Boolean { if (isSplitShadeExpanding()) { // Split shade always uses transition instead of fade. return false } if (isTransitioningToFullShade) { return true } Loading
packages/SystemUI/src/com/android/systemui/qs/QSFragment.java +3 −1 Original line number Diff line number Diff line Loading @@ -513,7 +513,8 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca mContainer.setExpansion(expansion); final float translationScaleY = (mInSplitShade ? 1 : QSAnimator.SHORT_PARALLAX_AMOUNT) * (expansion - 1); boolean onKeyguardAndExpanded = isKeyguardState() && !mShowCollapsedOnKeyguard; boolean onKeyguard = isKeyguardState(); boolean onKeyguardAndExpanded = onKeyguard && !mShowCollapsedOnKeyguard; if (!mHeaderAnimating && !headerWillBeAnimating()) { getView().setTranslationY( onKeyguardAndExpanded Loading Loading @@ -547,6 +548,7 @@ public class QSFragment extends LifecycleFragment implements QS, CommandQueue.Ca mHeader.updateResources(); } } mQSPanelController.setIsOnKeyguard(onKeyguard); mFooter.setExpansion(onKeyguardAndExpanded ? 1 : expansion); mQSFooterActionController.setExpansion(onKeyguardAndExpanded ? 1 : expansion); mQSPanelController.setRevealExpansion(expansion); Loading
packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +24 −2 Original line number Diff line number Diff line Loading @@ -110,6 +110,8 @@ public class QSPanel extends LinearLayout implements Tunable { private final ArrayMap<View, Integer> mChildrenLayoutTop = new ArrayMap<>(); private final Rect mClippingRect = new Rect(); private boolean mUseNewFooter = false; private ViewGroup mMediaHostView; private boolean mShouldMoveMediaOnExpansion = true; public QSPanel(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -289,9 +291,15 @@ public class QSPanel extends LinearLayout implements Tunable { for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); if (move) { int topOffset; if (child == mMediaHostView && !mShouldMoveMediaOnExpansion) { topOffset = 0; } else { topOffset = tileHeightOffset; } int top = Objects.requireNonNull(mChildrenLayoutTop.get(child)); child.setLeftTopRightBottom(child.getLeft(), top + tileHeightOffset, child.getRight(), top + tileHeightOffset + child.getHeight()); child.setLeftTopRightBottom(child.getLeft(), top + topOffset, child.getRight(), top + topOffset + child.getHeight()); } if (child == mTileLayout) { move = true; Loading Loading @@ -463,6 +471,7 @@ public class QSPanel extends LinearLayout implements Tunable { if (!mUsingMediaPlayer) { return; } mMediaHostView = hostView; ViewGroup newParent = horizontal ? mHorizontalLinearLayout : this; ViewGroup currentParent = (ViewGroup) hostView.getParent(); if (currentParent != newParent) { Loading Loading @@ -656,6 +665,19 @@ public class QSPanel extends LinearLayout implements Tunable { updatePadding(); } /** * Sets whether the media container should move during the expansion of the QS Panel. * * As the QS Panel expands and the QS unsquish, the views below the QS tiles move to adapt to * the new height of the QS tiles. * * In some cases this might not be wanted for media. One example is when there is a transition * animation of the media container happening on split shade lock screen. */ public void setShouldMoveMediaOnExpansion(boolean shouldMoveMediaOnExpansion) { mShouldMoveMediaOnExpansion = shouldMoveMediaOnExpansion; } private class H extends Handler { private static final int ANNOUNCE_FOR_ACCESSIBILITY = 1; Loading
packages/SystemUI/src/com/android/systemui/qs/QSPanelControllerBase.java +10 −0 Original line number Diff line number Diff line Loading @@ -419,6 +419,16 @@ public abstract class QSPanelControllerBase<T extends QSPanel> extends ViewContr return mView.getBrightnessView(); } /** Sets whether we are currently on lock screen. */ public void setIsOnKeyguard(boolean isOnKeyguard) { boolean isOnSplitShadeLockscreen = mShouldUseSplitNotificationShade && isOnKeyguard; // When the split shade is expanding on lockscreen, the media container transitions from the // lockscreen to QS. // We have to prevent the media container position from moving during the transition to have // a smooth translation animation without stuttering. mView.setShouldMoveMediaOnExpansion(!isOnSplitShadeLockscreen); } /** */ public static final class TileRecord { public TileRecord(QSTile tile, com.android.systemui.plugins.qs.QSTileView tileView) { Loading