mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 16:00:02 +00:00
Fix for inconsistent thumbnail aspect ratio
Problems arose from any app that targets below API 19 and uses views that rely on RelativeLayouts giving correct measurement specs to their onMeasure(). Resolves #2676 Closes #2712 // FREEBIE
This commit is contained in:
committed by
Moxie Marlinspike
parent
7a023b9fdc
commit
761ccf4b3f
@@ -148,11 +148,14 @@ public abstract class BubbleContainer extends RelativeLayout {
|
||||
|
||||
private void setAlignment(@MediaState int mediaState) {
|
||||
RelativeLayout.LayoutParams parentParams = (RelativeLayout.LayoutParams) bodyBubble.getLayoutParams();
|
||||
if (mediaState != MEDIA_STATE_CAPTIONED) {
|
||||
if (mediaState == MEDIA_STATE_CAPTIONLESS) {
|
||||
parentParams.addRule(RelativeLayout.BELOW, 0);
|
||||
parentParams.addRule(RelativeLayout.ALIGN_BOTTOM, R.id.image_view);
|
||||
parentParams.addRule(RelativeLayout.ALIGN_BOTTOM, R.id.thumbnail_container);
|
||||
} else if (mediaState == MEDIA_STATE_CAPTIONED) {
|
||||
parentParams.addRule(RelativeLayout.BELOW, R.id.thumbnail_container);
|
||||
parentParams.addRule(RelativeLayout.ALIGN_BOTTOM, 0);
|
||||
} else {
|
||||
parentParams.addRule(RelativeLayout.BELOW, R.id.image_view);
|
||||
parentParams.addRule(RelativeLayout.BELOW, 0);
|
||||
parentParams.addRule(RelativeLayout.ALIGN_BOTTOM, 0);
|
||||
}
|
||||
bodyBubble.setLayoutParams(parentParams);
|
||||
|
||||
Reference in New Issue
Block a user