Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/Expensify.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import lodashGet from 'lodash/get';
import PropTypes from 'prop-types';
import React, {PureComponent} from 'react';
import {View} from 'react-native';
import {View, StatusBar} from 'react-native';
import Onyx, {withOnyx} from 'react-native-onyx';

import BootSplash from './libs/BootSplash';
Expand Down Expand Up @@ -74,7 +74,7 @@ class Expensify extends PureComponent {

// Initialize this client as being an active client
ActiveClientManager.init();

this.hideSplash = this.hideSplash.bind(this);
this.state = {
isOnyxMigrated: false,
};
Expand All @@ -87,7 +87,7 @@ class Expensify extends PureComponent {
// When we don't have an authToken we'll want to show the sign in screen immediately so we'll hide our
// boot screen right away
if (!this.getAuthToken()) {
BootSplash.hide({fade: true});
this.hideSplash();
}

this.setState({isOnyxMigrated: true});
Expand Down Expand Up @@ -115,7 +115,7 @@ class Expensify extends PureComponent {
return;
}

BootSplash.hide({fade: true});
this.hideSplash();
});
}
}
Expand All @@ -124,6 +124,14 @@ class Expensify extends PureComponent {
return lodashGet(this.props, 'session.authToken', null);
}

hideSplash() {
BootSplash.hide({fade: true}).then(() => {
// To prevent the splash from shifting positions we set status bar translucent after splash is hidden.
// on IOS it has no effect.
StatusBar.setTranslucent(true);
Comment thread
parasharrajat marked this conversation as resolved.
Resolved
});
}

render() {
// Display a blank page until the onyx migration completes
if (!this.state.isOnyxMigrated) {
Expand Down
3 changes: 1 addition & 2 deletions src/components/CustomStatusBar/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import React from 'react';
import {StatusBar} from 'react-native';

/**
* Only the Android platform supports "setBackgroundColor" and "setTranslucent"
* Only the Android platform supports "setBackgroundColor"
*/

export default class CustomStatusBar extends React.Component {
componentDidMount() {
StatusBar.setBarStyle('dark-content', true);
StatusBar.setBackgroundColor('transparent', true);
StatusBar.setTranslucent(true);
Comment thread
parasharrajat marked this conversation as resolved.
Resolved
}

render() {
Expand Down