How to use the @shoutem/ui.Device.isIphoneXR function in @shoutem/ui

To help you get started, we’ve selected a few @shoutem/ui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shoutem / extensions / shoutem.navigation / app / components / ui / NavigationBarView.js View on Github external
setStatusBarStyleIos(statusBarColor, backgroundColor, hasImage) {
    if (isAnimatedStyleValue(backgroundColor) && !Device.isIphoneX && !Device.isIphoneXR) {
      // If the backgroundColor is animated, we want to listen for
      // color changes, so that we can update the bar style as the
      // animation runs.
      this.backgroundListenerId = addAnimatedValueListener(backgroundColor, () => {
        this.resolveStatusBarStyle(backgroundColor);
      });
    }

    // Set the bar style based on the current background color value
    hasImage ?
      this.resolveStatusBarStyle(statusBarColor, true) :
      this.resolveStatusBarStyle(backgroundColor, true);
  }