summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java69
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/ConversationNotifications.kt3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java15
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java30
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java15
10 files changed, 15 insertions, 165 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
index d2ddd212bda6..5e8245f8e0e8 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShelf.java
@@ -527,7 +527,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
handleCustomTransformHeight(view, expandingAnimated, iconState);
float fullTransitionAmount;
- float transitionAmount;
+ float iconTransitionAmount;
float contentTransformationAmount;
float shelfStart = getTranslationY();
boolean fullyInOrOut = true;
@@ -549,18 +549,19 @@ public class NotificationShelf extends ActivatableNotificationView implements
fullTransitionAmount = 1.0f - interpolatedAmount;
if (isLastChild) {
- // If it's the last child we should use all of the notification to transform
- // instead of just to the icon, since that can be quite low.
- transitionAmount = (shelfStart - viewStart) / transformDistance;
+ // Reduce icon transform distance to completely fade in shelf icon
+ // by the time the notification icon fades out, and vice versa
+ iconTransitionAmount = (shelfStart - viewStart)
+ / (iconTransformStart - viewStart);
} else {
- transitionAmount = (shelfStart - iconTransformStart) / transformDistance;
+ iconTransitionAmount = (shelfStart - iconTransformStart) / transformDistance;
}
- transitionAmount = MathUtils.constrain(transitionAmount, 0.0f, 1.0f);
- transitionAmount = 1.0f - transitionAmount;
+ iconTransitionAmount = MathUtils.constrain(iconTransitionAmount, 0.0f, 1.0f);
+ iconTransitionAmount = 1.0f - iconTransitionAmount;
fullyInOrOut = false;
} else {
fullTransitionAmount = 1.0f;
- transitionAmount = 1.0f;
+ iconTransitionAmount = 1.0f;
}
// Transforming the content
@@ -569,7 +570,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
contentTransformationAmount = 1.0f - contentTransformationAmount;
} else {
fullTransitionAmount = 0.0f;
- transitionAmount = 0.0f;
+ iconTransitionAmount = 0.0f;
contentTransformationAmount = 0.0f;
}
if (iconState != null && fullyInOrOut && !expandingAnimated && iconState.isLastExpandIcon) {
@@ -585,7 +586,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
view.setContentTransformationAmount(contentTransformationAmount, isLastChild);
// Update the positioning of the icon
- updateIconPositioning(view, transitionAmount, fullTransitionAmount,
+ updateIconPositioning(view, iconTransitionAmount, fullTransitionAmount,
transformDistance, scrolling, scrollingFast, expandingAnimated, isLastChild);
return fullTransitionAmount;
@@ -679,8 +680,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
|| iconState.useLinearTransitionAmount) {
transitionAmount = iconTransitionAmount;
} else {
- // We take the clamped position instead
- transitionAmount = clampedAmount;
+ transitionAmount = iconTransitionAmount;
iconState.needsCannedAnimation = iconState.clampedAppearAmount != clampedAmount
&& !mNoAnimationsInThisFrame;
}
@@ -689,8 +689,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
? fullTransitionAmount
: transitionAmount;
iconState.clampedAppearAmount = clampedAmount;
- setIconTransformationAmount(view, transitionAmount, iconTransformDistance,
- clampedAmount != transitionAmount, isLastChild);
+ setIconTransformationAmount(view, transitionAmount, isLastChild);
}
private boolean isTargetClipped(ExpandableView view) {
@@ -708,7 +707,7 @@ public class NotificationShelf extends ActivatableNotificationView implements
}
private void setIconTransformationAmount(ExpandableView view,
- float transitionAmount, float iconTransformDistance, boolean usingLinearInterpolation,
+ float transitionAmount,
boolean isLastChild) {
if (!(view instanceof ExpandableNotificationRow)) {
return;
@@ -720,42 +719,13 @@ public class NotificationShelf extends ActivatableNotificationView implements
View rowIcon = row.getShelfTransformationTarget();
// Let's resolve the relative positions of the icons
- float notificationIconSize = 0.0f;
- int iconTopPadding;
int iconStartPadding;
if (rowIcon != null) {
- iconTopPadding = row.getRelativeTopPadding(rowIcon);
iconStartPadding = row.getRelativeStartPadding(rowIcon);
- notificationIconSize = rowIcon.getHeight();
} else {
- iconTopPadding = mIconAppearTopPadding;
iconStartPadding = 0;
}
-
- float shelfIconSize = mAmbientState.isFullyHidden() ? mHiddenShelfIconSize : mIconSize;
- shelfIconSize = shelfIconSize * icon.getIconScale();
-
- // Get the icon correctly positioned in Y
- float notificationIconPositionY = row.getTranslationY() + row.getContentTranslation();
- float targetYPosition = 0;
boolean stayingInShelf = row.isInShelf() && !row.isTransformingIntoShelf();
- if (usingLinearInterpolation && !stayingInShelf) {
- // If we interpolate from the notification position, this might lead to a slightly
- // odd interpolation, since the notification position changes as well.
- // Let's instead interpolate directly to the top left of the notification
- targetYPosition = NotificationUtils.interpolate(
- Math.min(notificationIconPositionY + mIconAppearTopPadding
- - getTranslationY(), 0),
- 0,
- transitionAmount);
- }
- notificationIconPositionY += iconTopPadding;
- float shelfIconPositionY = getTranslationY() + icon.getTop();
- shelfIconPositionY += (icon.getHeight() - shelfIconSize) / 2.0f;
- float iconYTranslation = NotificationUtils.interpolate(
- notificationIconPositionY - shelfIconPositionY,
- targetYPosition,
- transitionAmount);
// Get the icon correctly positioned in X
// Even in RTL it's the left, since we're inverting the location in post
@@ -767,28 +737,19 @@ public class NotificationShelf extends ActivatableNotificationView implements
transitionAmount);
// Let's handle the case that there's no Icon
- float alpha = 1.0f;
boolean noIcon = !row.isShowingIcon();
if (noIcon) {
// The view currently doesn't have an icon, lets transform it in!
- alpha = transitionAmount;
- notificationIconSize = shelfIconSize / 2.0f;
iconXTranslation = mShelfIcons.getActualPaddingStart();
}
- // The notification size is different from the size in the shelf / statusbar
- float newSize = NotificationUtils.interpolate(notificationIconSize, shelfIconSize,
- transitionAmount);
if (iconState != null) {
- iconState.scaleX = newSize / shelfIconSize;
- iconState.scaleY = iconState.scaleX;
iconState.hidden = transitionAmount == 0.0f && !iconState.isAnimating(icon);
boolean isAppearing = row.isDrawingAppearAnimation() && !row.isInShelf();
if (isAppearing) {
iconState.hidden = true;
iconState.iconAppearAmount = 0.0f;
}
- iconState.alpha = alpha;
- iconState.yTranslation = iconYTranslation;
+ iconState.alpha = transitionAmount;
iconState.xTranslation = iconXTranslation;
if (stayingInShelf) {
iconState.iconAppearAmount = 1.0f;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ConversationNotifications.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ConversationNotifications.kt
index d1ab7ea55d57..004cf9968a77 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/ConversationNotifications.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/ConversationNotifications.kt
@@ -180,9 +180,6 @@ class ConversationNotificationManager @Inject constructor(
}
if (changed) {
notificationGroupManager.updateIsolation(entry)
- // ensure that the conversation icon isn't hidden
- // (ex: if it was showing in the shelf)
- entry.row?.updateIconVisibilities()
}
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
index 8a22b9f6891f..dbd8580b751e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntry.java
@@ -176,7 +176,6 @@ public final class NotificationEntry extends ListEntry {
private int mBucket = BUCKET_ALERTING;
@Nullable private Long mPendingAnimationDuration;
private boolean mIsMarkedForUserTriggeredMovement;
- private boolean mShelfIconVisible;
private boolean mIsAlerting;
public boolean mRemoteEditImeVisible;
@@ -417,7 +416,6 @@ public final class NotificationEntry extends ListEntry {
//TODO: This will go away when we have a way to bind an entry to a row
public void setRow(ExpandableNotificationRow row) {
this.row = row;
- updateShelfIconVisibility();
}
public ExpandableNotificationRowController getRowController() {
@@ -938,19 +936,6 @@ public final class NotificationEntry extends ListEntry {
return mIsMarkedForUserTriggeredMovement;
}
- /** Whether or not the icon for this notification is visible in the shelf. */
- public void setShelfIconVisible(boolean shelfIconVisible) {
- if (row == null) return;
- mShelfIconVisible = shelfIconVisible;
- updateShelfIconVisibility();
- }
-
- private void updateShelfIconVisibility() {
- if (row != null) {
- row.setShelfIconVisible(mShelfIconVisible);
- }
- }
-
/**
* Mark this entry for movement triggered by a user action (ex: changing the priorirty of a
* conversation). This can then be used for custom animations.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
index ba45f9a687ed..5375ac345e50 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/icon/IconManager.kt
@@ -95,11 +95,6 @@ class IconManager @Inject constructor(
// Construct the shelf icon view.
val shelfIcon = iconBuilder.createIconView(entry)
shelfIcon.scaleType = ImageView.ScaleType.CENTER_INSIDE
-
- // TODO: This doesn't belong here
- shelfIcon.setOnVisibilityChangedListener { newVisibility: Int ->
- entry.setShelfIconVisible(newVisibility == View.VISIBLE)
- }
shelfIcon.visibility = View.INVISIBLE
// Construct the aod icon view.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
index 1251b58171da..bc4f83993973 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java
@@ -331,7 +331,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
private boolean mHeadsupDisappearRunning;
private View mChildAfterViewWhenDismissed;
private View mGroupParentWhenDismissed;
- private boolean mShelfIconVisible;
private boolean mAboveShelf;
private OnUserInteractionCallback mOnUserInteractionCallback;
private NotificationGutsManager mNotificationGutsManager;
@@ -568,7 +567,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
// The public layouts expand button is always visible
mPublicLayout.updateExpandButtons(true);
updateLimits();
- updateIconVisibilities();
updateShelfIconColor();
updateRippleAllowed();
if (mUpdateBackgroundOnUpdate) {
@@ -883,7 +881,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
setDistanceToTopRoundness(NO_ROUNDNESS);
mNotificationParent.updateBackgroundForGroupState();
}
- updateIconVisibilities();
updateBackgroundClipping();
}
@@ -1481,21 +1478,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
return getShelfTransformationTarget() != null;
}
- /**
- * Set the icons to be visible of this notification.
- */
- public void setShelfIconVisible(boolean iconVisible) {
- if (iconVisible != mShelfIconVisible) {
- mShelfIconVisible = iconVisible;
- updateIconVisibilities();
- }
- }
-
- @Override
- protected void onBelowSpeedBumpChanged() {
- updateIconVisibilities();
- }
-
@Override
protected void updateContentTransformation() {
if (mExpandAnimationRunning) {
@@ -1522,18 +1504,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
}
}
- /** Refreshes the visibility of notification icons */
- public void updateIconVisibilities() {
- // The shelf icon is never hidden for children in groups
- boolean visible = !isChildInGroup() && mShelfIconVisible;
- for (NotificationContentView l : mLayouts) {
- l.setShelfIconVisible(visible);
- }
- if (mChildrenContainer != null) {
- mChildrenContainer.setShelfIconVisible(visible);
- }
- }
-
public void setIsLowPriority(boolean isLowPriority) {
mIsLowPriority = isLowPriority;
mPrivateLayout.setIsLowPriority(isLowPriority);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
index 76917612b910..4f5d4916b3f0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationContentView.java
@@ -169,7 +169,6 @@ public class NotificationContentView extends FrameLayout {
private int mContentHeightAtAnimationStart = UNDEFINED;
private boolean mFocusOnVisibilityChange;
private boolean mHeadsUpAnimatingAway;
- private boolean mShelfIconVisible;
private int mClipBottomAmount;
private boolean mIsLowPriority;
private boolean mIsContentExpandable;
@@ -1729,23 +1728,6 @@ public class NotificationContentView extends FrameLayout {
mFocusOnVisibilityChange = true;
}
- public void setShelfIconVisible(boolean iconsVisible) {
- mShelfIconVisible = iconsVisible;
- updateIconVisibilities();
- }
-
- private void updateIconVisibilities() {
- if (mContractedWrapper != null) {
- mContractedWrapper.setShelfIconVisible(mShelfIconVisible);
- }
- if (mHeadsUpWrapper != null) {
- mHeadsUpWrapper.setShelfIconVisible(mShelfIconVisible);
- }
- if (mExpandedWrapper != null) {
- mExpandedWrapper.setShelfIconVisible(mShelfIconVisible);
- }
- }
-
@Override
public void onVisibilityAggregated(boolean isVisible) {
super.onVisibilityAggregated(isVisible);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt
index 905bccfa6cdf..fb0fdcccd4b1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationConversationTemplateViewWrapper.kt
@@ -132,20 +132,6 @@ class NotificationConversationTemplateViewWrapper constructor(
)
}
- override fun setShelfIconVisible(visible: Boolean) {
- if (conversationLayout.isImportantConversation) {
- if (conversationIconView.visibility != View.GONE) {
- conversationIconView.isForceHidden = visible
- // We don't want the small icon to be hidden by the extended wrapper, as force
- // hiding the conversationIcon will already do that via its listener.
- return
- }
- } else {
- conversationIconView.isForceHidden = false
- }
- super.setShelfIconVisible(visible)
- }
-
override fun getShelfTransformationTarget(): View? =
if (conversationLayout.isImportantConversation)
if (conversationIconView.visibility != View.GONE)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java
index eb79e3c8a69a..bdafd232167d 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationHeaderViewWrapper.java
@@ -313,12 +313,6 @@ public class NotificationHeaderViewWrapper extends NotificationViewWrapper {
}
@Override
- public void setShelfIconVisible(boolean visible) {
- super.setShelfIconVisible(visible);
- mIcon.setForceHidden(visible);
- }
-
- @Override
public TransformState getCurrentState(int fadingView) {
return mTransformationHelper.getCurrentState(fadingView);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
index 89babf0835c6..9ced12d32d27 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationViewWrapper.java
@@ -331,11 +331,6 @@ public abstract class NotificationViewWrapper implements TransformableView {
return null;
}
- /**
- * Set the shelf icon to be visible and hide our own icons.
- */
- public void setShelfIconVisible(boolean shelfIconVisible) {}
-
public int getHeaderTranslation(boolean forceNoHeader) {
return 0;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
index 3833637e8542..d1337fb88dbd 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationChildrenContainer.java
@@ -1225,21 +1225,6 @@ public class NotificationChildrenContainer extends ViewGroup {
return 0;
}
- public void setShelfIconVisible(boolean iconVisible) {
- if (mNotificationHeaderWrapper != null) {
- CachingIconView icon = mNotificationHeaderWrapper.getIcon();
- if (icon != null) {
- icon.setForceHidden(iconVisible);
- }
- }
- if (mNotificationHeaderWrapperLowPriority != null) {
- CachingIconView icon = mNotificationHeaderWrapperLowPriority.getIcon();
- if (icon != null) {
- icon.setForceHidden(iconVisible);
- }
- }
- }
-
public void setClipBottomAmount(int clipBottomAmount) {
mClipBottomAmount = clipBottomAmount;
updateChildrenClipping();