2020
2121import com .android .systemui .statusbar .notification .NotificationSectionsFeatureManager ;
2222import com .android .systemui .statusbar .notification .collection .NotificationEntry ;
23- import com .android .systemui .statusbar .notification .row .ActivatableNotificationView ;
2423import com .android .systemui .statusbar .notification .row .ExpandableNotificationRow ;
2524import com .android .systemui .statusbar .notification .row .ExpandableView ;
2625import com .android .systemui .statusbar .phone .KeyguardBypassController ;
3736@ Singleton
3837public class NotificationRoundnessManager implements OnHeadsUpChangedListener {
3938
40- private final ActivatableNotificationView [] mFirstInSectionViews ;
41- private final ActivatableNotificationView [] mLastInSectionViews ;
42- private final ActivatableNotificationView [] mTmpFirstInSectionViews ;
43- private final ActivatableNotificationView [] mTmpLastInSectionViews ;
39+ private final ExpandableView [] mFirstInSectionViews ;
40+ private final ExpandableView [] mLastInSectionViews ;
41+ private final ExpandableView [] mTmpFirstInSectionViews ;
42+ private final ExpandableView [] mTmpLastInSectionViews ;
4443 private final KeyguardBypassController mBypassController ;
4544 private boolean mExpanded ;
4645 private HashSet <ExpandableView > mAnimatedChildren ;
@@ -53,10 +52,10 @@ public class NotificationRoundnessManager implements OnHeadsUpChangedListener {
5352 KeyguardBypassController keyguardBypassController ,
5453 NotificationSectionsFeatureManager sectionsFeatureManager ) {
5554 int numberOfSections = sectionsFeatureManager .getNumberOfBuckets ();
56- mFirstInSectionViews = new ActivatableNotificationView [numberOfSections ];
57- mLastInSectionViews = new ActivatableNotificationView [numberOfSections ];
58- mTmpFirstInSectionViews = new ActivatableNotificationView [numberOfSections ];
59- mTmpLastInSectionViews = new ActivatableNotificationView [numberOfSections ];
55+ mFirstInSectionViews = new ExpandableView [numberOfSections ];
56+ mLastInSectionViews = new ExpandableView [numberOfSections ];
57+ mTmpFirstInSectionViews = new ExpandableView [numberOfSections ];
58+ mTmpLastInSectionViews = new ExpandableView [numberOfSections ];
6059 mBypassController = keyguardBypassController ;
6160 }
6261
@@ -80,14 +79,14 @@ public void onHeadsUpStateChanged(NotificationEntry entry, boolean isHeadsUp) {
8079 updateView (entry .getRow (), false /* animate */ );
8180 }
8281
83- private void updateView (ActivatableNotificationView view , boolean animate ) {
82+ private void updateView (ExpandableView view , boolean animate ) {
8483 boolean changed = updateViewWithoutCallback (view , animate );
8584 if (changed ) {
8685 mRoundingChangedCallback .run ();
8786 }
8887 }
8988
90- private boolean updateViewWithoutCallback (ActivatableNotificationView view ,
89+ private boolean updateViewWithoutCallback (ExpandableView view ,
9190 boolean animate ) {
9291 float topRoundness = getRoundness (view , true /* top */ );
9392 float bottomRoundness = getRoundness (view , false /* top */ );
@@ -100,8 +99,7 @@ private boolean updateViewWithoutCallback(ActivatableNotificationView view,
10099 return (firstInSection || lastInSection ) && (topChanged || bottomChanged );
101100 }
102101
103- private boolean isFirstInSection (ActivatableNotificationView view ,
104- boolean includeFirstSection ) {
102+ private boolean isFirstInSection (ExpandableView view , boolean includeFirstSection ) {
105103 int numNonEmptySections = 0 ;
106104 for (int i = 0 ; i < mFirstInSectionViews .length ; i ++) {
107105 if (view == mFirstInSectionViews [i ]) {
@@ -114,7 +112,7 @@ private boolean isFirstInSection(ActivatableNotificationView view,
114112 return false ;
115113 }
116114
117- private boolean isLastInSection (ActivatableNotificationView view , boolean includeLastSection ) {
115+ private boolean isLastInSection (ExpandableView view , boolean includeLastSection ) {
118116 int numNonEmptySections = 0 ;
119117 for (int i = mLastInSectionViews .length - 1 ; i >= 0 ; i --) {
120118 if (view == mLastInSectionViews [i ]) {
@@ -127,7 +125,7 @@ private boolean isLastInSection(ActivatableNotificationView view, boolean includ
127125 return false ;
128126 }
129127
130- private float getRoundness (ActivatableNotificationView view , boolean top ) {
128+ private float getRoundness (ExpandableView view , boolean top ) {
131129 if ((view .isPinned () || view .isHeadsUpAnimatingAway ()) && !mExpanded ) {
132130 return 1.0f ;
133131 }
@@ -174,14 +172,14 @@ public void updateRoundedChildren(NotificationSection[] sections) {
174172 }
175173
176174 private boolean handleRemovedOldViews (NotificationSection [] sections ,
177- ActivatableNotificationView [] oldViews , boolean first ) {
175+ ExpandableView [] oldViews , boolean first ) {
178176 boolean anyChanged = false ;
179- for (ActivatableNotificationView oldView : oldViews ) {
177+ for (ExpandableView oldView : oldViews ) {
180178 if (oldView != null ) {
181179 boolean isStillPresent = false ;
182180 boolean adjacentSectionChanged = false ;
183181 for (NotificationSection section : sections ) {
184- ActivatableNotificationView newView =
182+ ExpandableView newView =
185183 (first ? section .getFirstVisibleChild ()
186184 : section .getLastVisibleChild ());
187185 if (newView == oldView ) {
@@ -207,14 +205,14 @@ private boolean handleRemovedOldViews(NotificationSection[] sections,
207205 }
208206
209207 private boolean handleAddedNewViews (NotificationSection [] sections ,
210- ActivatableNotificationView [] oldViews , boolean first ) {
208+ ExpandableView [] oldViews , boolean first ) {
211209 boolean anyChanged = false ;
212210 for (NotificationSection section : sections ) {
213- ActivatableNotificationView newView =
211+ ExpandableView newView =
214212 (first ? section .getFirstVisibleChild () : section .getLastVisibleChild ());
215213 if (newView != null ) {
216214 boolean wasAlreadyPresent = false ;
217- for (ActivatableNotificationView oldView : oldViews ) {
215+ for (ExpandableView oldView : oldViews ) {
218216 if (oldView == newView ) {
219217 wasAlreadyPresent = true ;
220218 break ;
0 commit comments