Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Grid] Wrapping is broken after 2.2.0-alpha02 #786

Open
smelfungus opened this issue Feb 9, 2023 · 0 comments
Open

[Grid] Wrapping is broken after 2.2.0-alpha02 #786

smelfungus opened this issue Feb 9, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@smelfungus
Copy link

Hello!
Having the following layout:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:fillViewport="true"
  tools:context=".MainActivity">

  <androidx.constraintlayout.widget.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <androidx.constraintlayout.helper.widget.Grid
      android:id="@+id/grid"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:constraint_referenced_ids="textViewA, textViewB, textViewC"
      app:grid_columns="1"
      app:grid_horizontalGaps="8dp"
      app:grid_orientation="horizontal"
      app:grid_rows="3"
      app:grid_verticalGaps="8dp"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent" />

    <TextView
      android:id="@+id/textViewA"
      android:layout_width="match_parent"
      android:layout_height="400dp"
      android:background="?attr/colorPrimaryContainer"
      android:text="Hello World A!"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent" />

    <TextView
      android:id="@+id/textViewB"
      android:layout_width="match_parent"
      android:layout_height="400dp"
      android:background="?attr/colorSecondaryContainer"
      android:text="Hello World B!"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent" />

    <TextView
      android:id="@+id/textViewC"
      android:layout_width="match_parent"
      android:layout_height="400dp"
      android:background="?attr/colorTertiaryContainer"
      android:text="Hello World C!"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent" />
  </androidx.constraintlayout.widget.ConstraintLayout>

</ScrollView>

Results in proper behaviour with androidx.constraintlayout:constraintlayout:2.2.0-alpha02:

device-2023-02-09-134316.mp4

But fails with newer versions (for instance, androidx.constraintlayout:constraintlayout:2.2.0-alpha07):

device-2023-02-09-134548.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants