0

I previously used a constraint layout 2.0.0-beta08 that showed a smaller image with layout_constraintDimensionRatio="16:7"
With the new Constraint layout version 2.0.1, the image now looks bigger and unable to resize it as per dimension ratio.

I would not change the version from 2.0.0 beta08 to 2.0.1, But the motion layout in that version randomly crashes the mobile Ui, and the app needs to be force stop to prevent mobile hang. And also view with viewpager2 too crash even if the root view is constraint layout and not motion layout.

Below is a small snippet code for the layout

  <androidx.viewpager2.widget.ViewPager2
        android:id="@+id/viewpager_banner"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="@dimen/dimen_5dp"
        android:layoutDirection="ltr"
        app:layout_constraintDimensionRatio="16:7"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/guideline26" />
Ravi Parmar
  • 968
  • 11
  • 28

1 Answers1

0

It seemed like my motion layout on that layout was overriding the dimension ratio.

So if it is not mentioned the motion layout picks a default ratio .

While in the older version it was taking this ratio from constraint layout. So if the developer does not mention it in the scene layout it was fine, But in the new constraint layout version, it looks like the developer needs to mention this ratio.

This resolved my bug for the change of dimension ratio.

Ravi Parmar
  • 968
  • 11
  • 28