react-native-navbar icon indicating copy to clipboard operation
react-native-navbar copied to clipboard

Adds `statusBar.animated` and fixes animation bugs

Open mosesoak opened this issue 9 years ago • 4 comments

The new animated property of the statusBar prop object affects both style and hidden when they are changed. Fixes bugs so the animations play. (They have to be passed in the StatusBar calls.)

There are several other changes I wanted to make in this PR but resisted doing so to avoid breaking changes for existing users of the component. So take these as additional feature requests... 1) now that the StatusBar API has changed, it would be nice to make prop names of statusBar match the official API, and 2) Android should now be supported and the API includes backgroundColor support for android.

mosesoak avatar Apr 26 '16 21:04 mosesoak

UPDATE: I don't think the problem I saw has to do with this PR. After implementing the workaround mentioned below, I'm seeing a similar problem in my app triggered by something completely different.

I noticed a problem with this (I had also noticed the same problem with my implementation shortly after I posted my PR (#161)). I'm not sure it's to do with the way setHidden() is called or something else in my app.

I have a component with a switch to show/hide the status bar. When the user toggles the switch on and off several times, the response starts getting very slow and soon the app hangs or crashes. Currently, toggling the switch sends a flux action that updates a store that both the navbar and the switch component subscribe to. I think an acceptable workaround for me will be to not update the store until the user exits that component.

I wonder if it possibly has something to do with the warning about using the Imperative API.

chetstone avatar Apr 27 '16 18:04 chetstone

Hi @chetstone I didn't see your pre-edited comment but this probably isn't related.

This PR just uses the imperative API correctly and adds an 'animated' prop to NavigationBar. Thanks

mosesoak avatar Apr 29 '16 05:04 mosesoak

Hi @Kureev or other maintainers - I notice that you merged a fix for using the imperative API with setBarStyle, but there is a similar bug with hidden/setHidden that this PR will fix.

This PR also provides a non-breaking way to indicate whether you want style & hide/show transitions to animate.

Just a nudge, this would be super useful to merge! Thanks

mosesoak avatar May 06 '16 18:05 mosesoak

Sorry for being so lazy with reviewing it. I'm on vacation right now. Maybe @grabbou can take a look?

Kureev avatar May 13 '16 04:05 Kureev