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

Commit 98be3f37 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed that the expandButton was sometimes visible when it shouldnt

This happened when the collapsed height had the same height as the
expanded one.

Bug: 26185377
Change-Id: I9c37a8239cc87bf2192f48bc008700faf4afb5d9
parent 28387895
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@
    <dimen name="notification_max_heads_up_height_legacy">128dp</dimen>

    <!-- Height of a heads up notification in the status bar -->
    <dimen name="notification_max_heads_up_height">140dp</dimen>
    <dimen name="notification_max_heads_up_height">141dp</dimen>

    <!-- Height of a the summary ("more card") notification on keyguard. -->
    <dimen name="notification_summary_height">44dp</dimen>
+10 −0
Original line number Diff line number Diff line
@@ -107,6 +107,8 @@ public class NotificationContentView extends FrameLayout {
    };
    private OnClickListener mExpandClickListener;
    private boolean mBeforeN;
    private boolean mExpandable;

    public NotificationContentView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mHybridViewManager = new HybridNotificationViewManager(getContext(), this);
@@ -491,6 +493,7 @@ public class NotificationContentView extends FrameLayout {
    public void setHeadsUp(boolean headsUp) {
        mIsHeadsUp = headsUp;
        selectLayout(false /* animate */, true /* force */);
        updateExpandButtons(mExpandable);
    }

    @Override
@@ -610,6 +613,13 @@ public class NotificationContentView extends FrameLayout {
    }

    public void updateExpandButtons(boolean expandable) {
        mExpandable = expandable;
        // if the expanded child has the same height as the collapsed one we hide it.
        if (mExpandedChild != null && mExpandedChild.getHeight() != 0 &&
                ((mIsHeadsUp && mExpandedChild.getHeight() == mHeadsUpChild.getHeight()) ||
                (!mIsHeadsUp && mExpandedChild.getHeight() == mContractedChild.getHeight()))) {
            expandable = false;
        }
        if (mExpandedChild != null) {
            mExpandedWrapper.updateExpandability(expandable, mExpandClickListener);
        }