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

Commit 4ca6c63c authored by Selim Cinek's avatar Selim Cinek
Browse files

Worked around a bug where the view could render blank

Heads up notifications could render blank due to a
bug with invalidation. This works around this issue
by manually invalidating the parent.

Change-Id: I858d1c95bc936f5b14fc3485b2d54d76717c2537
Fixes: 34660898
parent c8df064d
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.view.MotionEvent;
import android.view.NotificationHeaderView;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.ViewStub;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
@@ -1748,7 +1749,17 @@ public class ExpandableNotificationRow extends ActivatableNotificationView {

    @Override
    public void setActualHeight(int height, boolean notifyListeners) {
        boolean changed = height != getActualHeight();
        super.setActualHeight(height, notifyListeners);
        if (changed && isRemoved()) {
            // TODO: remove this once we found the gfx bug for this.
            // This is a hack since a removed view sometimes would just stay blank. it occured
            // when sending yourself a message and then clicking on it.
            ViewGroup parent = (ViewGroup) getParent();
            if (parent != null) {
                parent.invalidate();
            }
        }
        if (mGuts != null && mGuts.isExposed()) {
            mGuts.setActualHeight(height);
            return;
+2 −1
Original line number Diff line number Diff line
@@ -1184,7 +1184,8 @@ public class NotificationContentView extends FrameLayout {
        mExpandable = expandable;
        // if the expanded child has the same height as the collapsed one we hide it.
        if (mExpandedChild != null && mExpandedChild.getHeight() != 0) {
            if (!mIsHeadsUp || mHeadsUpChild == null || mContainingNotification.isOnKeyguard()) {
            if ((!mIsHeadsUp && !mHeadsUpAnimatingAway)
                    || mHeadsUpChild == null || mContainingNotification.isOnKeyguard()) {
                if (mExpandedChild.getHeight() == mContractedChild.getHeight()) {
                    expandable = false;
                }
+0 −6
Original line number Diff line number Diff line
@@ -524,11 +524,5 @@ public class NotificationIconContainer extends AlphaOptimizedFrameLayout {
                iconColor = ((StatusBarIconView) view).getStaticDrawableColor();
            }
        }

        protected void onYTranslationAnimationFinished(View view) {
            if (hidden) {
                view.setVisibility(INVISIBLE);
            }
        }
    }
}