Merge "Fixes the collapsed view with images and different densities" into pi-dev

am: 061d858828

Change-Id: I0b961e13c0db6bc43dd2b577c68cbefe97de3363
This commit is contained in:
Selim Cinek
2018-05-23 11:07:39 -07:00
committed by android-build-merger

View File

@@ -207,6 +207,8 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou
mAvatarView.setTranslationY(0.0f);
mSenderName.setAlpha(1.0f);
mSenderName.setTranslationY(0.0f);
mIsolatedMessage = null;
mMessages = null;
sInstancePool.release(MessagingGroup.this);
}
};
@@ -267,6 +269,11 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou
@Override
public int getMeasuredType() {
if (mIsolatedMessage != null) {
// We only want to show one group if we have an inline image, so let's return shortened
// to avoid displaying the other ones.
return MEASURED_SHORTENED;
}
boolean hasNormal = false;
for (int i = mMessageContainer.getChildCount() - 1; i >= 0; i--) {
View child = mMessageContainer.getChildAt(i);
@@ -292,9 +299,6 @@ public class MessagingGroup extends LinearLayout implements MessagingLinearLayou
}
}
}
if (mMessageContainer.getChildCount() == 0 && mIsolatedMessage != null) {
return mIsolatedMessage.getMeasuredType();
}
return MEASURED_NORMAL;
}