Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26246

Android: Handle Android P insetting/display-cutout

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 7.5.0
    • Component/s: Android
    • Labels:

      Description

      Summary:
      Android 9.0 (aka: Android P) will support devices with "iPhone X" style frame insetting where the top frame cuts into the top status bar.

      We'll need to provide APIs to better support this device feature. Preferably re-use the existing APIs used by iPhone X such as our Window.extendSafeArea property.

      Note 1:
      Android 9.0 (API Level 28) provides new APIs to help with us. They're listed here...
      https://developer.android.com/preview/features#cutout

      Quick reference...
      https://developer.android.com/reference/android/view/DisplayCutout
      https://developer.android.com/reference/android/view/WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES

      Also, the window won't render into the cutout unless we set additional window flags such as the following...

      WindowManager.LayoutParams attributes = getWindow().getAttributes();
      attributes.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
      getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
      getWindow().setAttributes(attributes);
      

      Note 2:
      Huawei has their own custom notch support on Android 8 which they document in the link below. Note that these are not official Google Android APIs.
      https://developer.huawei.com/consumer/en/devservice/doc/30210

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Gary Mathews
              • Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Source Code