Guidline is ignored in RTL-Layout (Android Constraint-Layout)

Viewed 236

I've heard of some bugs with Guidelines and RTL in Constraint-Layout. But none of the methods helped me. I have Guidelines on both sides of my BottomNavigation, everything works in in LTR but in RTL one of the guidelines is ignored. Here is what it looks like:

enter image description here

And here is my xml-code:

<com.example.sportsman.BotmNavViewGroup
    android:id="@+id/NavbarLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:layout_marginBottom="0dp"
    android:background="@drawable/botm_navbar_shape_color"
    android:elevation="25dp"
    android:clickable="true"
    android:gravity="bottom"
    app:layout_constraintBottom_toBottomOf="parent">

    <com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="0dp"
        android:layout_height="55dp"
        android:layout_gravity="bottom"
        android:background="@color/transparent"
        android:paddingBottom="0dp"
        android:theme="@style/Widget_NavigationItem_NoRipple"
        app:elevation="0dp"
        app:itemBackground="@drawable/drawer_item_background"
        app:itemIconSize="26dp"
        app:itemIconTint="@color/NavBarGrey"
        app:itemTextColor="@color/NavBarGrey"
        app:labelVisibilityMode="unlabeled"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/margin"
        app:layout_constraintHorizontal_bias="0.416"
        app:layout_constraintStart_toEndOf="@+id/margin2"
        app:menu="@menu/bottom_nav_menu" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/margin"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.9" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/margin2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.1" />

    <ImageView
        android:id="@+id/menu_button"
        android:layout_width="41dp"
        android:layout_height="41dp"
        android:layout_marginTop="7dp"
        android:background="@drawable/ic_plusbuttonbottomnav2"
        android:backgroundTint="@color/accentColor"
        android:padding="0dp"
        android:src="@color/transparent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="@+id/bottom_navigation" />

</com.example.sportsman.BotmNavViewGroup>

As you can see in the code, the plus-button in the middle is seperate, the bottomnavigation has a transparent icon in the middle.

Can someone help me with that?

1 Answers

You should Remove app:layout_constraintEnd_toEndOf="parent" from BottomNavigationView

Related