Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +11 −5 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ public class NotificationShelf extends ActivatableNotificationView implements } ExpandableNotificationRow row = (ExpandableNotificationRow) child; float notificationClipEnd; boolean aboveShelf = row.getTranslationZ() > baseZHeight; boolean aboveShelf = ViewState.getFinalTranslationZ(row) > baseZHeight; boolean isLastChild = child == lastChild; float rowTranslationY = row.getTranslationY(); if (isLastChild || aboveShelf || backgroundForceHidden) { Loading Loading @@ -284,10 +284,15 @@ public class NotificationShelf extends ActivatableNotificationView implements private void updateNotificationClipHeight(ExpandableNotificationRow row, float notificationClipEnd) { float viewEnd = row.getTranslationY() + row.getActualHeight(); boolean isPinned = row.isPinned() || row.isHeadsUpAnimatingAway(); if (viewEnd > notificationClipEnd && (mAmbientState.isShadeExpanded() || (!row.isPinned() && !row.isHeadsUpAnimatingAway()))) { row.setClipBottomAmount((int) (viewEnd - notificationClipEnd)); && (mAmbientState.isShadeExpanded() || !isPinned)) { int clipBottomAmount = (int) (viewEnd - notificationClipEnd); if (isPinned) { clipBottomAmount = Math.min(row.getIntrinsicHeight() - row.getCollapsedHeight(), clipBottomAmount); } row.setClipBottomAmount(clipBottomAmount); } else { row.setClipBottomAmount(0); } Loading Loading @@ -381,7 +386,8 @@ public class NotificationShelf extends ActivatableNotificationView implements ? fullTransitionAmount : transitionAmount; iconState.clampedAppearAmount = clampedAmount; float contentTransformationAmount = isLastChild || iconState.translateContent float contentTransformationAmount = !row.isAboveShelf() && (isLastChild || iconState.translateContent) ? iconTransitionAmount : 0.0f; row.setContentTransformationAmount(contentTransformationAmount, isLastChild); Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +8 −4 Original line number Diff line number Diff line Loading @@ -410,7 +410,7 @@ public class StackScrollAlgorithm { if (mIsExpanded) { // Ensure that the heads up is always visible even when scrolled off clampHunToTop(ambientState, row, childState); if (i == 0) { if (i == 0 && row.isAboveShelf()) { // the first hun can't get off screen. clampHunToMaxTranslation(ambientState, row, childState); } Loading Loading @@ -447,10 +447,14 @@ public class StackScrollAlgorithm { private void clampHunToMaxTranslation(AmbientState ambientState, ExpandableNotificationRow row, ExpandableViewState childState) { float newTranslation; float bottomPosition = ambientState.getMaxHeadsUpTranslation() - row.getCollapsedHeight(); float maxHeadsUpTranslation = ambientState.getMaxHeadsUpTranslation(); float maxShelfPosition = ambientState.getInnerHeight() + ambientState.getTopPadding() + ambientState.getStackTranslation(); maxHeadsUpTranslation = Math.min(maxHeadsUpTranslation, maxShelfPosition); float bottomPosition = maxHeadsUpTranslation - row.getCollapsedHeight(); newTranslation = Math.min(childState.yTranslation, bottomPosition); childState.height = (int) Math.max(childState.height - (childState.yTranslation - newTranslation), row.getCollapsedHeight()); childState.height = (int) Math.min(childState.height, maxHeadsUpTranslation - newTranslation); childState.yTranslation = newTranslation; } Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/ViewState.java +16 −0 Original line number Diff line number Diff line Loading @@ -657,6 +657,22 @@ public class ViewState { } } /** * Get the end value of the zTranslation animation running on a view or the zTranslation * if no animation is running. */ public static float getFinalTranslationZ(View view) { if (view == null) { return 0; } ValueAnimator zAnimator = getChildTag(view, TAG_ANIMATOR_TRANSLATION_Z); if (zAnimator == null) { return view.getTranslationZ(); } else { return getChildTag(view, TAG_END_TRANSLATION_Z); } } public static boolean isAnimatingY(View child) { return getChildTag(child, TAG_ANIMATOR_TRANSLATION_Y) != null; } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +11 −5 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ public class NotificationShelf extends ActivatableNotificationView implements } ExpandableNotificationRow row = (ExpandableNotificationRow) child; float notificationClipEnd; boolean aboveShelf = row.getTranslationZ() > baseZHeight; boolean aboveShelf = ViewState.getFinalTranslationZ(row) > baseZHeight; boolean isLastChild = child == lastChild; float rowTranslationY = row.getTranslationY(); if (isLastChild || aboveShelf || backgroundForceHidden) { Loading Loading @@ -284,10 +284,15 @@ public class NotificationShelf extends ActivatableNotificationView implements private void updateNotificationClipHeight(ExpandableNotificationRow row, float notificationClipEnd) { float viewEnd = row.getTranslationY() + row.getActualHeight(); boolean isPinned = row.isPinned() || row.isHeadsUpAnimatingAway(); if (viewEnd > notificationClipEnd && (mAmbientState.isShadeExpanded() || (!row.isPinned() && !row.isHeadsUpAnimatingAway()))) { row.setClipBottomAmount((int) (viewEnd - notificationClipEnd)); && (mAmbientState.isShadeExpanded() || !isPinned)) { int clipBottomAmount = (int) (viewEnd - notificationClipEnd); if (isPinned) { clipBottomAmount = Math.min(row.getIntrinsicHeight() - row.getCollapsedHeight(), clipBottomAmount); } row.setClipBottomAmount(clipBottomAmount); } else { row.setClipBottomAmount(0); } Loading Loading @@ -381,7 +386,8 @@ public class NotificationShelf extends ActivatableNotificationView implements ? fullTransitionAmount : transitionAmount; iconState.clampedAppearAmount = clampedAmount; float contentTransformationAmount = isLastChild || iconState.translateContent float contentTransformationAmount = !row.isAboveShelf() && (isLastChild || iconState.translateContent) ? iconTransitionAmount : 0.0f; row.setContentTransformationAmount(contentTransformationAmount, isLastChild); Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +8 −4 Original line number Diff line number Diff line Loading @@ -410,7 +410,7 @@ public class StackScrollAlgorithm { if (mIsExpanded) { // Ensure that the heads up is always visible even when scrolled off clampHunToTop(ambientState, row, childState); if (i == 0) { if (i == 0 && row.isAboveShelf()) { // the first hun can't get off screen. clampHunToMaxTranslation(ambientState, row, childState); } Loading Loading @@ -447,10 +447,14 @@ public class StackScrollAlgorithm { private void clampHunToMaxTranslation(AmbientState ambientState, ExpandableNotificationRow row, ExpandableViewState childState) { float newTranslation; float bottomPosition = ambientState.getMaxHeadsUpTranslation() - row.getCollapsedHeight(); float maxHeadsUpTranslation = ambientState.getMaxHeadsUpTranslation(); float maxShelfPosition = ambientState.getInnerHeight() + ambientState.getTopPadding() + ambientState.getStackTranslation(); maxHeadsUpTranslation = Math.min(maxHeadsUpTranslation, maxShelfPosition); float bottomPosition = maxHeadsUpTranslation - row.getCollapsedHeight(); newTranslation = Math.min(childState.yTranslation, bottomPosition); childState.height = (int) Math.max(childState.height - (childState.yTranslation - newTranslation), row.getCollapsedHeight()); childState.height = (int) Math.min(childState.height, maxHeadsUpTranslation - newTranslation); childState.yTranslation = newTranslation; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/ViewState.java +16 −0 Original line number Diff line number Diff line Loading @@ -657,6 +657,22 @@ public class ViewState { } } /** * Get the end value of the zTranslation animation running on a view or the zTranslation * if no animation is running. */ public static float getFinalTranslationZ(View view) { if (view == null) { return 0; } ValueAnimator zAnimator = getChildTag(view, TAG_ANIMATOR_TRANSLATION_Z); if (zAnimator == null) { return view.getTranslationZ(); } else { return getChildTag(view, TAG_END_TRANSLATION_Z); } } public static boolean isAnimatingY(View child) { return getChildTag(child, TAG_ANIMATOR_TRANSLATION_Y) != null; } Loading