Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

[Android] TabBar title and actions are not taken into account #4

Closed
fcatuhe opened this issue Feb 11, 2018 · 3 comments
Closed

[Android] TabBar title and actions are not taken into account #4

fcatuhe opened this issue Feb 11, 2018 · 3 comments

Comments

@fcatuhe
Copy link

fcatuhe commented Feb 11, 2018

Hi @lazaronixon, thanks again for the great work on TabBar!

I have this issue only on Android with the following setting in componentDidMount():

Turbolinks.setTabBar({
  routes: [
    {
      tabTitle: 'Home',
      title: 'RNT Showcase',
      url: env.BASE_URL,
      actions: [{ id: 404, title: '404 error' }]
    },
    {
      tabTitle: 'Posts',
      title: 'View all posts',
      url: `${env.BASE_URL}/posts`,
      actions: [{ id: 11, title: 'New post' }]
    }
  ]
});

The title and actions on all Tabs are the ones of the first route only, they do not change when navigating to other tabs.

It works as expected on iOS.

I brought up a repo for my experiments ;-) available here: RNT Showcase

@lazaronixon
Copy link
Owner

Unfortunately this is the default behavior on android. On android we have a component called PagerView where it is possible slide between views so I used it to slide between TurbolinksViews and NativeViews but with only one Toolbar. By default react-native-turbolinks will use route from selectedIndex to mount this single toolbar. If possible see baseCamp App for android. You will see the same behavior.

@lazaronixon
Copy link
Owner

lazaronixon commented Feb 11, 2018

What could be done is implement a eventListener like turbolinksTabChanged with selectedIndex as return. So you could use on JavaScript side renderActions or renderTitle methods... But i think it would be a lot of code to you implement only for android to do such a simple thing. If I have more requests i can do that.

@fcatuhe
Copy link
Author

fcatuhe commented Feb 12, 2018

OK thanks for the explanation, for the moment I will explore the possibilities with this configuration!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants