I'm developing an app with chips.
I have a constraint layout with a TextView and a ChipGroup. The chips are added programmatically.
This is the layout
...
<com.google.android.material.chip.ChipGroup
android:id="@+id/chipGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@android:color/holo_red_dark"
android:gravity="end"
app:layout_constraintBottom_toTopOf="@+id/chartView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/textView"
app:layout_constraintTop_toBottomOf="@+id/project3">
</com.google.android.material.chip.ChipGroup>
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="Pippo"
android:textColor="@color/greenPositive"
app:layout_constraintBottom_toTopOf="@+id/chartView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/project3" />
...
The activity appears as the screenshot (I have put a red background in the chipgroup to show the area)
- The ChipGroup is constrainted to the end of textview, but ignore this constraint and the margin.
- At the end a Chip is truncated, but the ChipGroup has a 16dp of margin at the end.
- The first and second row are not aligned with the first row
- I put gravity end in the ChipGroup, but the chips are aligned to start.
How to solve all these problems?
