Skip to content
This repository has been archived by the owner on Feb 15, 2019. It is now read-only.

support transucent status bar #104

Closed
wants to merge 4 commits into from

Conversation

chirag04
Copy link
Contributor

@chirag04 chirag04 commented Sep 20, 2016

@brentvatne

This should work now:

defaultRouteConfig={{
    statusBar: {
        translucent: true,
    },
}}

@chirag04
Copy link
Contributor Author

ah damn! wrong branching!

@@ -481,10 +496,15 @@ class ExNavigationStack extends PureComponent<any, Props, State> {
latestRouteConfig.navigationBar.visible !== false;

// TODO: add height and statusBarHeight options here
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove the todo

@satya164
Copy link
Contributor

BTW, navigationBar and TabNavigation take translucent: true, so maybe keep the naming consistent.

@chirag04
Copy link
Contributor Author

good point @satya164 . I updated the PR.

let height = NavigationBar.DEFAULT_HEIGHT;

if (latestRouteConfig.statusBar && latestRouteConfig.statusBar.translucent) {
height = NavigationBar.DEFAULT_HEIGHT_WITHOUT_STATUS_BAR + 24;
Copy link
Contributor

Choose a reason for hiding this comment

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

On Android, statusbar height is 25

Copy link
Contributor Author

@chirag04 chirag04 Sep 26, 2016

Choose a reason for hiding this comment

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

yeah. @brentvatne defined it at 24 already when in exponent env. I just mirrored that.

also for some reason 25 had a weird spacing issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

@chirag04 Hmm... okay, it's wrong though I remember when @brentvatne changed my app to exponent he had used 24 and it felt like the header title wasn't vertically centered (since it was 1px off).

What's the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@satya164 updated the PR. I can't reproduce the 1px off thing in my app anymore. 25 works in my app for now.

// pass the statusBarHeight to headerComponent if statusBar is translucent
let statusBarHeight = STATUSBAR_HEIGHT;
if (latestRouteConfig.statusBar && latestRouteConfig.statusBar.translucent) {
statusBarHeight = 24;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should probably keep this in a constant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@chirag04
Copy link
Contributor Author

@brentvatne i'm unable to flow check this PR. for whatever reason it is checking react-native in node_modules.

@alexcurtis
Copy link

LGTM! :-D

@skevy
Copy link
Contributor

skevy commented Oct 28, 2016

@chirag04 want to fix the merge conflicts here?

@chirag04
Copy link
Contributor Author

@skevy @brentvatne rebased.

@cyprusglobe
Copy link
Contributor

LGTM!

@brentvatne brentvatne closed this Nov 14, 2016
expbot pushed a commit that referenced this pull request Nov 14, 2016
@brentvatne

This should work now:

Closes #104

fbshipit-source-id: 5dd1eb8
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants