瀏覽代碼

Enable RTL support on LeftButton (#3154)

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.
Lode Vanhove 6 年之前
父節點
當前提交
7622dcf298
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      android/app/src/main/java/com/reactnativenavigation/views/LeftButton.java

+ 2
- 0
android/app/src/main/java/com/reactnativenavigation/views/LeftButton.java 查看文件

@@ -5,6 +5,7 @@ import android.graphics.Color;
5 5
 import android.view.View;
6 6
 
7 7
 import com.balysv.materialmenu.MaterialMenuDrawable;
8
+import com.facebook.react.modules.i18nmanager.I18nUtil;
8 9
 import com.reactnativenavigation.NavigationApplication;
9 10
 import com.reactnativenavigation.params.TitleBarButtonParams;
10 11
 import com.reactnativenavigation.params.TitleBarLeftButtonParams;
@@ -33,6 +34,7 @@ class LeftButton extends MaterialMenuDrawable implements View.OnClickListener {
33 34
         this.onClickListener = onClickListener;
34 35
         this.navigatorEventId = navigatorEventId;
35 36
         this.overrideBackPressInJs = overrideBackPressInJs;
37
+        setRTLEnabled(I18nUtil.getInstance().isRTL(context));
36 38
         setInitialState();
37 39
         setColor();
38 40
     }