@shoutem/ui 4.6.6-rc.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,14 +49,6 @@ class DateTimePicker extends PureComponent {
49
49
  };
50
50
  }
51
51
 
52
- componentDidUpdate() {
53
- if (!isIos) {
54
- const { value } = this.props;
55
-
56
- this.setState({ value });
57
- }
58
- }
59
-
60
52
  handleValueChanged(event, value) {
61
53
  if (isIos) {
62
54
  return this.setState({ value });
@@ -22,6 +22,11 @@ export class ScrollDriverProvider extends PureComponent {
22
22
  static propTypes = {
23
23
  children: PropTypes.node,
24
24
  driver: DriverShape,
25
+ // Used to propagate animation driver changes to components who aren't
26
+ // children of ScrollDriver, recieves driver as argument.
27
+ // TODO: Rewrite for new context API.
28
+ onAnimationDriverChange: PropTypes.func,
29
+ onScroll: PropTypes.func,
25
30
  };
26
31
 
27
32
  constructor(props, context) {
@@ -42,19 +47,34 @@ export class ScrollDriverProvider extends PureComponent {
42
47
  }
43
48
 
44
49
  setupAnimationDriver(props, context) {
50
+ const { onAnimationDriverChange } = this.props;
51
+
45
52
  if (props.driver) {
46
53
  this.animationDriver = props.driver;
47
54
  } else if (context.driverProvider) {
48
55
  this.animationDriver = context.animationDriver;
49
56
  } else if (!this.animationDriver) {
50
- this.animationDriver = new ScrollDriver({ useNativeDriver: true });
57
+ this.animationDriver = new ScrollDriver(
58
+ { useNativeDriver: true, nativeScrollEventThrottle: 20 },
59
+ props.onScroll,
60
+ );
61
+ }
62
+
63
+ if (onAnimationDriverChange) {
64
+ onAnimationDriverChange(this.animationDriver);
51
65
  }
52
66
  }
53
67
 
54
68
  setAnimationDriver(driver, primaryScrollView) {
55
69
  if (driver || !this.animationDriver || primaryScrollView) {
56
- _.assign(this.animationDriver, driver);
70
+ const { onAnimationDriverChange } = this.props;
57
71
  const { driverProvider } = this.context;
72
+
73
+ _.assign(this.animationDriver, driver);
74
+ if (onAnimationDriverChange) {
75
+ onAnimationDriverChange(driver);
76
+ }
77
+
58
78
  if (driverProvider) {
59
79
  driverProvider.setAnimationDriver(driver, primaryScrollView);
60
80
  }
@@ -14,6 +14,7 @@ const IPHONE_X_HOME_INDICATOR_PADDING = isTabBarOnScreen ? 0 : 34;
14
14
  class ScrollView extends PureComponent {
15
15
  static propTypes = {
16
16
  ...Animated.ScrollView.propTypes,
17
+ primary: PropTypes.bool,
17
18
  };
18
19
 
19
20
  static contextTypes = {
@@ -33,7 +34,11 @@ class ScrollView extends PureComponent {
33
34
  autoBindReact(this);
34
35
 
35
36
  this.animationDriver =
36
- props.driver || new ScrollDriver({ useNativeDriver: true });
37
+ props.driver ||
38
+ new ScrollDriver(
39
+ { useNativeDriver: true, nativeScrollEventThrottle: 20 },
40
+ props.onScroll,
41
+ );
37
42
  }
38
43
 
39
44
  getChildContext() {
@@ -53,12 +58,9 @@ class ScrollView extends PureComponent {
53
58
 
54
59
  componentDidUpdate() {
55
60
  const { driver } = this.props;
56
- const { animationDriver } = this.context;
57
61
 
58
62
  if (driver && this.animationDriver !== driver) {
59
63
  this.animationDriver = driver;
60
- } else if (animationDriver && this.animationDriver !== animationDriver) {
61
- this.animationDriver = animationDriver;
62
64
  }
63
65
  }
64
66
 
@@ -92,7 +94,7 @@ class ScrollView extends PureComponent {
92
94
  ref={this.setWrappedInstance}
93
95
  contentContainerStyle={this.addIphoneXPadding(contentContainerStyle)}
94
96
  {...animationDriver.scrollViewProps}
95
- {...props}
97
+ {..._.omit(props, 'onScroll')}
96
98
  />
97
99
  );
98
100
  }
@@ -79,14 +79,20 @@ class YearRangePicker extends PureComponent {
79
79
  }
80
80
 
81
81
  render() {
82
- const { rangeEnd, rangeStart, resetButtonTitle, confirmButtonTitle } = this.props;
82
+ const {
83
+ rangeEnd,
84
+ rangeStart,
85
+ resetButtonTitle,
86
+ confirmButtonTitle,
87
+ } = this.props;
83
88
  const { buttonTooltip, collapsed } = this.state;
84
89
 
85
90
  return (
86
- <View onLayout={this.handleLayout}>
91
+ <View>
87
92
  <YearPickerButton
88
93
  tooltip={buttonTooltip}
89
94
  onPress={this.handleButtonPressed}
95
+ collapsed={collapsed}
90
96
  />
91
97
  <YearPickerModal
92
98
  visible={collapsed}
@@ -1,7 +1,6 @@
1
1
  import React, { PureComponent } from 'react';
2
2
  import { Animated } from 'react-native';
3
3
  import PropTypes from 'prop-types';
4
- import _ from 'lodash';
5
4
  import autoBindReact from 'auto-bind/react';
6
5
  import { connectStyle } from '@shoutem/theme';
7
6
  import { TouchableOpacity } from '../TouchableOpacity';
@@ -14,6 +13,7 @@ class YearRangePickerButton extends PureComponent {
14
13
  static propTypes = {
15
14
  onPress: PropTypes.func,
16
15
  tooltip: PropTypes.string,
16
+ collapsed: PropTypes.bool,
17
17
  style: PropTypes.any,
18
18
  };
19
19
 
@@ -23,55 +23,41 @@ class YearRangePickerButton extends PureComponent {
23
23
  autoBindReact(this);
24
24
 
25
25
  this.dropDownIconValue = new Animated.Value(0);
26
-
27
- this.state = {
28
- collapsed: false,
29
- };
30
26
  }
31
27
 
32
- handlePress() {
33
- const { collapsed } = this.state;
34
- const { onPress } = this.props;
35
-
36
- const toValue = collapsed ? 0 : 1;
28
+ componentDidUpdate(prevProps) {
29
+ const { collapsed } = this.props;
30
+ const { collapsed: prevCollapsed } = prevProps;
37
31
 
38
- this.setState(
39
- { collapsed: !collapsed },
40
- () => Animated.timing(
41
- this.dropDownIconValue,
42
- {
43
- toValue,
44
- useNativeDriver: true,
45
- duration: 300,
46
- }
47
- ).start());
32
+ if (collapsed !== prevCollapsed) {
33
+ const toValue = collapsed ? 1 : 0;
48
34
 
49
- if (onPress) {
50
- onPress();
35
+ Animated.timing(this.dropDownIconValue, {
36
+ toValue,
37
+ useNativeDriver: true,
38
+ duration: 300,
39
+ }).start();
51
40
  }
52
41
  }
53
42
 
54
43
  render() {
55
- const { style, tooltip } = this.props;
44
+ const { style, tooltip, onPress } = this.props;
56
45
 
57
46
  return (
58
- <TouchableOpacity
59
- onPress={this.handlePress}
60
- style={style.container}
61
- >
62
- <Text>
63
- {tooltip}
64
- </Text>
47
+ <TouchableOpacity onPress={onPress} style={style.container}>
48
+ <Text>{tooltip}</Text>
65
49
  <AnimatedIcon
66
50
  name="drop-down"
67
51
  style={{
68
52
  ...style.icon,
69
- transform: [{
70
- rotate: this.dropDownIconValue.interpolate({
71
- inputRange: [0, 1],
72
- outputRange: ['0deg', '180deg'],
73
- }),
74
- }],
53
+ transform: [
54
+ {
55
+ rotate: this.dropDownIconValue.interpolate({
56
+ inputRange: [0, 1],
57
+ outputRange: ['0deg', '180deg'],
58
+ }),
59
+ },
60
+ ],
75
61
  }}
76
62
  />
77
63
  </TouchableOpacity>
@@ -79,4 +65,6 @@ class YearRangePickerButton extends PureComponent {
79
65
  }
80
66
  }
81
67
 
82
- export default connectStyle('shoutem.ui.YearRangePickerButton')(YearRangePickerButton);
68
+ export default connectStyle('shoutem.ui.YearRangePickerButton')(
69
+ YearRangePickerButton,
70
+ );
@@ -20,10 +20,7 @@ function resolveVisibleYears(props) {
20
20
  const yearsPerPage = NUMBER_OF_ROWS * YEARS_IN_ROW;
21
21
 
22
22
  if (_.isEmpty(selectedYears)) {
23
- const fullRange = _.times(
24
- yearsPerPage,
25
- index => rangeStart + index,
26
- );
23
+ const fullRange = _.times(yearsPerPage, index => rangeStart + index);
27
24
 
28
25
  return _.filter(fullRange, year => year <= rangeEnd);
29
26
  }
@@ -31,11 +28,8 @@ function resolveVisibleYears(props) {
31
28
  const firstSelectedYear = _.head(selectedYears);
32
29
  const prevPagesNumber = Math.trunc(firstSelectedYear / yearsPerPage);
33
30
 
34
- const fullRangeStart = (prevPagesNumber * yearsPerPage) + 1;
35
- const fullRange = _.times(
36
- yearsPerPage,
37
- index => fullRangeStart + index,
38
- );
31
+ const fullRangeStart = prevPagesNumber * yearsPerPage + 1;
32
+ const fullRange = _.times(yearsPerPage, index => fullRangeStart + index);
39
33
 
40
34
  return _.filter(fullRange, year => year <= rangeEnd);
41
35
  }
@@ -83,7 +77,6 @@ class YearRangePickerModal extends PureComponent {
83
77
  const { onRangeConfirmed } = this.props;
84
78
 
85
79
  if (onRangeConfirmed) {
86
- LayoutAnimation.easeInEaseOut();
87
80
  onRangeConfirmed(selectedYears);
88
81
  }
89
82
  }
@@ -91,7 +84,6 @@ class YearRangePickerModal extends PureComponent {
91
84
  handleResetPress() {
92
85
  const { onRangeConfirmed } = this.props;
93
86
 
94
- LayoutAnimation.easeInEaseOut();
95
87
  this.setState({ selectedYears: [] });
96
88
 
97
89
  if (onRangeConfirmed) {
@@ -104,9 +96,15 @@ class YearRangePickerModal extends PureComponent {
104
96
  const { visibleYears } = this.state;
105
97
 
106
98
  const nextYearStart = _.last(visibleYears) + 1;
107
- const nextYearEnd = Math.min(rangeEnd, nextYearStart + this.YEARS_PER_PAGE - 1);
99
+ const nextYearEnd = Math.min(
100
+ rangeEnd,
101
+ nextYearStart + this.YEARS_PER_PAGE - 1,
102
+ );
108
103
 
109
- const nextVisibleYears = _.times(nextYearEnd + 1 - nextYearStart, index => nextYearStart + index);
104
+ const nextVisibleYears = _.times(
105
+ nextYearEnd + 1 - nextYearStart,
106
+ index => nextYearStart + index,
107
+ );
110
108
 
111
109
  LayoutAnimation.easeInEaseOut();
112
110
  this.setState({ visibleYears: nextVisibleYears });
@@ -118,7 +116,12 @@ class YearRangePickerModal extends PureComponent {
118
116
  const prevYearStart = _.head(visibleYears) - this.YEARS_PER_PAGE;
119
117
 
120
118
  LayoutAnimation.easeInEaseOut();
121
- this.setState({ visibleYears: _.times(this.YEARS_PER_PAGE, index => prevYearStart + index) });
119
+ this.setState({
120
+ visibleYears: _.times(
121
+ this.YEARS_PER_PAGE,
122
+ index => prevYearStart + index,
123
+ ),
124
+ });
122
125
  }
123
126
 
124
127
  handleYearPress(year) {
@@ -137,7 +140,9 @@ class YearRangePickerModal extends PureComponent {
137
140
  }
138
141
 
139
142
  const cutFromEnd = size / 2 <= index;
140
- const newYears = _.filter(selectedYears, value => cutFromEnd ? value <= year : value >= year);
143
+ const newYears = _.filter(selectedYears, value =>
144
+ cutFromEnd ? value <= year : value >= year,
145
+ );
141
146
 
142
147
  this.setState({ selectedYears: newYears });
143
148
  return;
@@ -149,15 +154,23 @@ class YearRangePickerModal extends PureComponent {
149
154
  }
150
155
 
151
156
  const addToEnd = _.last(selectedYears) < year;
152
- const yearsToAdd = addToEnd ? year - _.last(selectedYears) : _.head(selectedYears) - year;
157
+ const yearsToAdd = addToEnd
158
+ ? year - _.last(selectedYears)
159
+ : _.head(selectedYears) - year;
153
160
 
154
161
  const newYears = addToEnd
155
- ? [...selectedYears, ..._.times(yearsToAdd, index => _.last(selectedYears) + index + 1)]
156
- : [...selectedYears, ..._.times(yearsToAdd, index => _.head(selectedYears) - index + -1)]
162
+ ? [
163
+ ...selectedYears,
164
+ ..._.times(yearsToAdd, index => _.last(selectedYears) + index + 1),
165
+ ]
166
+ : [
167
+ ...selectedYears,
168
+ ..._.times(yearsToAdd, index => _.head(selectedYears) - index + -1),
169
+ ];
157
170
  const sortedYears = _.sortBy(newYears, item => item);
158
171
 
159
172
  this.setState({ selectedYears: sortedYears });
160
- }
173
+ };
161
174
  }
162
175
 
163
176
  renderYear(year) {
@@ -174,12 +187,14 @@ class YearRangePickerModal extends PureComponent {
174
187
  style={style.yearContainer}
175
188
  key={year.toString()}
176
189
  >
177
- <View style={[
178
- style.year,
179
- isSelected && style.yearSelected,
180
- isFirst && style.yearFirst,
181
- isLast && style.yearLast,
182
- ]}>
190
+ <View
191
+ style={[
192
+ style.year,
193
+ isSelected && style.yearSelected,
194
+ isFirst && style.yearFirst,
195
+ isLast && style.yearLast,
196
+ ]}
197
+ >
183
198
  <Text>{year.toString()}</Text>
184
199
  </View>
185
200
  </TouchableOpacity>
@@ -191,7 +206,7 @@ class YearRangePickerModal extends PureComponent {
191
206
  <View styleName="horizontal flexible" key={index.toString()}>
192
207
  {_.map(row, this.renderYear)}
193
208
  </View>
194
- )
209
+ );
195
210
  }
196
211
 
197
212
  render() {
@@ -221,6 +236,7 @@ class YearRangePickerModal extends PureComponent {
221
236
  onBackdropPress={onDismiss}
222
237
  useNativeDriver
223
238
  backdropOpacity={Platform.OS === 'ios' ? 0.7 : 0}
239
+ animationIn="slideInUp"
224
240
  >
225
241
  <View style={style.container}>
226
242
  <View style={style.tooltipContainer}>
@@ -229,7 +245,10 @@ class YearRangePickerModal extends PureComponent {
229
245
  onPress={this.handleYearsBackPress}
230
246
  disabled={prevDisabled}
231
247
  >
232
- <Icon name="left-arrow" style={[style.icon, prevDisabled && style.iconDisabled]} />
248
+ <Icon
249
+ name="left-arrow"
250
+ style={[style.icon, prevDisabled && style.iconDisabled]}
251
+ />
233
252
  </Button>
234
253
  <Text>{buttonTooltip}</Text>
235
254
  <Button
@@ -237,22 +256,33 @@ class YearRangePickerModal extends PureComponent {
237
256
  onPress={this.handleYearsForwardPress}
238
257
  disabled={nextDisabled}
239
258
  >
240
- <Icon name="right-arrow" style={[style.icon, nextDisabled && style.iconDisabled]} />
259
+ <Icon
260
+ name="right-arrow"
261
+ style={[style.icon, nextDisabled && style.iconDisabled]}
262
+ />
241
263
  </Button>
242
264
  </View>
243
- {_.times(NUMBER_OF_ROWS, (row) => this.renderYearRow(data[row], row))}
265
+ {_.times(NUMBER_OF_ROWS, row => this.renderYearRow(data[row], row))}
244
266
  <View style={style.buttonContainer}>
245
- <Button styleName="secondary flexible" onPress={this.handleResetPress}>
267
+ <Button
268
+ styleName="secondary flexible"
269
+ onPress={this.handleResetPress}
270
+ >
246
271
  <Text>{resetButtonTitle}</Text>
247
272
  </Button>
248
- <Button styleName="primary flexible md-gutter-left" onPress={this.handleConfirmPress}>
273
+ <Button
274
+ styleName="primary flexible md-gutter-left"
275
+ onPress={this.handleConfirmPress}
276
+ >
249
277
  <Text>{confirmButtonTitle}</Text>
250
278
  </Button>
251
279
  </View>
252
- </ View>
280
+ </View>
253
281
  </Modal>
254
282
  );
255
283
  }
256
284
  }
257
285
 
258
- export default connectStyle('shoutem.ui.YearRangePickerModal')(YearRangePickerModal);
286
+ export default connectStyle('shoutem.ui.YearRangePickerModal')(
287
+ YearRangePickerModal,
288
+ );
@@ -1,4 +1,5 @@
1
1
  import { Platform, Dimensions } from 'react-native';
2
+ import { hasNotch } from 'react-native-device-info';
2
3
  import _ from 'lodash';
3
4
  import {
4
5
  IPHONE_X_LONG_SIDE,
@@ -30,6 +31,8 @@ const isIphoneXR =
30
31
  !isTVOS &&
31
32
  (xrDimensionsMatch || twelveDimensionsMatch || twelveMaxDimensionsMatch);
32
33
 
34
+ const isNotchedAndroid = OS === 'android' && hasNotch();
35
+
33
36
  /**
34
37
  * Receives settings for different devices
35
38
  * If the device is recognized, it returns only settings for that device
@@ -48,11 +51,16 @@ function select(settings) {
48
51
  return settings.iPhoneXR;
49
52
  }
50
53
 
54
+ if (settings.notchedAndroid && isNotchedAndroid) {
55
+ return settings.notchedAndroid;
56
+ }
57
+
51
58
  return _.get(settings, 'default');
52
59
  }
53
60
 
54
61
  export const Device = {
55
62
  isIphoneX,
56
63
  isIphoneXR,
64
+ isNotchedAndroid,
57
65
  select,
58
66
  };
@@ -1,5 +1,4 @@
1
- import { Platform } from 'react-native';
2
- import { getStatusBarHeight } from 'react-native-status-bar-height';
1
+ import { Platform, StatusBar } from 'react-native';
3
2
  import { NAVIGATION_BAR_HEIGHT } from '../theme';
4
3
 
5
4
  export function calculateKeyboardOffset(extraOffset = 0) {
@@ -9,7 +8,7 @@ export function calculateKeyboardOffset(extraOffset = 0) {
9
8
  return resolvedOffset;
10
9
  }
11
10
 
12
- return getStatusBarHeight() + resolvedOffset;
11
+ return StatusBar.currentHeight + resolvedOffset;
13
12
  }
14
13
 
15
14
  export default { calculateKeyboardOffset };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoutem/ui",
3
- "version": "4.6.6-rc.0",
3
+ "version": "4.7.0",
4
4
  "description": "Styleable set of components for React Native applications",
5
5
  "scripts": {
6
6
  "lint": "eslint .",
@@ -9,33 +9,33 @@
9
9
  "test": "mocha '_tests_/*.js' --require react-native-mock-render/mock --require @babel/register"
10
10
  },
11
11
  "dependencies": {
12
- "@react-native-community/datetimepicker": "^3.5.2",
13
- "@shoutem/animation": "~0.14.0",
14
- "@shoutem/eslint-config-react": "^1.0.1",
15
- "@shoutem/theme": "~0.12.0",
16
- "react-native-render-html-table-bridge": "0.6.0",
17
- "auto-bind": "^4.0.0",
18
- "babel-plugin-transform-decorators-legacy": "~1.3.4",
12
+ "@react-native-community/datetimepicker": "3.5.2",
13
+ "@shoutem/animation": "shoutem/animation#649a9e7",
14
+ "@shoutem/eslint-config-react": "~1.0.6",
15
+ "@shoutem/theme": "shoutem/theme#ac4754a",
16
+ "auto-bind": "4.0.0",
17
+ "babel-plugin-transform-decorators-legacy": "1.3.5",
19
18
  "buffer": "5.6.0",
20
19
  "events": "1.1.0",
21
- "fs-extra": "^7.0.1",
20
+ "fs-extra": "7.0.1",
22
21
  "html-entities": "1.3.1",
23
22
  "htmlparser2": "3.10.1",
24
23
  "lodash": "4.17.21",
25
- "prop-types": "^15.7.2",
24
+ "prop-types": "15.8.1",
26
25
  "qs": "6.9.3",
26
+ "react-native-device-info": "8.4.8",
27
27
  "react-native-lightbox": "shoutem/react-native-lightbox#v0.7.2",
28
- "react-native-linear-gradient": "~2.5.6",
28
+ "react-native-linear-gradient": "2.5.6",
29
29
  "react-native-modal": "11.7.0",
30
30
  "react-native-photo-view": "shoutem/react-native-photo-view#0ffa1481f6b6cb8663cb291b7db1d6644440584d",
31
- "react-native-render-html": "~4.2.0",
32
- "react-native-status-bar-height": "2.5.0",
33
- "react-native-svg": "^12.1.1",
34
- "react-native-svg-transformer": "^0.14.3",
31
+ "react-native-render-html": "4.2.5",
32
+ "react-native-render-html-table-bridge": "0.6.0",
33
+ "react-native-svg": "12.1.1",
34
+ "react-native-svg-transformer": "0.14.3",
35
35
  "react-native-transformable-image": "shoutem/react-native-transformable-image#v0.0.20",
36
- "react-native-vector-icons": "~6.6.0",
37
- "react-native-webview": "~11.0.0",
38
- "react-native-youtube-iframe": "~2.1.2",
36
+ "react-native-vector-icons": "6.6.0",
37
+ "react-native-webview": "11.0.3",
38
+ "react-native-youtube-iframe": "2.1.2",
39
39
  "stream": "0.0.2",
40
40
  "tinycolor2": "1.4.1"
41
41
  },
@@ -44,27 +44,28 @@
44
44
  "react-native": ">=0.61.5"
45
45
  },
46
46
  "devDependencies": {
47
- "@babel/core": "^7.9.6",
47
+ "@babel/core": "7.16.7",
48
48
  "@babel/register": "7.9.0",
49
- "@babel/plugin-proposal-decorators": "^7.3.0",
50
- "babel-eslint": "^9.0.0",
49
+ "@babel/plugin-proposal-decorators": "7.16.7",
50
+ "babel-eslint": "9.0.0",
51
51
  "chai": "4.2.0",
52
52
  "deep-freeze": "0.0.1",
53
- "eslint": "^6.8.0",
54
- "eslint-plugin-import": "^2.20.1",
55
- "eslint-plugin-jsx-a11y": "^1.3.1",
53
+ "eslint": "6.8.0",
54
+ "eslint-plugin-import": "2.25.4",
55
+ "eslint-plugin-jsx-a11y": "1.5.5",
56
56
  "eslint-plugin-prettier": "3.1.3",
57
- "eslint-plugin-react": "^5.1.1",
58
- "eslint-plugin-react-native": "~3.6.0",
59
- "metro-react-native-babel-preset": "^0.56.0",
57
+ "eslint-plugin-react": "5.2.2",
58
+ "eslint-plugin-react-native": "3.6.0",
59
+ "metro-react-native-babel-preset": "0.56.4",
60
60
  "mocha": "7.1.2",
61
61
  "prettier": "1.19.1",
62
- "react-addons-test-utils": "^15.6.2",
63
- "react-dom": "^16.8.6",
62
+ "react-addons-test-utils": "15.6.2",
63
+ "react-dom": "16.14.0",
64
64
  "react-native-mock-render": "0.1.9"
65
65
  },
66
66
  "nativeDependencies": [
67
67
  "@react-native-community/datetimepicker",
68
+ "react-native-device-info",
68
69
  "react-native-linear-gradient",
69
70
  "react-native-photo-view",
70
71
  "react-native-svg",
package/theme.js CHANGED
@@ -22,6 +22,7 @@ const STATUS_BAR_OFFSET =
22
22
  export const NAVIGATION_BAR_HEIGHT = Device.select({
23
23
  iPhoneX: NAVIGATION_HEADER_HEIGHT + IPHONE_X_NOTCH_PADDING,
24
24
  iPhoneXR: NAVIGATION_HEADER_HEIGHT + IPHONE_XR_NOTCH_PADDING,
25
+ notchedAndroid: NAVIGATION_HEADER_HEIGHT + StatusBar.currentHeight,
25
26
  default: NAVIGATION_HEADER_HEIGHT,
26
27
  });
27
28
 
@@ -1751,17 +1752,14 @@ export default (variables = defaultThemeVariables) => ({
1751
1752
  statusBar: {
1752
1753
  backgroundColor: variables.statusBarColor,
1753
1754
  statusBarStyle: variables.statusBarStyle,
1754
- height: Device.select({
1755
- iPhoneX: IPHONE_X_NOTCH_PADDING,
1756
- iPhoneXR: IPHONE_XR_NOTCH_PADDING,
1757
- default: 0,
1758
- }),
1755
+ height: StatusBar.currentHeight,
1759
1756
  },
1760
1757
  screenBackground: variables.backgroundColor,
1761
1758
  navigationBarImage: {
1762
1759
  marginTop: Device.select({
1763
1760
  iPhoneX: IPHONE_X_NOTCH_PADDING,
1764
1761
  iPhoneXR: IPHONE_XR_NOTCH_PADDING,
1762
+ notchedAndroid: StatusBar.currentHeight,
1765
1763
  default: 0,
1766
1764
  }),
1767
1765
  flex: 1,