Constraint layout Flow with differences for first and last chain Kotlin

PHOTO EMBED

Wed Apr 14 2021 08:18:35 GMT+0000 (Coordinated Universal Time)

Saved by @GoodRequest.

<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="match_parent">

    <androidx.constraintlayout.helper.widget.Flow
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:flow_wrapMode="chain"
        app:flow_maxElementsWrap="2"
        app:flow_firstHorizontalStyle="spread_inside"
        app:flow_lastHorizontalStyle="packed"
        app:constraint_referenced_ids="circle1, ..., circle9"/>

    //Include 9 circles
    <include
        android:id="@+id/circle1"
        layout="@layout/circle"/>

</androidx.constraintlayout.widget.ConstraintLayout>
content_copyCOPY