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

Commit 7b75db9f authored by András Kurucz's avatar András Kurucz
Browse files

Fix calculating Notification amountInShelf

ExpandableView#isInShelf() returns true if a Notification is fully
scrolled into the shelf.
After the change I2735055775632649c418880322e7e197acfd84e7 we have left a check for isInShelf, for calculating the amountInShelf fraction for a notification that is partially scrolled into the shelf. This prevented us from doing an alpha and a translateY animation on the shelf icons.

Fixes: 319642729
Test: atest NotificationShelfTest
Test: post some notifications, open the shade, and scoll them into the
shade
Flag: NONE

Change-Id: Id8d6ff7e645e6a83a650ff00a4b026aec87ae6ec
parent 60f5711d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -766,7 +766,6 @@ public class NotificationShelf extends ActivatableNotificationView {
            }

        } else if (viewEnd >= shelfClipStart
                && view.isInShelf()
                && (mAmbientState.isShadeExpanded()
                || (!view.isPinned() && !view.isHeadsUpAnimatingAway()))) {

+3 −0
Original line number Diff line number Diff line
@@ -720,6 +720,9 @@ public abstract class ExpandableView extends FrameLayout implements Dumpable, Ro
        mInShelf = inShelf;
    }

    /**
     * @return true if the view is currently fully in the notification shelf.
     */
    public boolean isInShelf() {
        return mInShelf;
    }
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ open class NotificationShelfTest : SysuiTestCase() {

        whenever(expandableView.minHeight).thenReturn(25)
        whenever(expandableView.shelfTransformationTarget).thenReturn(null) // use translationY
        whenever(expandableView.isInShelf).thenReturn(true)
        whenever(expandableView.isInShelf).thenReturn(false)

        whenever(ambientState.isOnKeyguard).thenReturn(true)
        whenever(ambientState.isExpansionChanging).thenReturn(false)