Skip to content

ToolbarAndroid doesn't play well with DrawerLayoutAndroid with app RTL #5147

@avishayil

Description

@avishayil

Hi,
I noticed some problems while browsing ToolbarAndroid options.
I followed the documentation:
https://facebook.github.io/react-native/docs/toolbarandroid.html
Added the android:supportsRtl="true" parameter to my AndroidManifest.xml. and set the mReactRootView.setLayoutDirection(1) like the function documentation says to get my application RTLed.
The result was correct, but some things were buggy:

  1. Adding rtl={true} to ToolbarAndroid returned the app state to LTR.
  2. Defining DrawerLayoutAndroid drawerPosition parameter to {DrawerLayoutAndroid.positions.Right} made the drawer open from the left. Also, In the first time the drawer were triggered, it "flew" from the right to the left. When changing the value to {DrawerLayoutAndroid.positions.Left}, it were triggered from the right side but "flew" from the left side as well.

Simplified, there are two problems:

  1. DrawerLayoutAndroid and RTLing the app using android:supportsRtl="true" and setLayoutDirection(1), combined with {DrawerLayoutAndroid.positions} parameter causing the drawer to be opened from the wrong side, and to "fly" from the opposite side instead of flowing from the chosen one.
  2. ToolbarAndroid rtl={true} parameter, combined with android:supportsRtl="true" and setLayoutDirection(1), is causing the opposite effect. Leaving the app without the rtl parameter works well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Ran CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions