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

fix: Dynamic status bar #641

Merged
merged 4 commits into from
Dec 1, 2017
Merged

Conversation

jouderianjr
Copy link
Member

Question Response
Version? v1.3.1
Devices tested? iPhone iOS 11, Android 7
Bug fix? yes
New feature? no
Includes tests? no
All Tests pass? yes
Related ticket? #4

Screenshots

Before After
beforedynamic afterdynamic
screen shot 2017-11-15 at 03 34 58 screen shot 2017-11-15 at 03 36 59

Description

The main idea here is using the onNavigationStateChangeevent for discovering what screen the user is navigating and change the statusBarStyle accordingly with the screen.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 39.911% when pulling c75a629 on jouderianjr:dynamic_status_bar into 05c386e on gitpoint:master.

Copy link
Member

@chinesedfan chinesedfan left a comment

Choose a reason for hiding this comment

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

@jouderianjr 👍 LGTM! And I also left a personal suggestion for you.

App.js Outdated
StatusBar.setTranslucent(false);
StatusBar.setBackgroundColor(colors.grey);
StatusBar.setBarStyle('dark-content');
}
Copy link
Member

Choose a reason for hiding this comment

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

@jouderianjr Can we config these informations in somewhere? So that we will not forget to update them once new routers were added.

Copy link
Member

@andrewda andrewda left a comment

Choose a reason for hiding this comment

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

👏 Besides @chinesedfan's comment, LGTM!

@jouderianjr
Copy link
Member Author

Awesome guys, until the end of the week I will fix it 💃

@machour
Copy link
Member

machour commented Nov 21, 2017

Finally! 👯‍♂️

Copy link
Member

@machour machour left a comment

Choose a reason for hiding this comment

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

Tudo bem homie! Just some styling comments on my side 🤓
Tested and validated otherwise on both iPhone and Android on my end

App.js Outdated
if (lightContentScreens.includes(routeName)) {
StatusBar.setTranslucent(true);
StatusBar.setBackgroundColor(
routeName === 'Login' ? colors.transparent : colors.black
Copy link
Member

Choose a reason for hiding this comment

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

Can you replace colors.black by #262626. This would Android look like the iPhone:

Before:
screen shot 2017-11-21 at 3 58 04 pm

After:
screen shot 2017-11-21 at 4 49 17 pm

Copy link
Member

Choose a reason for hiding this comment

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

Are you suggesting we make a new color for this? Or replace all blacks by #262626?

Copy link
Member

Choose a reason for hiding this comment

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

We should make a new color in config for this.
The existant dark gray on profile pages is already #262626 but created with a rgba() thingy (that seems unneeded)

App.js Outdated
StatusBar.setBarStyle('light-content');
} else {
StatusBar.setTranslucent(false);
StatusBar.setBackgroundColor(colors.grey);
Copy link
Member

Choose a reason for hiding this comment

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

colors.white look nicer to me (give the same transparent look on Android)

Copy link
Member Author

Choose a reason for hiding this comment

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

This transparent look is not a "default" look and feel of material design ( as described here ). What do you think about @machour? Should we keep the material design thing or it is better to have the same iOS design? 😄

Copy link
Member

Choose a reason for hiding this comment

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

I completely forgot about material design 😅
Let's keep it like you did it then

@jouderianjr
Copy link
Member Author

@andrewda @chinesedfan Looks better? 💃 If not, I will glad to hear some suggestions, I don't know if is the best implementation for this. 😄

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 39.924% when pulling 68ff611 on jouderianjr:dynamic_status_bar into 05c386e on gitpoint:master.

App.js Outdated

const statusBarConfig = lightScreens.includes(routeName)
? lightStatusBar
: darkStatusBar;
Copy link
Member

Choose a reason for hiding this comment

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

@jouderianjr How about moving these lines into src/config/status-bar.js and only exporting 1 function called getStatusBarConfig(routerName)? Suppose the 3rd kind of status bar was introduced, only the config file should be updated.

@jouderianjr
Copy link
Member Author

@chinesedfan Done! Good suggestion mate

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 39.886% when pulling d68319c on jouderianjr:dynamic_status_bar into 05c386e on gitpoint:master.

App.js Outdated
);

StatusBar.setTranslucent(translucent);
StatusBar.setBackgroundColor(backgroundColor(routeName));
Copy link
Member

Choose a reason for hiding this comment

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

@jouderianjr Please return backgroundColor value, instead of a function. Except here everything is so good!

Copy link
Member Author

Choose a reason for hiding this comment

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

backgroundColor in lightStatusBar depends of if you are in Login or not. But I have an Idea, I can transform lightStatusBar and darkStatusBar in a function that receives the routeName and return the object.

Example:

const lightStatusBar = routeName => {
  translucent: true,
  backgroundColor: routeName === 'Login' ? colors.transparent : colors.black,
  barStyle: 'light-content',
};

What do you think about?

Copy link
Member

Choose a reason for hiding this comment

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

Right, that's what I want.

Copy link
Member

Choose a reason for hiding this comment

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

And you may rename lightStatusBar as getLightStatusBar.

@jouderianjr
Copy link
Member Author

done @chinesedfan 💃

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 39.937% when pulling a4e2609 on jouderianjr:dynamic_status_bar into ee90991 on gitpoint:master.

@jouderianjr
Copy link
Member Author

I think it good to go now @chinesedfan @machour @andrewda 💃

@machour
Copy link
Member

machour commented Dec 1, 2017

Just tested and validated with latest modifications. Merging this baby in!

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

Successfully merging this pull request may close these issues.

None yet

5 participants