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

[V2][iOS] Fix bottomTabs’s animate option #4465

Merged
merged 11 commits into from
Apr 21, 2019

Conversation

wsliaw
Copy link
Contributor

@wsliaw wsliaw commented Dec 18, 2018

Resolve #4385

Signed-off-by: wilson <wilson@waveo.com>
@henrikra
Copy link
Contributor

Can you add example GIF showing this feature?

@wsliaw
Copy link
Contributor Author

wsliaw commented Dec 18, 2018

@henrikra added

@henrikra
Copy link
Contributor

Nice! And can you also share what configuration you passed from JavaScript?

@wsliaw
Copy link
Contributor Author

wsliaw commented Dec 18, 2018

aligned with the doc

Navigation.mergeOptions(componentId, {
   bottomTabs: { visible: false, animate: true },
});

@henrikra
Copy link
Contributor

Ahaa so you are listening the scroll event in your code and when you are going down you will call this?

Navigation.mergeOptions(componentId, {
   bottomTabs: { visible: false, animate: true },
});

@wsliaw
Copy link
Contributor Author

wsliaw commented Dec 18, 2018

yup :)
this pr is to fix the show/hide animation, this used to work in v1 but somehow not implemented in v2

@henrikra
Copy link
Contributor

You have to fix tests before this gets merged though :)

@wsliaw
Copy link
Contributor Author

wsliaw commented Dec 18, 2018

can you give me some guidance?

@@ -16,7 +16,7 @@ - (void)applyOptions:(RNNNavigationOptions *)options {
[tabBarController rnn_setTabBarTranslucent:[options.bottomTabs.translucent getWithDefaultValue:NO]];
[tabBarController rnn_setTabBarHideShadow:[options.bottomTabs.hideShadow getWithDefaultValue:NO]];
[tabBarController rnn_setTabBarStyle:[RCTConvert UIBarStyle:[options.bottomTabs.barStyle getWithDefaultValue:@"default"]]];
[tabBarController rnn_setTabBarVisible:[options.bottomTabs.visible getWithDefaultValue:YES]];
[tabBarController rnn_setTabBarVisible:[options.bottomTabs.visible getWithDefaultValue:YES] animated:[options.bottomTabs.animate getWithDefaultValue:YES]];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change because it does not animate in existing implementations.
I think that it is better to default to NO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@guyca guyca added this to the tbd milestone Jan 8, 2019
wilson added 3 commits January 8, 2019 18:33
Signed-off-by: wilson <wilson@waveo.com>
Signed-off-by: wilson <wilson@waveo.com>
Signed-off-by: wilson <wilson@waveo.com>
Copy link
Contributor

@masarusanjp masarusanjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks Good To Me :)

@@ -54,8 +54,8 @@ - (void)mergeOptions:(RNNNavigationOptions *)newOptions currentOptions:(RNNNavig
[tabBarController rnn_setTabBarHideShadow:newOptions.bottomTabs.hideShadow.get];
}

if (newOptions.bottomTabs.visible.hasValue) {
[tabBarController rnn_setTabBarVisible:newOptions.bottomTabs.visible.get];
if (newOptions.bottomTabs.visible.hasValue && newOptions.bottomTabs.animate.hasValue) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If visible has a value and animate doesn't, rnn_setTabBarVisible won't be called - This is a breaking change/bug.
I suggest we handle visibility change it two different ways:

  1. Keep current behaviour as is - Visible has value and animate doesn't
  2. Both visible and animate have values

Once you make this change we can move forward and approve this PR. Thanks

Copy link
Contributor Author

@wsliaw wsliaw Jan 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated :)

wilson added 2 commits January 31, 2019 18:51
@LRNZ09
Copy link

LRNZ09 commented Feb 7, 2019

This would be really useful

@lukebrandonfarrell
Copy link
Contributor

@yogevbd Any status on merging this ?

@kyle-ssg
Copy link
Contributor

Doesn’t look like there’s any reason not to merge this?

@wsliaw
Copy link
Contributor Author

wsliaw commented Feb 21, 2019

hi @yogevbd , is there anything I need to change or fix? thanks

@guyca guyca removed this from the tbd milestone Mar 17, 2019
@yogevbd yogevbd merged commit 9836730 into wix:master Apr 21, 2019
vshkl pushed a commit to vshkl/react-native-navigation that referenced this pull request Feb 5, 2020
* [V2][iOS] Fix bottomTabs’s animate option

Signed-off-by: wilson <wilson@waveo.com>

* change animated default value to false

Signed-off-by: wilson <wilson@waveo.com>

* fix self.tabBar.hidden value

Signed-off-by: wilson <wilson@waveo.com>

* Fix tests

Signed-off-by: wilson <wilson@waveo.com>

* fix value check

Signed-off-by: wilson <wilson@waveo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[V2] bottomTabs animate: true broken
8 participants