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

Commit fc64eee9 authored by Ibrahim Yilmaz's avatar Ibrahim Yilmaz
Browse files

[Notification Content Cut Off] Messaging child requestLayout

MessagingLinearLayout is using hide parameter to decide children visibility in onMeasure, assuming that they are always measured.
measureChildren methods call measure method of View and if there is existing measured dimensions, it reuses them by passing onMeasure.
This cause MessagingLinearLayout not to update its children hide property correctly and cause corrupted MessagingLinearLayout.

Bug: 324537506
Test: SystemUITests & Post Conversation Group with short actions and trigger 4 times orientation change. Conversation Group should look correct and there shouldnt be any content cut off
Flag: ACONFIG messaging_child_request_layout DEVELOPMENT
Change-Id: I53705d614efcb73fefc5a90c09e189b8aa0fa172
parent 377d85d8
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -47,3 +47,13 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
  name: "messaging_child_request_layout"
  namespace: "systemui"
  description: "MessagingChild always needs to be measured during MessagingLinearLayout onMeasure."
  bug: "324537506"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.internal.widget;

import static android.widget.flags.Flags.messagingChildRequestLayout;

import android.annotation.Nullable;
import android.annotation.Px;
import android.content.Context;
@@ -92,6 +94,10 @@ public class MessagingLinearLayout extends ViewGroup {
            final View child = getChildAt(i);
            final LayoutParams lp = (LayoutParams) child.getLayoutParams();
            lp.hide = true;
            // Child always needs to be measured to calculate hide property correctly in onMeasure.
            if (messagingChildRequestLayout()) {
                child.requestLayout();
            }
            if (child instanceof MessagingChild) {
                MessagingChild messagingChild = (MessagingChild) child;
                // Whenever we encounter the message first, it's always first in the layout