Привет, у меня есть чип-группа, и я динамически создаю чипы и добавляю в чип-группу.
Однако Я хочу, чтобы чипы находились с правой стороны чип-группы, но всегда слева, как показано здесь.
![enter image description here](https://i.stack.imgur.com/8zOLl.png)
Я хочу, чтобы фишки Text: 0 и Text: 1 находились в самом правом конце.
Это мой код:
<RelativeLayout
....
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextTitle"
android:layout_alignBaseline="@id/chipGroup"
android:gravity="end|bottom"
android:layout_marginTop="16dp"
android:layout_below="@id/toptv"
android:textColor="@android:color/white"
android:textStyle="bold"
android:textSize="14sp"
android:id="@+id/tt1"
/>
<com.google.android.material.chip.ChipGroup
android:id="@+id/chipGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_toRightOf="@id/tt1"
android:layout_below="@id/toptv"
android:textColor="@android:color/black"
android:textStyle="bold"
android:textSize="12sp"
/>
</RelativeLayout>
Вот как я динамически добавляю фишки к группе фишек:
Chip chip;
for(int i=0;i<2;i++){
chip = new Chip(this);
chip.setText("Text:"+i);
chip.setChipBackgroundColorResource(android.R.color.darker_gray);
chip.setTextColor(Color.WHITE);
mChipGroup.addView(chip);
}
Я искал некоторые сообщения SOF, но не смог выровнять фишки по правому краю. Любая помощь будет очень полезна.