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

Commit 7a7c187f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Remove circular ref from MessagingLinearLayout" into rvc-dev am: f3351611

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11971391

Change-Id: I14a56170aca3333661f2a200c48ffbe1b9555158
parents 276598a4 f3351611
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -197,7 +197,6 @@ public class ConversationLayout extends FrameLayout
        super.onFinishInflate();
        mMessagingLinearLayout = findViewById(R.id.notification_messaging);
        mActions = findViewById(R.id.actions);
        mMessagingLinearLayout.setMessagingLayout(this);
        mImageMessageContainer = findViewById(R.id.conversation_image_message_container);
        // We still want to clip, but only on the top, since views can temporarily out of bounds
        // during transitions.
+0 −1
Original line number Diff line number Diff line
@@ -124,7 +124,6 @@ public class MessagingLayout extends FrameLayout
    protected void onFinishInflate() {
        super.onFinishInflate();
        mMessagingLinearLayout = findViewById(R.id.notification_messaging);
        mMessagingLinearLayout.setMessagingLayout(this);
        // We still want to clip, but only on the top, since views can temporarily out of bounds
        // during transitions.
        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
+13 −7
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.util.AttributeSet;
import android.view.RemotableViewMethod;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.widget.RemoteViews;

import com.android.internal.R;
@@ -43,8 +44,6 @@ public class MessagingLinearLayout extends ViewGroup {

    private int mMaxDisplayedLines = Integer.MAX_VALUE;

    private IMessagingLayout mMessagingLayout;

    public MessagingLinearLayout(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);

@@ -292,12 +291,19 @@ public class MessagingLinearLayout extends ViewGroup {
        mMaxDisplayedLines = numberLines;
    }

    public void setMessagingLayout(IMessagingLayout layout) {
        mMessagingLayout = layout;
    }

    public IMessagingLayout getMessagingLayout() {
        return mMessagingLayout;
        View view = this;
        while (true) {
            ViewParent p = view.getParent();
            if (p instanceof View) {
                view = (View) p;
                if (view instanceof IMessagingLayout) {
                    return (IMessagingLayout) view;
                }
            } else {
                return null;
            }
        }
    }

    @Override