androidandroid-constraintlayoutright-to-leftconstraintlayout-helper-widget-flow

android ConstraintLayout Flow : align items from right to left


I'm using android ConstraintLayout Flow , and I have to arrange items from right to left , something like this :

enter image description here

XML code :

<androidx.constraintlayout.helper.widget.Flow
            android:id="@+id/flow"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:flow_horizontalStyle="spread_inside"
            app:flow_maxElementsWrap="4"
            app:flow_verticalGap="29dp"
            app:flow_wrapMode="aligned"
            app:constraint_referenced_ids="item1 , item2 , ..."
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/headerTextView" />

Note : our supportsRtl set False in the Manifest ...

how can I do this ?!


Solution

  • The solution I found and it worked was to set rotationY=180f on parent (our ConstraintLayout) and then set rotationY=180f on each item we have in the ConstraintLayout too.