From 8e8231bd40c3f28bce48d7c0fb09bec2319c6151 Mon Sep 17 00:00:00 2001 From: Lode Vanhove Date: Fri, 4 May 2018 10:42:55 +0200 Subject: [PATCH] Enable RTL support on LeftButton By default RTL is not enabled on the MaterialMenuDrawable of which the LeftButton extends. This results in the back button not being flipped when running your app against a right-to-left language. Enabling RTL for the LeftButton fixes this behavior and correctly flips the button when needed. --- .../main/java/com/reactnativenavigation/views/LeftButton.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/app/src/main/java/com/reactnativenavigation/views/LeftButton.java b/android/app/src/main/java/com/reactnativenavigation/views/LeftButton.java index 20b257b846c..3bb89a676b1 100644 --- a/android/app/src/main/java/com/reactnativenavigation/views/LeftButton.java +++ b/android/app/src/main/java/com/reactnativenavigation/views/LeftButton.java @@ -5,6 +5,7 @@ import android.view.View; import com.balysv.materialmenu.MaterialMenuDrawable; +import com.facebook.react.modules.i18nmanager.I18nUtil; import com.reactnativenavigation.NavigationApplication; import com.reactnativenavigation.params.TitleBarButtonParams; import com.reactnativenavigation.params.TitleBarLeftButtonParams; @@ -33,6 +34,7 @@ private static int getColor(TitleBarButtonParams params) { this.onClickListener = onClickListener; this.navigatorEventId = navigatorEventId; this.overrideBackPressInJs = overrideBackPressInJs; + setRTLEnabled(I18nUtil.getInstance().isRTL(context)); setInitialState(); setColor(); }