Merge "Remove unused shelf code" into sc-dev am: 49ce726b61

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14688186

Change-Id: I31660bf9852193b7f90251572be2d61b2e7dfcea
This commit is contained in:
Lyn Han
2021-05-26 00:00:19 +00:00
committed by Automerger Merge Worker
2 changed files with 1 additions and 41 deletions

View File

@@ -53,37 +53,26 @@ import com.android.systemui.statusbar.phone.NotificationIconContainer;
public class NotificationShelf extends ActivatableNotificationView implements public class NotificationShelf extends ActivatableNotificationView implements
View.OnLayoutChangeListener, StateListener { View.OnLayoutChangeListener, StateListener {
private static final boolean ICON_ANMATIONS_WHILE_SCROLLING
= SystemProperties.getBoolean("debug.icon_scroll_animations", true);
private static final int TAG_CONTINUOUS_CLIPPING = R.id.continuous_clipping_tag; private static final int TAG_CONTINUOUS_CLIPPING = R.id.continuous_clipping_tag;
private static final String TAG = "NotificationShelf"; private static final String TAG = "NotificationShelf";
private NotificationIconContainer mShelfIcons; private NotificationIconContainer mShelfIcons;
private int[] mTmp = new int[2]; private int[] mTmp = new int[2];
private boolean mHideBackground; private boolean mHideBackground;
private int mIconAppearTopPadding;
private float mHiddenShelfIconSize;
private int mStatusBarHeight; private int mStatusBarHeight;
private AmbientState mAmbientState; private AmbientState mAmbientState;
private NotificationStackScrollLayoutController mHostLayoutController; private NotificationStackScrollLayoutController mHostLayoutController;
private int mMaxLayoutHeight;
private int mPaddingBetweenElements; private int mPaddingBetweenElements;
private int mNotGoneIndex; private int mNotGoneIndex;
private boolean mHasItemsInStableShelf; private boolean mHasItemsInStableShelf;
private NotificationIconContainer mCollapsedIcons; private NotificationIconContainer mCollapsedIcons;
private int mScrollFastThreshold; private int mScrollFastThreshold;
private int mIconSize;
private int mStatusBarState; private int mStatusBarState;
private int mRelativeOffset;
private boolean mInteractive; private boolean mInteractive;
private float mOpenedAmount;
private boolean mNoAnimationsInThisFrame;
private boolean mAnimationsEnabled = true; private boolean mAnimationsEnabled = true;
private boolean mShowNotificationShelf; private boolean mShowNotificationShelf;
private float mFirstElementRoundness; private float mFirstElementRoundness;
private Rect mClipRect = new Rect(); private Rect mClipRect = new Rect();
private int mCutoutHeight;
private int mGapHeight;
private int mIndexOfFirstViewInShelf = -1; private int mIndexOfFirstViewInShelf = -1;
private float mCornerAnimationDistance; private float mCornerAnimationDistance;
private NotificationShelfController mController; private NotificationShelfController mController;
@@ -121,7 +110,6 @@ public class NotificationShelf extends ActivatableNotificationView implements
private void initDimens() { private void initDimens() {
Resources res = getResources(); Resources res = getResources();
mIconAppearTopPadding = res.getDimensionPixelSize(R.dimen.notification_icon_appear_padding);
mStatusBarHeight = res.getDimensionPixelOffset(R.dimen.status_bar_height); mStatusBarHeight = res.getDimensionPixelOffset(R.dimen.status_bar_height);
mPaddingBetweenElements = res.getDimensionPixelSize(R.dimen.notification_divider_height); mPaddingBetweenElements = res.getDimensionPixelSize(R.dimen.notification_divider_height);
@@ -133,9 +121,6 @@ public class NotificationShelf extends ActivatableNotificationView implements
mShelfIcons.setPadding(padding, 0, padding, 0); mShelfIcons.setPadding(padding, 0, padding, 0);
mScrollFastThreshold = res.getDimensionPixelOffset(R.dimen.scroll_fast_threshold); mScrollFastThreshold = res.getDimensionPixelOffset(R.dimen.scroll_fast_threshold);
mShowNotificationShelf = res.getBoolean(R.bool.config_showNotificationShelf); mShowNotificationShelf = res.getBoolean(R.bool.config_showNotificationShelf);
mIconSize = res.getDimensionPixelSize(com.android.internal.R.dimen.status_bar_icon_size);
mHiddenShelfIconSize = res.getDimensionPixelOffset(R.dimen.hidden_shelf_icon_size);
mGapHeight = res.getDimensionPixelSize(R.dimen.qs_notification_padding);
mCornerAnimationDistance = res.getDimensionPixelSize( mCornerAnimationDistance = res.getDimensionPixelSize(
R.dimen.notification_corner_animation_distance); R.dimen.notification_corner_animation_distance);
@@ -641,8 +626,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
transitionAmount = mAmbientState.isFullyHidden() ? 1 : 0; transitionAmount = mAmbientState.isFullyHidden() ? 1 : 0;
} else { } else {
transitionAmount = iconTransitionAmount; transitionAmount = iconTransitionAmount;
iconState.needsCannedAnimation = iconState.clampedAppearAmount != clampedAmount iconState.needsCannedAnimation = iconState.clampedAppearAmount != clampedAmount;
&& !mNoAnimationsInThisFrame;
} }
iconState.clampedAppearAmount = clampedAmount; iconState.clampedAppearAmount = clampedAmount;
setIconTransformationAmount(view, transitionAmount); setIconTransformationAmount(view, transitionAmount);
@@ -743,29 +727,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
private void updateRelativeOffset() { private void updateRelativeOffset() {
mCollapsedIcons.getLocationOnScreen(mTmp); mCollapsedIcons.getLocationOnScreen(mTmp);
mRelativeOffset = mTmp[0];
getLocationOnScreen(mTmp); getLocationOnScreen(mTmp);
mRelativeOffset -= mTmp[0];
}
@Override
public WindowInsets onApplyWindowInsets(WindowInsets insets) {
WindowInsets ret = super.onApplyWindowInsets(insets);
// NotificationShelf drag from the status bar and the status bar dock on the top
// of the display for current design so just focus on the top of ScreenDecorations.
// In landscape or multiple window split mode, the NotificationShelf still drag from
// the top and the physical notch/cutout goes to the right, left, or both side of the
// display so it doesn't matter for the NotificationSelf in landscape.
DisplayCutout displayCutout = insets.getDisplayCutout();
mCutoutHeight = displayCutout == null || displayCutout.getSafeInsetTop() < 0
? 0 : displayCutout.getSafeInsetTop();
return ret;
}
public void setMaxLayoutHeight(int maxLayoutHeight) {
mMaxLayoutHeight = maxLayoutHeight;
} }
/** /**
@@ -862,7 +824,6 @@ public class NotificationShelf extends ActivatableNotificationView implements
private class ShelfState extends ExpandableViewState { private class ShelfState extends ExpandableViewState {
private boolean hasItemsInStableShelf; private boolean hasItemsInStableShelf;
private ExpandableView firstViewInShelf; private ExpandableView firstViewInShelf;
private ExpandableView firstViewInOverflowSection;
@Override @Override
public void applyToView(View view) { public void applyToView(View view) {

View File

@@ -963,7 +963,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
@ShadeViewRefactor(RefactorComponent.LAYOUT_ALGORITHM) @ShadeViewRefactor(RefactorComponent.LAYOUT_ALGORITHM)
private void setMaxLayoutHeight(int maxLayoutHeight) { private void setMaxLayoutHeight(int maxLayoutHeight) {
mMaxLayoutHeight = maxLayoutHeight; mMaxLayoutHeight = maxLayoutHeight;
mShelf.setMaxLayoutHeight(maxLayoutHeight);
updateAlgorithmHeightAndPadding(); updateAlgorithmHeightAndPadding();
} }