flexbox-layout icon indicating copy to clipboard operation
flexbox-layout copied to clipboard

Bug using RTL layout

Open JRiberaG opened this issue 5 years ago • 2 comments

  • [x] I have searched existing issues and confirmed this is not a duplicate

Issues and steps to reproduce

I have the following problem: when I use FlexBoxLayout, layoutDirection RTL and I update some views, e.g. changing a textView.text, the items of the first column disappear. The FlexDirection is Column.

It's weird because it only affects the items of the first column, it does not affect the items of the other columns. The reason why I think the problem is between FlexBoxLayout and layoutDirection RTL is because I've tried to change the layoutDirection to LTR and it works perfectly (the TextView can be updated with no issue at all) and not a single item disappears.

Expected behavior

The TextViews should be able to be updated and the FlexBoxLayout's first column items shouldn't disappears, as it happens right now.

Version of the flexbox library

2.0.1

JRiberaG avatar Jun 30 '20 10:06 JRiberaG

Yes we also have encountered this bug. We had to define the layoutDirection=locale for all the items in the FlexBoxLayoutManager.

You can see that it does not forwards the layoutDirection on the children by inspecting with the layoutInspector.

How to reproduce:

  • Turn on RTL
  • FlexDirection.Column defined
  • Add a MaterialButton in an item of the recyclerview with the icon as defined in the documentation
  • See the icon is missing
<com.google.android.material.button.MaterialButton
        app:icon="@drawable/ic_favorite_24dp"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Button"
        style="@style/Widget.MaterialComponents.Button.Icon"
 />

kristiyanP avatar Jan 21 '21 11:01 kristiyanP

same problem. I solved problem by setting layoutDirection = View.LAYOUT_DIRECTION_LTR to Recyclerview

vd92 avatar Jun 15 '21 08:06 vd92