Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
In working with ConstraintLayouts I tried to build a child ConstraintLayout that matches the parent size. When I used androidx it did not size appropriately when I programatically set params:
ConstraintLayout userEducationLayer = (ConstraintLayout) layoutInflater.inflate(R.layout.photos_lens_avs_education_highlight_layer, /* root= */ null, /* attachToRoot= */ false);
// Make layer span entire parent.
ConstraintLayout.LayoutParams layoutParams = new ConstraintLayout.LayoutParams(LayoutParams.MATCH_CONSTRAINT, LayoutParams.MATCH_CONSTRAINT);
layoutParams.leftToLeft = LayoutParams.PARENT_ID;
layoutParams.topToTop = LayoutParams.PARENT_ID;
layoutParams.rightToRight = LayoutParams.PARENT_ID;
layoutParams.bottomToBottom = LayoutParams.PARENT_ID;
userEducationLayer.setLayoutParams(layoutParams);
XML:
<ConstraintLayout id=container>
<ConstraintLayout
id=child
width=0dp height=0dp constrainLeftTopRightBottom=parent>
</ConstraintLayout>
</ConstraintLayout>
But it did work when I used support ConstraintLayout.