Status Update
Comments
ni...@google.com <ni...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Please mention the steps to be followed for reproducing the issue with the given sample apk.
Android full bug report capturing
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory.
Alternate method
Navigate to “Developer options”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Screen record of the issue, for clarity
Please capture screen record or video of the issue using the following steps:
adb shell screenrecord /sdcard/video.mp4
Subsequently use following command to pull the recorded file:
adb pull /sdcard/video.mp4\
Note: Please upload the files to google drive and share the folder to
Description
The attached layout file contains three ImageViews. A weighted chain is used to divide the width up equally. The first ImageView is displayed actual size, the second contains a drawable with an aspect ratio of 1:1 and is scaled to fit the available width using app:layout_constraintDimensionRatio="h,1:1", and the third contains a drawable with an aspect ratio of 5:4.
I have set app:layout_optimizationLevel="none" to rule out any optimiser shenanigans.
If I set the third ImageView with app:layout_constraintDimensionRatio="h,1:1", then it anamorphically distorts it, so that it renders with an equal width and height and the second ImageView is displayed with dimensions of 443x442 (Third_1_to_1.png).
If I set the third ImageView to app:layout_constraintDimensionRatio="h,50:40", then the aspect ratio of the third ImageView is correctly displayed at a 5:4 ratio, but the size of the second ImageView changes radically to 280x280 (Third_50_to_40.png).
Expected behaviour: Changing the dimension ration of one of the ImageViews should alter the aspect ratio that it is displayed at, in this case the height should be altered without affecting the width. When the widths of each of the ImageViews are functions of the weighted chain, then altering the dimension ratio of one ImageView should not alter the dimensions of another.