Loading packages/SystemUI/res/values/dimens.xml +4 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,10 @@ views where the distance can't be measured --> <dimen name="notification_icon_appear_padding">15dp</dimen> <!-- Vertical translation of the shelf during animation that happens after the notification panel collapses --> <dimen name="shelf_appear_translation">9dp</dimen> <!-- The amount the content shifts upwards when transforming into the icon --> <dimen name="notification_icon_transform_content_shift">32dp</dimen> Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +26 −6 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.statusbar; import static com.android.systemui.statusbar.phone.NotificationIconContainer.IconState.NO_VALUE; import static com.android.systemui.statusbar.phone.NotificationIconContainer.OVERFLOW_EARLY_AMOUNT; import android.content.Context; import android.content.res.Configuration; Loading @@ -26,6 +25,7 @@ import android.graphics.Rect; import android.os.SystemProperties; import android.util.AttributeSet; import android.util.Log; import android.util.MathUtils; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; Loading Loading @@ -58,6 +58,8 @@ public class NotificationShelf extends ActivatableNotificationView implements = SystemProperties.getBoolean("debug.icon_scroll_animations", true); private static final int TAG_CONTINUOUS_CLIPPING = R.id.continuous_clipping_tag; private static final String TAG = "NotificationShelf"; private static final long SHELF_IN_TRANSLATION_DURATION = 220; private ViewInvertHelper mViewInvertHelper; private boolean mDark; private NotificationIconContainer mShelfIcons; Loading @@ -65,6 +67,7 @@ public class NotificationShelf extends ActivatableNotificationView implements private int[] mTmp = new int[2]; private boolean mHideBackground; private int mIconAppearTopPadding; private int mShelfAppearTranslation; private int mStatusBarHeight; private int mStatusBarPaddingStart; private AmbientState mAmbientState; Loading Loading @@ -120,6 +123,7 @@ public class NotificationShelf extends ActivatableNotificationView implements mStatusBarHeight = res.getDimensionPixelOffset(R.dimen.status_bar_height); mStatusBarPaddingStart = res.getDimensionPixelOffset(R.dimen.status_bar_padding_start); mPaddingBetweenElements = res.getDimensionPixelSize(R.dimen.notification_divider_height); mShelfAppearTranslation = res.getDimensionPixelSize(R.dimen.shelf_appear_translation); ViewGroup.LayoutParams layoutParams = getLayoutParams(); layoutParams.height = res.getDimensionPixelOffset(R.dimen.notification_shelf_height); Loading Loading @@ -151,6 +155,18 @@ public class NotificationShelf extends ActivatableNotificationView implements updateInteractiveness(); } public void fadeInTranslating() { float translation = mShelfIcons.getTranslationY(); mShelfIcons.setTranslationY(translation + mShelfAppearTranslation); mShelfIcons.setAlpha(0); mShelfIcons.animate() .alpha(1) .setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN) .translationY(translation) .setDuration(SHELF_IN_TRANSLATION_DURATION) .start(); } @Override protected View getContentView() { return mShelfIcons; Loading @@ -175,12 +191,14 @@ public class NotificationShelf extends ActivatableNotificationView implements float viewEnd = lastViewState.yTranslation + lastViewState.height; mShelfState.copyFrom(lastViewState); mShelfState.height = getIntrinsicHeight(); mShelfState.yTranslation = Math.max(Math.min(viewEnd, maxShelfEnd) - mShelfState.height, float awakenTranslation = Math.max(Math.min(viewEnd, maxShelfEnd) - mShelfState.height, getFullyClosedTranslation()); float darkTranslation = mAmbientState.getDarkTopPadding(); float yRatio = mAmbientState.hasPulsingNotifications() ? 0 : mAmbientState.getDarkAmount(); mShelfState.yTranslation = MathUtils.lerp(awakenTranslation, darkTranslation, yRatio); mShelfState.zTranslation = ambientState.getBaseZHeight(); if (mAmbientState.isDark() && !mAmbientState.hasPulsingNotifications()) { mShelfState.yTranslation = mAmbientState.getDarkTopPadding(); } float openedAmount = (mShelfState.yTranslation - getFullyClosedTranslation()) / (getIntrinsicHeight() * 2); openedAmount = Math.min(1.0f, openedAmount); Loading Loading @@ -555,7 +573,9 @@ public class NotificationShelf extends ActivatableNotificationView implements iconState.translateContent = false; } float transitionAmount; if (isLastChild || !USE_ANIMATIONS_WHEN_OPENING || iconState.useFullTransitionAmount if (mAmbientState.getDarkAmount() > 0 && !row.isInShelf()) { transitionAmount = mAmbientState.isFullyDark() ? 1 : 0; } else if (isLastChild || !USE_ANIMATIONS_WHEN_OPENING || iconState.useFullTransitionAmount || iconState.useLinearTransitionAmount) { transitionAmount = iconTransitionAmount; } else { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +12 −9 Original line number Diff line number Diff line Loading @@ -70,8 +70,8 @@ public class AmbientState { private int mIntrinsicPadding; private int mExpandAnimationTopChange; private ExpandableNotificationRow mExpandingNotification; private boolean mFullyDark; private int mDarkTopPadding; private float mDarkAmount; public AmbientState(Context context) { reload(context); Loading Loading @@ -149,6 +149,16 @@ public class AmbientState { mDark = dark; } /** Dark ratio of the status bar **/ public void setDarkAmount(float darkAmount) { mDarkAmount = darkAmount; } /** Returns the dark ratio of the status bar */ public float getDarkAmount() { return mDarkAmount; } public void setHideSensitive(boolean hideSensitive) { mHideSensitive = hideSensitive; } Loading Loading @@ -412,18 +422,11 @@ public class AmbientState { return mExpandAnimationTopChange; } /** * {@see isFullyDark} */ public void setFullyDark(boolean fullyDark) { mFullyDark = fullyDark; } /** * @return {@code true } when shade is completely dark: in AOD or ambient display. */ public boolean isFullyDark() { return mFullyDark; return mDarkAmount == 1; } public void setDarkTopPadding(int darkTopPadding) { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +20 −16 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.notification.FakeShadowView; import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.VisibilityLocationProvider; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; import com.android.systemui.statusbar.phone.NotificationGroupManager; import com.android.systemui.statusbar.phone.ScrimController; Loading Loading @@ -269,8 +270,6 @@ public class NotificationStackScrollLayout extends ViewGroup */ private boolean mOnlyScrollingInThisMotion; private boolean mDisallowDismissInThisMotion; private boolean mInterceptDelegateEnabled; private boolean mDelegateToScrollView; private boolean mDisallowScrollingInThisMotion; private long mGoToFullShadeDelay; private ViewTreeObserver.OnPreDrawListener mChildrenUpdater Loading Loading @@ -562,17 +561,17 @@ public class NotificationStackScrollLayout extends ViewGroup return; } final int color; if (mAmbientState.isDark()) { color = Color.WHITE; } else { float alpha = BACKGROUND_ALPHA_DIMMED + (1 - BACKGROUND_ALPHA_DIMMED) * (1.0f - mDimAmount); alpha *= 1f - mDarkAmount; // We need to manually blend in the background color // We need to manually blend in the background color. int scrimColor = mScrimController.getBackgroundColor(); color = ColorUtils.blendARGB(scrimColor, mBgColor, alpha); } int awakeColor = ColorUtils.blendARGB(scrimColor, mBgColor, alpha); // Interpolate between semi-transparent notification panel background color // and white AOD separator. float colorInterpolation = Interpolators.DECELERATE_QUINT.getInterpolation(mDarkAmount); int color = ColorUtils.blendARGB(awakeColor, Color.WHITE, colorInterpolation); if (mCachedBackgroundColor != color) { mCachedBackgroundColor = color; Loading Loading @@ -3961,13 +3960,18 @@ public class NotificationStackScrollLayout extends ViewGroup private void setDarkAmount(float darkAmount) { mDarkAmount = darkAmount; final boolean fullyDark = darkAmount == 1; if (mAmbientState.isFullyDark() != fullyDark) { mAmbientState.setFullyDark(fullyDark); boolean wasFullyDark = mAmbientState.isFullyDark(); mAmbientState.setDarkAmount(darkAmount); if (mAmbientState.isFullyDark() != wasFullyDark) { updateContentHeight(); DozeParameters dozeParameters = DozeParameters.getInstance(mContext); if (mAmbientState.isFullyDark() && dozeParameters.shouldControlScreenOff()) { mShelf.fadeInTranslating(); } } updateBackgroundDimming(); updateAntiBurnInTranslation(); requestChildrenUpdate(); } public float getDarkAmount() { Loading packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +0 −2 Original line number Diff line number Diff line Loading @@ -276,8 +276,6 @@ public class StackScrollAlgorithm { if (i >= firstHiddenIndex) { // we need normal padding now, to be in sync with what the stack calculates lastView = null; ExpandableViewState viewState = resultState.getViewStateForView(v); viewState.hidden = true; } notGoneIndex = updateNotGoneIndex(resultState, state, notGoneIndex, v); float increasedPadding = v.getIncreasedPaddingAmount(); Loading Loading
packages/SystemUI/res/values/dimens.xml +4 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,10 @@ views where the distance can't be measured --> <dimen name="notification_icon_appear_padding">15dp</dimen> <!-- Vertical translation of the shelf during animation that happens after the notification panel collapses --> <dimen name="shelf_appear_translation">9dp</dimen> <!-- The amount the content shifts upwards when transforming into the icon --> <dimen name="notification_icon_transform_content_shift">32dp</dimen> Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java +26 −6 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.systemui.statusbar; import static com.android.systemui.statusbar.phone.NotificationIconContainer.IconState.NO_VALUE; import static com.android.systemui.statusbar.phone.NotificationIconContainer.OVERFLOW_EARLY_AMOUNT; import android.content.Context; import android.content.res.Configuration; Loading @@ -26,6 +25,7 @@ import android.graphics.Rect; import android.os.SystemProperties; import android.util.AttributeSet; import android.util.Log; import android.util.MathUtils; import android.view.View; import android.view.ViewGroup; import android.view.ViewTreeObserver; Loading Loading @@ -58,6 +58,8 @@ public class NotificationShelf extends ActivatableNotificationView implements = SystemProperties.getBoolean("debug.icon_scroll_animations", true); private static final int TAG_CONTINUOUS_CLIPPING = R.id.continuous_clipping_tag; private static final String TAG = "NotificationShelf"; private static final long SHELF_IN_TRANSLATION_DURATION = 220; private ViewInvertHelper mViewInvertHelper; private boolean mDark; private NotificationIconContainer mShelfIcons; Loading @@ -65,6 +67,7 @@ public class NotificationShelf extends ActivatableNotificationView implements private int[] mTmp = new int[2]; private boolean mHideBackground; private int mIconAppearTopPadding; private int mShelfAppearTranslation; private int mStatusBarHeight; private int mStatusBarPaddingStart; private AmbientState mAmbientState; Loading Loading @@ -120,6 +123,7 @@ public class NotificationShelf extends ActivatableNotificationView implements mStatusBarHeight = res.getDimensionPixelOffset(R.dimen.status_bar_height); mStatusBarPaddingStart = res.getDimensionPixelOffset(R.dimen.status_bar_padding_start); mPaddingBetweenElements = res.getDimensionPixelSize(R.dimen.notification_divider_height); mShelfAppearTranslation = res.getDimensionPixelSize(R.dimen.shelf_appear_translation); ViewGroup.LayoutParams layoutParams = getLayoutParams(); layoutParams.height = res.getDimensionPixelOffset(R.dimen.notification_shelf_height); Loading Loading @@ -151,6 +155,18 @@ public class NotificationShelf extends ActivatableNotificationView implements updateInteractiveness(); } public void fadeInTranslating() { float translation = mShelfIcons.getTranslationY(); mShelfIcons.setTranslationY(translation + mShelfAppearTranslation); mShelfIcons.setAlpha(0); mShelfIcons.animate() .alpha(1) .setInterpolator(Interpolators.LINEAR_OUT_SLOW_IN) .translationY(translation) .setDuration(SHELF_IN_TRANSLATION_DURATION) .start(); } @Override protected View getContentView() { return mShelfIcons; Loading @@ -175,12 +191,14 @@ public class NotificationShelf extends ActivatableNotificationView implements float viewEnd = lastViewState.yTranslation + lastViewState.height; mShelfState.copyFrom(lastViewState); mShelfState.height = getIntrinsicHeight(); mShelfState.yTranslation = Math.max(Math.min(viewEnd, maxShelfEnd) - mShelfState.height, float awakenTranslation = Math.max(Math.min(viewEnd, maxShelfEnd) - mShelfState.height, getFullyClosedTranslation()); float darkTranslation = mAmbientState.getDarkTopPadding(); float yRatio = mAmbientState.hasPulsingNotifications() ? 0 : mAmbientState.getDarkAmount(); mShelfState.yTranslation = MathUtils.lerp(awakenTranslation, darkTranslation, yRatio); mShelfState.zTranslation = ambientState.getBaseZHeight(); if (mAmbientState.isDark() && !mAmbientState.hasPulsingNotifications()) { mShelfState.yTranslation = mAmbientState.getDarkTopPadding(); } float openedAmount = (mShelfState.yTranslation - getFullyClosedTranslation()) / (getIntrinsicHeight() * 2); openedAmount = Math.min(1.0f, openedAmount); Loading Loading @@ -555,7 +573,9 @@ public class NotificationShelf extends ActivatableNotificationView implements iconState.translateContent = false; } float transitionAmount; if (isLastChild || !USE_ANIMATIONS_WHEN_OPENING || iconState.useFullTransitionAmount if (mAmbientState.getDarkAmount() > 0 && !row.isInShelf()) { transitionAmount = mAmbientState.isFullyDark() ? 1 : 0; } else if (isLastChild || !USE_ANIMATIONS_WHEN_OPENING || iconState.useFullTransitionAmount || iconState.useLinearTransitionAmount) { transitionAmount = iconTransitionAmount; } else { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java +12 −9 Original line number Diff line number Diff line Loading @@ -70,8 +70,8 @@ public class AmbientState { private int mIntrinsicPadding; private int mExpandAnimationTopChange; private ExpandableNotificationRow mExpandingNotification; private boolean mFullyDark; private int mDarkTopPadding; private float mDarkAmount; public AmbientState(Context context) { reload(context); Loading Loading @@ -149,6 +149,16 @@ public class AmbientState { mDark = dark; } /** Dark ratio of the status bar **/ public void setDarkAmount(float darkAmount) { mDarkAmount = darkAmount; } /** Returns the dark ratio of the status bar */ public float getDarkAmount() { return mDarkAmount; } public void setHideSensitive(boolean hideSensitive) { mHideSensitive = hideSensitive; } Loading Loading @@ -412,18 +422,11 @@ public class AmbientState { return mExpandAnimationTopChange; } /** * {@see isFullyDark} */ public void setFullyDark(boolean fullyDark) { mFullyDark = fullyDark; } /** * @return {@code true } when shade is completely dark: in AOD or ambient display. */ public boolean isFullyDark() { return mFullyDark; return mDarkAmount == 1; } public void setDarkTopPadding(int darkTopPadding) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +20 −16 Original line number Diff line number Diff line Loading @@ -96,6 +96,7 @@ import com.android.systemui.statusbar.StatusBarState; import com.android.systemui.statusbar.notification.FakeShadowView; import com.android.systemui.statusbar.notification.NotificationUtils; import com.android.systemui.statusbar.notification.VisibilityLocationProvider; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.HeadsUpManagerPhone; import com.android.systemui.statusbar.phone.NotificationGroupManager; import com.android.systemui.statusbar.phone.ScrimController; Loading Loading @@ -269,8 +270,6 @@ public class NotificationStackScrollLayout extends ViewGroup */ private boolean mOnlyScrollingInThisMotion; private boolean mDisallowDismissInThisMotion; private boolean mInterceptDelegateEnabled; private boolean mDelegateToScrollView; private boolean mDisallowScrollingInThisMotion; private long mGoToFullShadeDelay; private ViewTreeObserver.OnPreDrawListener mChildrenUpdater Loading Loading @@ -562,17 +561,17 @@ public class NotificationStackScrollLayout extends ViewGroup return; } final int color; if (mAmbientState.isDark()) { color = Color.WHITE; } else { float alpha = BACKGROUND_ALPHA_DIMMED + (1 - BACKGROUND_ALPHA_DIMMED) * (1.0f - mDimAmount); alpha *= 1f - mDarkAmount; // We need to manually blend in the background color // We need to manually blend in the background color. int scrimColor = mScrimController.getBackgroundColor(); color = ColorUtils.blendARGB(scrimColor, mBgColor, alpha); } int awakeColor = ColorUtils.blendARGB(scrimColor, mBgColor, alpha); // Interpolate between semi-transparent notification panel background color // and white AOD separator. float colorInterpolation = Interpolators.DECELERATE_QUINT.getInterpolation(mDarkAmount); int color = ColorUtils.blendARGB(awakeColor, Color.WHITE, colorInterpolation); if (mCachedBackgroundColor != color) { mCachedBackgroundColor = color; Loading Loading @@ -3961,13 +3960,18 @@ public class NotificationStackScrollLayout extends ViewGroup private void setDarkAmount(float darkAmount) { mDarkAmount = darkAmount; final boolean fullyDark = darkAmount == 1; if (mAmbientState.isFullyDark() != fullyDark) { mAmbientState.setFullyDark(fullyDark); boolean wasFullyDark = mAmbientState.isFullyDark(); mAmbientState.setDarkAmount(darkAmount); if (mAmbientState.isFullyDark() != wasFullyDark) { updateContentHeight(); DozeParameters dozeParameters = DozeParameters.getInstance(mContext); if (mAmbientState.isFullyDark() && dozeParameters.shouldControlScreenOff()) { mShelf.fadeInTranslating(); } } updateBackgroundDimming(); updateAntiBurnInTranslation(); requestChildrenUpdate(); } public float getDarkAmount() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/stack/StackScrollAlgorithm.java +0 −2 Original line number Diff line number Diff line Loading @@ -276,8 +276,6 @@ public class StackScrollAlgorithm { if (i >= firstHiddenIndex) { // we need normal padding now, to be in sync with what the stack calculates lastView = null; ExpandableViewState viewState = resultState.getViewStateForView(v); viewState.hidden = true; } notGoneIndex = updateNotGoneIndex(resultState, state, notGoneIndex, v); float increasedPadding = v.getIncreasedPaddingAmount(); Loading