Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +56 −74 Original line number Diff line number Diff line Loading @@ -180,8 +180,7 @@ import javax.inject.Named; * A layout which handles a dynamic amount of notifications and presents them in a scrollable stack. */ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAdapter, NotificationListContainer, ConfigurationListener, Dumpable, DynamicPrivacyController.Listener { ConfigurationListener, Dumpable, DynamicPrivacyController.Listener { public static final float BACKGROUND_ALPHA_DIMMED = 0.7f; private static final String TAG = "StackScroller"; Loading Loading @@ -213,6 +212,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private float mExpandedHeight; private int mOwnScrollY; private View mScrollAnchorView; private int mScrollAnchorViewY; private int mMaxLayoutHeight; Loading Loading @@ -545,6 +545,19 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd updateDecorViews(useDarkText); }; private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener = new ExpandableView.OnHeightChangedListener() { @Override public void onHeightChanged(ExpandableView view, boolean needsAnimation) { onChildHeightChanged(view, needsAnimation); } @Override public void onReset(ExpandableView view) { onChildHeightReset(view); } }; @Inject public NotificationStackScrollLayout( @Named(VIEW_CONTEXT) Context context, Loading Loading @@ -576,7 +589,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mLockscreenUserManager = notificationLockscreenUserManager; mNotificationGutsManager = notificationGutsManager; mHeadsUpManager = headsUpManager; mHeadsUpManager.addListener(mRoundnessManager); mHeadsUpManager.setAnimationStateHandler(this::setHeadsUpGoingAwayAnimationsAllowed); mKeyguardBypassController = keyguardBypassController; mFalsingManager = falsingManager; Loading Loading @@ -608,9 +620,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd res.getBoolean(R.bool.config_drawNotificationBackground); mFadeNotificationsOnDismiss = res.getBoolean(R.bool.config_fadeNotificationsOnDismiss); mRoundnessManager.setAnimatedChildren(mChildrenToAddAnimated); mRoundnessManager.setOnRoundingChangedCallback(this::invalidate); addOnExpandedHeightChangedListener(mRoundnessManager::setExpanded); mLockscreenUserManager.addUserChangedListener(mLockscreenUserChangeListener); setOutlineProvider(mOutlineProvider); Loading @@ -637,13 +646,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd tunerService.addTunable((key, newValue) -> { if (key.equals(HIGH_PRIORITY)) { mHighPriorityBeforeSpeedBump = "1".equals(newValue); } else if (key.equals(Settings.Secure.NOTIFICATION_DISMISS_RTL)) { updateDismissRtlSetting("1".equals(newValue)); } else if (key.equals(Settings.Secure.NOTIFICATION_HISTORY_ENABLED)) { updateFooter(); } }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL, Settings.Secure.NOTIFICATION_HISTORY_ENABLED); }, HIGH_PRIORITY); mFeatureFlags = featureFlags; mNotifPipeline = notifPipeline; Loading Loading @@ -693,7 +697,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } private void updateDismissRtlSetting(boolean dismissRtl) { void updateDismissRtlSetting(boolean dismissRtl) { mDismissRtl = dismissRtl; for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); Loading Loading @@ -834,7 +838,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd Dependency.get(ConfigurationController.class).removeCallback(this); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public NotificationSwipeActionHelper getSwipeActionHelper() { return mSwipeHelper; Loading Loading @@ -1150,14 +1153,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mNoAmbient = noAmbient; } @Override @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void setChildLocationsChangedListener( NotificationLogger.OnChildLocationsChangedListener listener) { mListener = listener; } @Override public void setScrollAnchorView(View scrollAnchorView) { mScrollAnchorView = scrollAnchorView; } @ShadeViewRefactor(RefactorComponent.LAYOUT_ALGORITHM) public boolean isInVisibleLocation(NotificationEntry entry) { ExpandableNotificationRow row = entry.getRow(); Loading Loading @@ -1856,7 +1861,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override @ShadeViewRefactor(RefactorComponent.ADAPTER) public ViewGroup getViewParentForNotification(NotificationEntry entry) { return this; Loading Loading @@ -2546,7 +2550,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd previous); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public boolean hasPulsingNotifications() { return mPulsing; Loading Loading @@ -3050,7 +3053,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) @Override public void cleanUpViewStateForEntry(NotificationEntry entry) { View child = entry.getRow(); if (child == mSwipeHelper.getTranslatingParentView()) { Loading Loading @@ -3317,8 +3319,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void onViewAdded(View child) { super.onViewAdded(child); if (child instanceof ExpandableView) { onViewAddedInternal((ExpandableView) child); } } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) private void updateFirstAndLastBackgroundViews() { Loading Loading @@ -3350,9 +3354,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.COORDINATOR) private void onViewAddedInternal(ExpandableView child) { void onViewAddedInternal(ExpandableView child) { child.setOnHeightChangedListener(mOnChildHeightChangedListener); updateHideSensitiveForChild(child); child.setOnHeightChangedListener(this); generateAddAnimation(child, false /* fromMoreCard */); updateAnimationState(child); updateChronometerForChild(child); Loading @@ -3374,18 +3378,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd child.setHideSensitiveForIntrinsicHeight(mAmbientState.isHideSensitive()); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void notifyGroupChildRemoved(ExpandableView row, ViewGroup childrenContainer) { onViewRemovedInternal(row, childrenContainer); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void notifyGroupChildAdded(ExpandableView row) { onViewAddedInternal(row); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void setAnimationsEnabled(boolean animationsEnabled) { mAnimationsEnabled = animationsEnabled; Loading @@ -3410,33 +3407,29 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) private void updateAnimationState(View child) { void updateAnimationState(View child) { updateAnimationState((mAnimationsEnabled || hasPulsingNotifications()) && (mIsExpanded || isPinnedHeadsUp(child)), child); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setExpandingNotification(ExpandableNotificationRow row) { void setExpandingNotification(ExpandableNotificationRow row) { mAmbientState.setExpandingNotification(row); requestChildrenUpdate(); } @Override @ShadeViewRefactor(RefactorComponent.ADAPTER) public void bindRow(ExpandableNotificationRow row) { void bindRow(ExpandableNotificationRow row) { row.setHeadsUpAnimatingAwayListener(animatingAway -> { mRoundnessManager.onHeadsupAnimatingAwayChanged(row, animatingAway); mHeadsUpAppearanceController.updateHeader(row.getEntry()); }); } @Override public boolean containsView(View v) { return v.getParent() == this; } @Override @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void applyExpandAnimationParams(ExpandAnimationParameters params) { mAmbientState.setExpandAnimationTopChange(params == null ? 0 : params.getTopChange()); Loading @@ -3452,12 +3445,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public boolean isAddOrRemoveAnimationPending() { boolean isAddOrRemoveAnimationPending() { return mNeedsAnimation && (!mChildrenToAddAnimated.isEmpty() || !mChildrenToRemoveAnimated.isEmpty()); } @Override @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void generateAddAnimation(ExpandableView child, boolean fromMoreCard) { if (mIsExpanded && mAnimationsEnabled && !mChangePositionInProgress && !isFullyHidden()) { Loading @@ -3475,7 +3467,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void changeViewPosition(ExpandableView child, int newIndex) { Assert.isMainThread(); Loading Loading @@ -4471,12 +4462,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.COORDINATOR) public int getEmptyBottomMargin() { int getEmptyBottomMargin() { return Math.max(mMaxLayoutHeight - mContentHeight, 0); } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void checkSnoozeLeavebehind() { void checkSnoozeLeavebehind() { if (mCheckForLeavebehind) { mNotificationGutsManager.closeAndSaveGuts(true /* removeLeavebehind */, false /* force */, false /* removeControls */, -1 /* x */, -1 /* y */, Loading @@ -4486,19 +4477,19 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void resetCheckSnoozeLeavebehind() { void resetCheckSnoozeLeavebehind() { mCheckForLeavebehind = true; } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onExpansionStarted() { void onExpansionStarted() { mIsExpansionChanging = true; mAmbientState.setExpansionChanging(true); checkSnoozeLeavebehind(); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onExpansionStopped() { void onExpansionStopped() { mIsExpansionChanging = false; resetCheckSnoozeLeavebehind(); mAmbientState.setExpansionChanging(false); Loading Loading @@ -4547,20 +4538,20 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onPanelTrackingStarted() { void onPanelTrackingStarted() { mPanelTracking = true; mAmbientState.setPanelTracking(true); resetExposedMenuView(true /* animate */, true /* force */); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onPanelTrackingStopped() { void onPanelTrackingStopped() { mPanelTracking = false; mAmbientState.setPanelTracking(false); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void resetScrollPosition() { void resetScrollPosition() { mScroller.abortAnimation(); if (ANCHOR_SCROLLING) { // TODO: once we're recycling this will need to modify the adapter position instead Loading Loading @@ -4601,15 +4592,14 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.COORDINATOR) private void updateChronometerForChild(View child) { void updateChronometerForChild(View child) { if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; row.setChronometerRunning(mIsExpanded); } } @Override public void onHeightChanged(ExpandableView view, boolean needsAnimation) { void onChildHeightChanged(ExpandableView view, boolean needsAnimation) { updateContentHeight(); updateScrollPositionOnExpandInBottom(view); clampScrollPosition(); Loading @@ -4632,8 +4622,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd requestChildrenUpdate(); } @Override public void onReset(ExpandableView view) { void onChildHeightReset(ExpandableView view) { updateAnimationState(view); updateChronometerForChild(view); } Loading Loading @@ -4674,13 +4663,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setOnHeightChangedListener( void setOnHeightChangedListener( ExpandableView.OnHeightChangedListener onHeightChangedListener) { this.mOnHeightChangedListener = onHeightChangedListener; } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onChildAnimationFinished() { void onChildAnimationFinished() { setAnimationRunning(false); requestChildrenUpdate(); runAnimationFinishedRunnables(); Loading Loading @@ -4724,7 +4713,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd * See {@link AmbientState#setDimmed}. */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setDimmed(boolean dimmed, boolean animate) { void setDimmed(boolean dimmed, boolean animate) { dimmed &= onKeyguard(); mAmbientState.setDimmed(dimmed); if (animate && mAnimationsEnabled) { Loading Loading @@ -4789,7 +4778,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd * See {@link AmbientState#setActivatedChild}. */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setActivatedChild(ActivatableNotificationView activatedChild) { void setActivatedChild(ActivatableNotificationView activatedChild) { mAmbientState.setActivatedChild(activatedChild); if (mAnimationsEnabled) { mActivateNeedsAnimation = true; Loading Loading @@ -4865,7 +4854,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd * @param lightTheme True if light theme should be used. */ @ShadeViewRefactor(RefactorComponent.DECORATOR) public void updateDecorViews(boolean lightTheme) { private void updateDecorViews(boolean lightTheme) { if (lightTheme == mUsingLightTheme) { return; } Loading @@ -4880,7 +4869,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void goToFullShade(long delay) { void goToFullShade(long delay) { mGoToFullShadeNeedsAnimation = true; mGoToFullShadeDelay = delay; mNeedsAnimation = true; Loading @@ -4893,13 +4882,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.COORDINATOR) public void setIntrinsicPadding(int intrinsicPadding) { void setIntrinsicPadding(int intrinsicPadding) { mIntrinsicPadding = intrinsicPadding; mAmbientState.setIntrinsicPadding(intrinsicPadding); } @ShadeViewRefactor(RefactorComponent.COORDINATOR) public int getIntrinsicPadding() { int getIntrinsicPadding() { return mIntrinsicPadding; } Loading Loading @@ -4933,7 +4922,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd * animation curve. */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setHideAmount(float linearHideAmount, float interpolatedHideAmount) { void setHideAmount(float linearHideAmount, float interpolatedHideAmount) { mLinearHideAmount = linearHideAmount; mInterpolatedHideAmount = interpolatedHideAmount; boolean wasFullyHidden = mAmbientState.isFullyHidden(); Loading Loading @@ -4975,7 +4964,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void notifyHideAnimationStart(boolean hide) { void notifyHideAnimationStart(boolean hide) { // We only swap the scaling factor if we're fully hidden or fully awake to avoid // interpolation issues when playing with the power button. if (mInterpolatedHideAmount == 0 || mInterpolatedHideAmount == 1) { Loading Loading @@ -5003,7 +4992,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setFooterView(@NonNull FooterView footerView) { void setFooterView(@NonNull FooterView footerView) { int index = -1; if (mFooterView != null) { index = indexOfChild(mFooterView); Loading @@ -5014,7 +5003,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setEmptyShadeView(EmptyShadeView emptyShadeView) { void setEmptyShadeView(EmptyShadeView emptyShadeView) { int index = -1; if (mEmptyShadeView != null) { index = indexOfChild(mEmptyShadeView); Loading @@ -5025,7 +5014,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void updateEmptyShadeView(boolean visible) { void updateEmptyShadeView(boolean visible) { mEmptyShadeView.setVisible(visible, mIsExpanded && mAnimationsEnabled); int oldTextRes = mEmptyShadeView.getTextResource(); Loading Loading @@ -5209,33 +5198,28 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public int getContainerChildCount() { return getChildCount(); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public View getContainerChildAt(int i) { return getChildAt(i); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void removeContainerView(View v) { Assert.isMainThread(); removeView(v); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void addContainerView(View v) { Assert.isMainThread(); addView(v); } @Override public void addContainerViewAt(View v, int index) { Assert.isMainThread(); addView(v, index); Loading Loading @@ -5277,7 +5261,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd requestChildrenUpdate(); } @Override public void setWillExpand(boolean willExpand) { mWillExpand = willExpand; } Loading Loading @@ -5742,7 +5725,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override public void setNotificationActivityStarter( NotificationActivityStarter notificationActivityStarter) { mNotificationActivityStarter = notificationActivityStarter; Loading Loading @@ -5900,6 +5882,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd public void setController( NotificationStackScrollLayoutController notificationStackScrollLayoutController) { mController = notificationStackScrollLayoutController; mController.getNoticationRoundessManager().setAnimatedChildren(mChildrenToAddAnimated); } public NotificationStackScrollLayoutController getController() { Loading Loading @@ -6000,7 +5983,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void resetExposedMenuView(boolean animate, boolean force) { mSwipeHelper.resetExposedMenuView(animate, force); Loading Loading @@ -6752,7 +6734,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } changedRow.setChildrenExpanded(expanded, animated); if (!mGroupExpandedForMeasure) { onHeightChanged(changedRow, false /* needsAnimation */); onChildHeightChanged(changedRow, false /* needsAnimation */); } runAfterAnimationFinished(new Runnable() { @Override Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +178 −5 File changed.Preview size limit exceeded, changes collapsed. Show changes packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +6 −1 Original line number Diff line number Diff line Loading @@ -3074,7 +3074,8 @@ public class NotificationPanelViewController extends PanelViewController { } public boolean hasPulsingNotifications() { return mNotificationStackScrollLayoutController.hasPulsingNotifications(); return mNotificationStackScrollLayoutController .getNotificationListContainer().hasPulsingNotifications(); } public ActivatableNotificationView getActivatedChild() { Loading Loading @@ -3259,6 +3260,10 @@ public class NotificationPanelViewController extends PanelViewController { return new OnConfigurationChangedListener(); } public NotificationStackScrollLayoutController getNotificationStackScrollLayoutController() { return mNotificationStackScrollLayoutController; } private class OnHeightChangedListener implements ExpandableView.OnHeightChangedListener { @Override public void onHeightChanged(ExpandableView view, boolean needsAnimation) { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +15 −12 Original line number Diff line number Diff line Loading @@ -210,6 +210,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule; import com.android.systemui.statusbar.policy.BatteryController; Loading Loading @@ -646,6 +647,7 @@ public class StatusBar extends SystemUI implements DemoMode, private final BubbleController.BubbleExpandListener mBubbleExpandListener; private ActivityIntentHelper mActivityIntentHelper; private NotificationStackScrollLayoutController mStackScrollerController; /** * Public constructor for StatusBar. Loading Loading @@ -1016,9 +1018,11 @@ public class StatusBar extends SystemUI implements DemoMode, // TODO: Deal with the ugliness that comes from having some of the statusbar broken out // into fragments, but the rest here, it leaves some awkward lifecycle and whatnot. mStackScroller = mNotificationShadeWindowView.findViewById( R.id.notification_stack_scroller); NotificationListContainer notifListContainer = (NotificationListContainer) mStackScroller; mStackScrollerController = mNotificationPanelViewController.getNotificationStackScrollLayoutController(); mStackScroller = mStackScrollerController.getView(); NotificationListContainer notifListContainer = mStackScrollerController.getNotificationListContainer(); mNotificationLogger.setUpWithContainer(notifListContainer); // TODO: make this injectable. Currently that would create a circular dependency between Loading Loading @@ -1301,13 +1305,15 @@ public class StatusBar extends SystemUI implements DemoMode, mActivityLaunchAnimator = new ActivityLaunchAnimator( mNotificationShadeWindowViewController, this, mNotificationPanelViewController, mNotificationShadeDepthControllerLazy.get(), (NotificationListContainer) mStackScroller, mContext.getMainExecutor()); mStackScrollerController.getNotificationListContainer(), mContext.getMainExecutor()); // TODO: inject this. mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanelViewController, mHeadsUpManager, mNotificationShadeWindowView, mStackScroller, mDozeScrimController, mScrimController, mActivityLaunchAnimator, mDynamicPrivacyController, mKeyguardStateController, mKeyguardIndicationController, mHeadsUpManager, mNotificationShadeWindowView, mStackScrollerController, mDozeScrimController, mScrimController, mActivityLaunchAnimator, mDynamicPrivacyController, mKeyguardStateController, mKeyguardIndicationController, this /* statusBar */, mShadeController, mCommandQueue, mInitController, mNotificationInterruptStateProvider); Loading @@ -1321,16 +1327,13 @@ public class StatusBar extends SystemUI implements DemoMode, .setNotificationPresenter(mPresenter) .setNotificationPanelViewController(mNotificationPanelViewController) .build(); ((NotificationListContainer) mStackScroller) .setNotificationActivityStarter(mNotificationActivityStarter); mStackScroller.setNotificationActivityStarter(mNotificationActivityStarter); mGutsManager.setNotificationActivityStarter(mNotificationActivityStarter); mNotificationsController.initialize( this, mPresenter, (NotificationListContainer) mStackScroller, mStackScrollerController.getNotificationListContainer(), mNotificationActivityStarter, mPresenter); } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +7 −7 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import android.service.vr.IVrStateCallbacks; import android.util.Log; import android.util.Slog; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.widget.TextView; Loading Loading @@ -71,7 +70,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.row.NotificationGutsManager.OnSettingsClickListener; import com.android.systemui.statusbar.notification.row.NotificationInfo.CheckSaveListener; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; Loading Loading @@ -133,7 +132,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, NotificationPanelViewController panel, HeadsUpManagerPhone headsUp, NotificationShadeWindowView statusBarWindow, ViewGroup stackScroller, NotificationStackScrollLayoutController stackScrollerController, DozeScrimController dozeScrimController, ScrimController scrimController, ActivityLaunchAnimator activityLaunchAnimator, Loading @@ -155,7 +154,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, mStatusBar = statusBar; mShadeController = shadeController; mCommandQueue = commandQueue; mAboveShelfObserver = new AboveShelfObserver(stackScroller); mAboveShelfObserver = new AboveShelfObserver(stackScrollerController.getView()); mActivityLaunchAnimator = activityLaunchAnimator; mAboveShelfObserver.setListener(statusBarWindow.findViewById( R.id.notification_container_parent)); Loading Loading @@ -190,7 +189,6 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, remoteInputManager.getController().addCallback( Dependency.get(NotificationShadeWindowController.class)); NotificationListContainer notifListContainer = (NotificationListContainer) stackScroller; initController.addPostInitTask(() -> { NotificationEntryListener notificationEntryListener = new NotificationEntryListener() { @Override Loading @@ -207,7 +205,8 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, } }; mViewHierarchyManager.setUpWithPresenter(this, notifListContainer); mViewHierarchyManager.setUpWithPresenter(this, stackScrollerController.getNotificationListContainer()); mEntryManager.setUpWithPresenter(this); mEntryManager.addNotificationEntryListener(notificationEntryListener); mEntryManager.addNotificationLifetimeExtender(mHeadsUpManager); Loading @@ -219,7 +218,8 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, mMediaManager.setUpWithPresenter(this); mVisualStabilityManager.setUpWithPresenter(this); mGutsManager.setUpWithPresenter(this, notifListContainer, mCheckSaveListener, mOnSettingsClickListener); stackScrollerController.getNotificationListContainer(), mCheckSaveListener, mOnSettingsClickListener); // ForegroundServiceNotificationListener adds its listener in its constructor // but we need to request it here in order for it to be instantiated. // TODO: figure out how to do this correctly once Dependency.get() is gone. Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +56 −74 Original line number Diff line number Diff line Loading @@ -180,8 +180,7 @@ import javax.inject.Named; * A layout which handles a dynamic amount of notifications and presents them in a scrollable stack. */ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAdapter, NotificationListContainer, ConfigurationListener, Dumpable, DynamicPrivacyController.Listener { ConfigurationListener, Dumpable, DynamicPrivacyController.Listener { public static final float BACKGROUND_ALPHA_DIMMED = 0.7f; private static final String TAG = "StackScroller"; Loading Loading @@ -213,6 +212,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private float mExpandedHeight; private int mOwnScrollY; private View mScrollAnchorView; private int mScrollAnchorViewY; private int mMaxLayoutHeight; Loading Loading @@ -545,6 +545,19 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd updateDecorViews(useDarkText); }; private final ExpandableView.OnHeightChangedListener mOnChildHeightChangedListener = new ExpandableView.OnHeightChangedListener() { @Override public void onHeightChanged(ExpandableView view, boolean needsAnimation) { onChildHeightChanged(view, needsAnimation); } @Override public void onReset(ExpandableView view) { onChildHeightReset(view); } }; @Inject public NotificationStackScrollLayout( @Named(VIEW_CONTEXT) Context context, Loading Loading @@ -576,7 +589,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mLockscreenUserManager = notificationLockscreenUserManager; mNotificationGutsManager = notificationGutsManager; mHeadsUpManager = headsUpManager; mHeadsUpManager.addListener(mRoundnessManager); mHeadsUpManager.setAnimationStateHandler(this::setHeadsUpGoingAwayAnimationsAllowed); mKeyguardBypassController = keyguardBypassController; mFalsingManager = falsingManager; Loading Loading @@ -608,9 +620,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd res.getBoolean(R.bool.config_drawNotificationBackground); mFadeNotificationsOnDismiss = res.getBoolean(R.bool.config_fadeNotificationsOnDismiss); mRoundnessManager.setAnimatedChildren(mChildrenToAddAnimated); mRoundnessManager.setOnRoundingChangedCallback(this::invalidate); addOnExpandedHeightChangedListener(mRoundnessManager::setExpanded); mLockscreenUserManager.addUserChangedListener(mLockscreenUserChangeListener); setOutlineProvider(mOutlineProvider); Loading @@ -637,13 +646,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd tunerService.addTunable((key, newValue) -> { if (key.equals(HIGH_PRIORITY)) { mHighPriorityBeforeSpeedBump = "1".equals(newValue); } else if (key.equals(Settings.Secure.NOTIFICATION_DISMISS_RTL)) { updateDismissRtlSetting("1".equals(newValue)); } else if (key.equals(Settings.Secure.NOTIFICATION_HISTORY_ENABLED)) { updateFooter(); } }, HIGH_PRIORITY, Settings.Secure.NOTIFICATION_DISMISS_RTL, Settings.Secure.NOTIFICATION_HISTORY_ENABLED); }, HIGH_PRIORITY); mFeatureFlags = featureFlags; mNotifPipeline = notifPipeline; Loading Loading @@ -693,7 +697,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } private void updateDismissRtlSetting(boolean dismissRtl) { void updateDismissRtlSetting(boolean dismissRtl) { mDismissRtl = dismissRtl; for (int i = 0; i < getChildCount(); i++) { View child = getChildAt(i); Loading Loading @@ -834,7 +838,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd Dependency.get(ConfigurationController.class).removeCallback(this); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public NotificationSwipeActionHelper getSwipeActionHelper() { return mSwipeHelper; Loading Loading @@ -1150,14 +1153,16 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd mNoAmbient = noAmbient; } @Override @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void setChildLocationsChangedListener( NotificationLogger.OnChildLocationsChangedListener listener) { mListener = listener; } @Override public void setScrollAnchorView(View scrollAnchorView) { mScrollAnchorView = scrollAnchorView; } @ShadeViewRefactor(RefactorComponent.LAYOUT_ALGORITHM) public boolean isInVisibleLocation(NotificationEntry entry) { ExpandableNotificationRow row = entry.getRow(); Loading Loading @@ -1856,7 +1861,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override @ShadeViewRefactor(RefactorComponent.ADAPTER) public ViewGroup getViewParentForNotification(NotificationEntry entry) { return this; Loading Loading @@ -2546,7 +2550,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd previous); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public boolean hasPulsingNotifications() { return mPulsing; Loading Loading @@ -3050,7 +3053,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) @Override public void cleanUpViewStateForEntry(NotificationEntry entry) { View child = entry.getRow(); if (child == mSwipeHelper.getTranslatingParentView()) { Loading Loading @@ -3317,8 +3319,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void onViewAdded(View child) { super.onViewAdded(child); if (child instanceof ExpandableView) { onViewAddedInternal((ExpandableView) child); } } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) private void updateFirstAndLastBackgroundViews() { Loading Loading @@ -3350,9 +3354,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.COORDINATOR) private void onViewAddedInternal(ExpandableView child) { void onViewAddedInternal(ExpandableView child) { child.setOnHeightChangedListener(mOnChildHeightChangedListener); updateHideSensitiveForChild(child); child.setOnHeightChangedListener(this); generateAddAnimation(child, false /* fromMoreCard */); updateAnimationState(child); updateChronometerForChild(child); Loading @@ -3374,18 +3378,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd child.setHideSensitiveForIntrinsicHeight(mAmbientState.isHideSensitive()); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void notifyGroupChildRemoved(ExpandableView row, ViewGroup childrenContainer) { onViewRemovedInternal(row, childrenContainer); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void notifyGroupChildAdded(ExpandableView row) { onViewAddedInternal(row); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void setAnimationsEnabled(boolean animationsEnabled) { mAnimationsEnabled = animationsEnabled; Loading @@ -3410,33 +3407,29 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) private void updateAnimationState(View child) { void updateAnimationState(View child) { updateAnimationState((mAnimationsEnabled || hasPulsingNotifications()) && (mIsExpanded || isPinnedHeadsUp(child)), child); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setExpandingNotification(ExpandableNotificationRow row) { void setExpandingNotification(ExpandableNotificationRow row) { mAmbientState.setExpandingNotification(row); requestChildrenUpdate(); } @Override @ShadeViewRefactor(RefactorComponent.ADAPTER) public void bindRow(ExpandableNotificationRow row) { void bindRow(ExpandableNotificationRow row) { row.setHeadsUpAnimatingAwayListener(animatingAway -> { mRoundnessManager.onHeadsupAnimatingAwayChanged(row, animatingAway); mHeadsUpAppearanceController.updateHeader(row.getEntry()); }); } @Override public boolean containsView(View v) { return v.getParent() == this; } @Override @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void applyExpandAnimationParams(ExpandAnimationParameters params) { mAmbientState.setExpandAnimationTopChange(params == null ? 0 : params.getTopChange()); Loading @@ -3452,12 +3445,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public boolean isAddOrRemoveAnimationPending() { boolean isAddOrRemoveAnimationPending() { return mNeedsAnimation && (!mChildrenToAddAnimated.isEmpty() || !mChildrenToRemoveAnimated.isEmpty()); } @Override @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void generateAddAnimation(ExpandableView child, boolean fromMoreCard) { if (mIsExpanded && mAnimationsEnabled && !mChangePositionInProgress && !isFullyHidden()) { Loading @@ -3475,7 +3467,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void changeViewPosition(ExpandableView child, int newIndex) { Assert.isMainThread(); Loading Loading @@ -4471,12 +4462,12 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.COORDINATOR) public int getEmptyBottomMargin() { int getEmptyBottomMargin() { return Math.max(mMaxLayoutHeight - mContentHeight, 0); } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void checkSnoozeLeavebehind() { void checkSnoozeLeavebehind() { if (mCheckForLeavebehind) { mNotificationGutsManager.closeAndSaveGuts(true /* removeLeavebehind */, false /* force */, false /* removeControls */, -1 /* x */, -1 /* y */, Loading @@ -4486,19 +4477,19 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void resetCheckSnoozeLeavebehind() { void resetCheckSnoozeLeavebehind() { mCheckForLeavebehind = true; } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onExpansionStarted() { void onExpansionStarted() { mIsExpansionChanging = true; mAmbientState.setExpansionChanging(true); checkSnoozeLeavebehind(); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onExpansionStopped() { void onExpansionStopped() { mIsExpansionChanging = false; resetCheckSnoozeLeavebehind(); mAmbientState.setExpansionChanging(false); Loading Loading @@ -4547,20 +4538,20 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onPanelTrackingStarted() { void onPanelTrackingStarted() { mPanelTracking = true; mAmbientState.setPanelTracking(true); resetExposedMenuView(true /* animate */, true /* force */); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onPanelTrackingStopped() { void onPanelTrackingStopped() { mPanelTracking = false; mAmbientState.setPanelTracking(false); } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void resetScrollPosition() { void resetScrollPosition() { mScroller.abortAnimation(); if (ANCHOR_SCROLLING) { // TODO: once we're recycling this will need to modify the adapter position instead Loading Loading @@ -4601,15 +4592,14 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.COORDINATOR) private void updateChronometerForChild(View child) { void updateChronometerForChild(View child) { if (child instanceof ExpandableNotificationRow) { ExpandableNotificationRow row = (ExpandableNotificationRow) child; row.setChronometerRunning(mIsExpanded); } } @Override public void onHeightChanged(ExpandableView view, boolean needsAnimation) { void onChildHeightChanged(ExpandableView view, boolean needsAnimation) { updateContentHeight(); updateScrollPositionOnExpandInBottom(view); clampScrollPosition(); Loading @@ -4632,8 +4622,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd requestChildrenUpdate(); } @Override public void onReset(ExpandableView view) { void onChildHeightReset(ExpandableView view) { updateAnimationState(view); updateChronometerForChild(view); } Loading Loading @@ -4674,13 +4663,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setOnHeightChangedListener( void setOnHeightChangedListener( ExpandableView.OnHeightChangedListener onHeightChangedListener) { this.mOnHeightChangedListener = onHeightChangedListener; } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void onChildAnimationFinished() { void onChildAnimationFinished() { setAnimationRunning(false); requestChildrenUpdate(); runAnimationFinishedRunnables(); Loading Loading @@ -4724,7 +4713,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd * See {@link AmbientState#setDimmed}. */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setDimmed(boolean dimmed, boolean animate) { void setDimmed(boolean dimmed, boolean animate) { dimmed &= onKeyguard(); mAmbientState.setDimmed(dimmed); if (animate && mAnimationsEnabled) { Loading Loading @@ -4789,7 +4778,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd * See {@link AmbientState#setActivatedChild}. */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setActivatedChild(ActivatableNotificationView activatedChild) { void setActivatedChild(ActivatableNotificationView activatedChild) { mAmbientState.setActivatedChild(activatedChild); if (mAnimationsEnabled) { mActivateNeedsAnimation = true; Loading Loading @@ -4865,7 +4854,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd * @param lightTheme True if light theme should be used. */ @ShadeViewRefactor(RefactorComponent.DECORATOR) public void updateDecorViews(boolean lightTheme) { private void updateDecorViews(boolean lightTheme) { if (lightTheme == mUsingLightTheme) { return; } Loading @@ -4880,7 +4869,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void goToFullShade(long delay) { void goToFullShade(long delay) { mGoToFullShadeNeedsAnimation = true; mGoToFullShadeDelay = delay; mNeedsAnimation = true; Loading @@ -4893,13 +4882,13 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.COORDINATOR) public void setIntrinsicPadding(int intrinsicPadding) { void setIntrinsicPadding(int intrinsicPadding) { mIntrinsicPadding = intrinsicPadding; mAmbientState.setIntrinsicPadding(intrinsicPadding); } @ShadeViewRefactor(RefactorComponent.COORDINATOR) public int getIntrinsicPadding() { int getIntrinsicPadding() { return mIntrinsicPadding; } Loading Loading @@ -4933,7 +4922,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd * animation curve. */ @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setHideAmount(float linearHideAmount, float interpolatedHideAmount) { void setHideAmount(float linearHideAmount, float interpolatedHideAmount) { mLinearHideAmount = linearHideAmount; mInterpolatedHideAmount = interpolatedHideAmount; boolean wasFullyHidden = mAmbientState.isFullyHidden(); Loading Loading @@ -4975,7 +4964,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER) public void notifyHideAnimationStart(boolean hide) { void notifyHideAnimationStart(boolean hide) { // We only swap the scaling factor if we're fully hidden or fully awake to avoid // interpolation issues when playing with the power button. if (mInterpolatedHideAmount == 0 || mInterpolatedHideAmount == 1) { Loading Loading @@ -5003,7 +4992,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setFooterView(@NonNull FooterView footerView) { void setFooterView(@NonNull FooterView footerView) { int index = -1; if (mFooterView != null) { index = indexOfChild(mFooterView); Loading @@ -5014,7 +5003,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void setEmptyShadeView(EmptyShadeView emptyShadeView) { void setEmptyShadeView(EmptyShadeView emptyShadeView) { int index = -1; if (mEmptyShadeView != null) { index = indexOfChild(mEmptyShadeView); Loading @@ -5025,7 +5014,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void updateEmptyShadeView(boolean visible) { void updateEmptyShadeView(boolean visible) { mEmptyShadeView.setVisible(visible, mIsExpanded && mAnimationsEnabled); int oldTextRes = mEmptyShadeView.getTextResource(); Loading Loading @@ -5209,33 +5198,28 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public int getContainerChildCount() { return getChildCount(); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public View getContainerChildAt(int i) { return getChildAt(i); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void removeContainerView(View v) { Assert.isMainThread(); removeView(v); } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void addContainerView(View v) { Assert.isMainThread(); addView(v); } @Override public void addContainerViewAt(View v, int index) { Assert.isMainThread(); addView(v, index); Loading Loading @@ -5277,7 +5261,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd requestChildrenUpdate(); } @Override public void setWillExpand(boolean willExpand) { mWillExpand = willExpand; } Loading Loading @@ -5742,7 +5725,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override public void setNotificationActivityStarter( NotificationActivityStarter notificationActivityStarter) { mNotificationActivityStarter = notificationActivityStarter; Loading Loading @@ -5900,6 +5882,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd public void setController( NotificationStackScrollLayoutController notificationStackScrollLayoutController) { mController = notificationStackScrollLayoutController; mController.getNoticationRoundessManager().setAnimatedChildren(mChildrenToAddAnimated); } public NotificationStackScrollLayoutController getController() { Loading Loading @@ -6000,7 +5983,6 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } } @Override @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) public void resetExposedMenuView(boolean animate, boolean force) { mSwipeHelper.resetExposedMenuView(animate, force); Loading Loading @@ -6752,7 +6734,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } changedRow.setChildrenExpanded(expanded, animated); if (!mGroupExpandedForMeasure) { onHeightChanged(changedRow, false /* needsAnimation */); onChildHeightChanged(changedRow, false /* needsAnimation */); } runAfterAnimationFinished(new Runnable() { @Override Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +178 −5 File changed.Preview size limit exceeded, changes collapsed. Show changes
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +6 −1 Original line number Diff line number Diff line Loading @@ -3074,7 +3074,8 @@ public class NotificationPanelViewController extends PanelViewController { } public boolean hasPulsingNotifications() { return mNotificationStackScrollLayoutController.hasPulsingNotifications(); return mNotificationStackScrollLayoutController .getNotificationListContainer().hasPulsingNotifications(); } public ActivatableNotificationView getActivatedChild() { Loading Loading @@ -3259,6 +3260,10 @@ public class NotificationPanelViewController extends PanelViewController { return new OnConfigurationChangedListener(); } public NotificationStackScrollLayoutController getNotificationStackScrollLayoutController() { return mNotificationStackScrollLayoutController; } private class OnHeightChangedListener implements ExpandableView.OnHeightChangedListener { @Override public void onHeightChanged(ExpandableView view, boolean needsAnimation) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +15 −12 Original line number Diff line number Diff line Loading @@ -210,6 +210,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayout; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.dagger.StatusBarComponent; import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule; import com.android.systemui.statusbar.policy.BatteryController; Loading Loading @@ -646,6 +647,7 @@ public class StatusBar extends SystemUI implements DemoMode, private final BubbleController.BubbleExpandListener mBubbleExpandListener; private ActivityIntentHelper mActivityIntentHelper; private NotificationStackScrollLayoutController mStackScrollerController; /** * Public constructor for StatusBar. Loading Loading @@ -1016,9 +1018,11 @@ public class StatusBar extends SystemUI implements DemoMode, // TODO: Deal with the ugliness that comes from having some of the statusbar broken out // into fragments, but the rest here, it leaves some awkward lifecycle and whatnot. mStackScroller = mNotificationShadeWindowView.findViewById( R.id.notification_stack_scroller); NotificationListContainer notifListContainer = (NotificationListContainer) mStackScroller; mStackScrollerController = mNotificationPanelViewController.getNotificationStackScrollLayoutController(); mStackScroller = mStackScrollerController.getView(); NotificationListContainer notifListContainer = mStackScrollerController.getNotificationListContainer(); mNotificationLogger.setUpWithContainer(notifListContainer); // TODO: make this injectable. Currently that would create a circular dependency between Loading Loading @@ -1301,13 +1305,15 @@ public class StatusBar extends SystemUI implements DemoMode, mActivityLaunchAnimator = new ActivityLaunchAnimator( mNotificationShadeWindowViewController, this, mNotificationPanelViewController, mNotificationShadeDepthControllerLazy.get(), (NotificationListContainer) mStackScroller, mContext.getMainExecutor()); mStackScrollerController.getNotificationListContainer(), mContext.getMainExecutor()); // TODO: inject this. mPresenter = new StatusBarNotificationPresenter(mContext, mNotificationPanelViewController, mHeadsUpManager, mNotificationShadeWindowView, mStackScroller, mDozeScrimController, mScrimController, mActivityLaunchAnimator, mDynamicPrivacyController, mKeyguardStateController, mKeyguardIndicationController, mHeadsUpManager, mNotificationShadeWindowView, mStackScrollerController, mDozeScrimController, mScrimController, mActivityLaunchAnimator, mDynamicPrivacyController, mKeyguardStateController, mKeyguardIndicationController, this /* statusBar */, mShadeController, mCommandQueue, mInitController, mNotificationInterruptStateProvider); Loading @@ -1321,16 +1327,13 @@ public class StatusBar extends SystemUI implements DemoMode, .setNotificationPresenter(mPresenter) .setNotificationPanelViewController(mNotificationPanelViewController) .build(); ((NotificationListContainer) mStackScroller) .setNotificationActivityStarter(mNotificationActivityStarter); mStackScroller.setNotificationActivityStarter(mNotificationActivityStarter); mGutsManager.setNotificationActivityStarter(mNotificationActivityStarter); mNotificationsController.initialize( this, mPresenter, (NotificationListContainer) mStackScroller, mStackScrollerController.getNotificationListContainer(), mNotificationActivityStarter, mPresenter); } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarNotificationPresenter.java +7 −7 Original line number Diff line number Diff line Loading @@ -30,7 +30,6 @@ import android.service.vr.IVrStateCallbacks; import android.util.Log; import android.util.Slog; import android.view.View; import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.widget.TextView; Loading Loading @@ -71,7 +70,7 @@ import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow import com.android.systemui.statusbar.notification.row.NotificationGutsManager; import com.android.systemui.statusbar.notification.row.NotificationGutsManager.OnSettingsClickListener; import com.android.systemui.statusbar.notification.row.NotificationInfo.CheckSaveListener; import com.android.systemui.statusbar.notification.stack.NotificationListContainer; import com.android.systemui.statusbar.notification.stack.NotificationStackScrollLayoutController; import com.android.systemui.statusbar.phone.LockscreenGestureLogger.LockscreenUiEvent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; Loading Loading @@ -133,7 +132,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, NotificationPanelViewController panel, HeadsUpManagerPhone headsUp, NotificationShadeWindowView statusBarWindow, ViewGroup stackScroller, NotificationStackScrollLayoutController stackScrollerController, DozeScrimController dozeScrimController, ScrimController scrimController, ActivityLaunchAnimator activityLaunchAnimator, Loading @@ -155,7 +154,7 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, mStatusBar = statusBar; mShadeController = shadeController; mCommandQueue = commandQueue; mAboveShelfObserver = new AboveShelfObserver(stackScroller); mAboveShelfObserver = new AboveShelfObserver(stackScrollerController.getView()); mActivityLaunchAnimator = activityLaunchAnimator; mAboveShelfObserver.setListener(statusBarWindow.findViewById( R.id.notification_container_parent)); Loading Loading @@ -190,7 +189,6 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, remoteInputManager.getController().addCallback( Dependency.get(NotificationShadeWindowController.class)); NotificationListContainer notifListContainer = (NotificationListContainer) stackScroller; initController.addPostInitTask(() -> { NotificationEntryListener notificationEntryListener = new NotificationEntryListener() { @Override Loading @@ -207,7 +205,8 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, } }; mViewHierarchyManager.setUpWithPresenter(this, notifListContainer); mViewHierarchyManager.setUpWithPresenter(this, stackScrollerController.getNotificationListContainer()); mEntryManager.setUpWithPresenter(this); mEntryManager.addNotificationEntryListener(notificationEntryListener); mEntryManager.addNotificationLifetimeExtender(mHeadsUpManager); Loading @@ -219,7 +218,8 @@ public class StatusBarNotificationPresenter implements NotificationPresenter, mMediaManager.setUpWithPresenter(this); mVisualStabilityManager.setUpWithPresenter(this); mGutsManager.setUpWithPresenter(this, notifListContainer, mCheckSaveListener, mOnSettingsClickListener); stackScrollerController.getNotificationListContainer(), mCheckSaveListener, mOnSettingsClickListener); // ForegroundServiceNotificationListener adds its listener in its constructor // but we need to request it here in order for it to be instantiated. // TODO: figure out how to do this correctly once Dependency.get() is gone. Loading