Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] TopBar Left/Right custom component buttons #5960

Closed
jinshin1013 opened this issue Feb 24, 2020 · 3 comments
Closed

[Android] TopBar Left/Right custom component buttons #5960

jinshin1013 opened this issue Feb 24, 2020 · 3 comments

Comments

@jinshin1013
Copy link
Contributor

Issue Description

Left button

Left custom component button does not appear on Android. Also when coming back from a pushed screen the back button from the popped screen stays rather than showing the set left custom component button.

Right button

Right custom component button has no padding around it by default positioning it on the far right of the top bar on Android. Also when multiple right buttons are set, on iOS it automatically adds padding creating the right buttons nicely positioned whereas on Android it adds no padding positioning it right next to each other.

Steps to Reproduce / Code Snippets / Screenshots

I've created a reproduction on my boilerplate under the branch called reproduction/top-bar-padding. Just need to checkout the branch and run:

git checkout reproduction/top-bar-padding

yarn
yarn start

# Open another tab on the terminal
yarn android # assuming you have an android device/emulator opened

The gif below demonstrates the positioning of the right custom button and the appearance of the left custom button on Android emulator. It also shows that after popping back to the screen with the custom left button still contain the back button from the popped screen.

reproduction-gif

The screenshots below represent the positioning inconsistency between the Android and iOS platform. On iOS, paddings are applied to the custom buttons by default making it look nicer than on Android.

Desktop


Environment

  • React Native Navigation version: 6.0.1
  • React Native version: 61.5
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): All
@AlexeyMakDes
Copy link

+1
iOS - ok

@guyca
Copy link
Collaborator

guyca commented Apr 1, 2020

Hey @jinshin1013 👋
Android's Toolbar view doesn't support left buttons. It only supports a single icon left button, and even that is a hack.
This can be implemented by us in various ways, one naive approach which should work is to add another TitleBar to the TopBar, dedicated to the left buttons.

While I understand the importance of this task, I don't think I'll get to it anytime soon. If anyone would like to contribute it, please contact me on Discord.

@guyca
Copy link
Collaborator

guyca commented Dec 13, 2020

duplicates #3929

@guyca guyca closed this as completed Dec 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants