Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 938bdaa8 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed a bug where the last notification could be invisible / faded

if the last notification was small, it was already fading out in
the resting state.

Test: add a small notification without text and title and have it as
      last notification in the shade. Observe that it's not faded out.
Bug: 32437839
Change-Id: I4acd429e363185276fe1f472ecbeddae8f56e45a
parent f9bba0b0
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -218,7 +218,8 @@ public class NotificationShelf extends ActivatableNotificationView {
                }
            }
            updateNotificationClipHeight(row, notificationClipEnd);
            float inShelfAmount = updateIconAppearance(row, iconState, icon, expandAmount);
            float inShelfAmount = updateIconAppearance(row, iconState, icon, expandAmount,
                    isLastChild);
            numViewsInShelf += inShelfAmount;
            int ownColorUntinted = row.getBackgroundColorWithoutTint();
            if (row.getTranslationY() >= getTranslationY() && mNotGoneIndex == -1) {
@@ -271,10 +272,14 @@ public class NotificationShelf extends ActivatableNotificationView {
     */
    private float updateIconAppearance(ExpandableNotificationRow row,
            NotificationIconContainer.IconState iconState, StatusBarIconView icon,
            float expandAmount) {
            float expandAmount, boolean isLastChild) {
        // Let calculate how much the view is in the shelf
        float viewStart = row.getTranslationY();
        int transformHeight = row.getActualHeight() + mPaddingBetweenElements;
        if (isLastChild) {
            transformHeight =
                    Math.min(transformHeight, row.getMinHeight() - getIntrinsicHeight());
        }
        float viewEnd = viewStart + transformHeight;
        float iconAppearAmount;
        float yTranslation;
@@ -312,6 +317,10 @@ public class NotificationShelf extends ActivatableNotificationView {
        float shelfIconPosition = getTranslationY() + icon.getTop();
        shelfIconPosition += ((1.0f - icon.getIconScale()) * icon.getHeight()) / 2.0f;
        float transitionDistance = getIntrinsicHeight() * 1.5f;
        if (isLastChild) {
            transitionDistance = Math.min(transitionDistance, row.getMinHeight()
                    - getIntrinsicHeight());
        }
        float transformationStartPosition = getTranslationY() - transitionDistance;
        float transitionAmount = 0.0f;
        if (viewStart < transformationStartPosition