Merge "Remove circular ref from MessagingLinearLayout" into rvc-dev am: f33516115a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11971391 Change-Id: Id905112a84a4d418bc87f40a6fa2171d0d5ed5a2
This commit is contained in:
@@ -197,7 +197,6 @@ public class ConversationLayout extends FrameLayout
|
|||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
mMessagingLinearLayout = findViewById(R.id.notification_messaging);
|
mMessagingLinearLayout = findViewById(R.id.notification_messaging);
|
||||||
mActions = findViewById(R.id.actions);
|
mActions = findViewById(R.id.actions);
|
||||||
mMessagingLinearLayout.setMessagingLayout(this);
|
|
||||||
mImageMessageContainer = findViewById(R.id.conversation_image_message_container);
|
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
|
// We still want to clip, but only on the top, since views can temporarily out of bounds
|
||||||
// during transitions.
|
// during transitions.
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ public class MessagingLayout extends FrameLayout
|
|||||||
protected void onFinishInflate() {
|
protected void onFinishInflate() {
|
||||||
super.onFinishInflate();
|
super.onFinishInflate();
|
||||||
mMessagingLinearLayout = findViewById(R.id.notification_messaging);
|
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
|
// We still want to clip, but only on the top, since views can temporarily out of bounds
|
||||||
// during transitions.
|
// during transitions.
|
||||||
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
|
DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import android.util.AttributeSet;
|
|||||||
import android.view.RemotableViewMethod;
|
import android.view.RemotableViewMethod;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.view.ViewParent;
|
||||||
import android.widget.RemoteViews;
|
import android.widget.RemoteViews;
|
||||||
|
|
||||||
import com.android.internal.R;
|
import com.android.internal.R;
|
||||||
@@ -43,8 +44,6 @@ public class MessagingLinearLayout extends ViewGroup {
|
|||||||
|
|
||||||
private int mMaxDisplayedLines = Integer.MAX_VALUE;
|
private int mMaxDisplayedLines = Integer.MAX_VALUE;
|
||||||
|
|
||||||
private IMessagingLayout mMessagingLayout;
|
|
||||||
|
|
||||||
public MessagingLinearLayout(Context context, @Nullable AttributeSet attrs) {
|
public MessagingLinearLayout(Context context, @Nullable AttributeSet attrs) {
|
||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
|
|
||||||
@@ -292,12 +291,19 @@ public class MessagingLinearLayout extends ViewGroup {
|
|||||||
mMaxDisplayedLines = numberLines;
|
mMaxDisplayedLines = numberLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessagingLayout(IMessagingLayout layout) {
|
|
||||||
mMessagingLayout = layout;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IMessagingLayout getMessagingLayout() {
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user