您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

functions.native.js 588B

12345678910111213141516171819202122
  1. // @flow
  2. import { isIPhoneX, Platform } from '../base/react';
  3. const IPHONE_OFFSET = 20;
  4. const IPHONEX_OFFSET = 44;
  5. /**
  6. * Determines the offset to be used for the device. This uses a custom
  7. * implementation to minimize empty area around screen, especially on iPhone X.
  8. *
  9. * @returns {number}
  10. */
  11. export function getSafetyOffset() {
  12. if (Platform.OS === 'android') {
  13. // Android doesn't need offset, except the Essential phone. Should be
  14. // addressed later with a generic solution.
  15. return 0;
  16. }
  17. return isIPhoneX() ? IPHONEX_OFFSET : IPHONE_OFFSET;
  18. }