Last active
April 28, 2021 13:21
-
-
Save akexorcist/cb0268a019e45d4de5fbae30bcfeab97 to your computer and use it in GitHub Desktop.
Mystery issue in ConstraintLayout 2.0.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:paddingStart="16dp" | |
android:paddingTop="16dp" | |
android:paddingEnd="16dp"> | |
<androidx.constraintlayout.widget.ConstraintLayout | |
android:id="@+id/child_layout" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_marginBottom="16dp" | |
app:layout_constraintBottom_toTopOf="@+id/view_divider" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent"> | |
<View | |
android:id="@+id/view_inside" | |
android:layout_width="36dp" | |
android:layout_height="36dp" | |
android:background="#81C784" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintStart_toStartOf="parent" | |
app:layout_constraintTop_toTopOf="parent" /> | |
</androidx.constraintlayout.widget.ConstraintLayout> | |
<View | |
android:id="@+id/view_item1" | |
android:layout_width="4dp" | |
android:layout_height="10dp" | |
android:layout_marginStart="8dp" | |
android:background="#E57373" | |
app:layout_constraintStart_toEndOf="@id/child_layout" | |
app:layout_constraintTop_toTopOf="parent" /> | |
<View | |
android:id="@+id/view_item2" | |
android:layout_width="4dp" | |
android:layout_height="25dp" | |
android:layout_marginStart="8dp" | |
android:background="#64B5F6" | |
app:layout_constraintBottom_toBottomOf="@+id/child_layout" | |
app:layout_constraintStart_toStartOf="@id/view_item1" | |
app:layout_constraintTop_toBottomOf="@+id/view_item1" /> | |
<View | |
android:id="@+id/view_item3" | |
android:layout_width="4dp" | |
android:layout_height="15dp" | |
android:layout_marginStart="24dp" | |
android:background="#FFF176" | |
app:layout_constraintBottom_toBottomOf="@+id/child_layout" | |
app:layout_constraintStart_toEndOf="@id/child_layout" | |
app:layout_constraintTop_toTopOf="@+id/child_layout" /> | |
<View | |
android:id="@+id/view_item_end" | |
android:layout_width="14dp" | |
android:layout_height="14dp" | |
android:layout_marginBottom="16dp" | |
android:background="#777777" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" | |
app:layout_constraintTop_toTopOf="parent" /> | |
<View | |
android:id="@+id/view_divider" | |
android:layout_width="wrap_content" | |
android:layout_height="1dp" | |
android:background="#777777" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintStart_toStartOf="parent" /> | |
</androidx.constraintlayout.widget.ConstraintLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug condition
view_inside
's height : 25dp - 36dpview_item1
's height : 10dp - 16dpview_item2
's height : 25dpview_item3
's height : 0dp - 34dpview_item_end
's height : 14dpview_divider
's height : any dp