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

Android: Add support for translucent status bar and navigation bar

    Details

    • Story Points:
      5
    • Sprint:
      2018 Sprint 21, 2018 Sprint 22

      Description

      Summary:
      Add support for a translucent top status bar and translucent bottom navigation bar by adding the following constants that can be used by the Ti.UI.Window "windowFlags" property.

      • Ti.UI.Android.FLAG_TRANSLUCENT_NAVIGATION
      • Ti.UI.Android.FLAG_TRANSLUCENT_STATUS

      The above correspond to the following Android 4.4 Java constants...
      https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_TRANSLUCENT_NAVIGATION
      https://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_TRANSLUCENT_STATUS

      Example Usage:

      var window = Ti.UI.createWindow({
      	extendSafeArea: true,
      	theme: "Theme.AppCompat.NoTitleBar",
      	windowFlags: Ti.UI.Android.FLAG_TRANSLUCENT_STATUS | Ti.UI.Android.FLAG_TRANSLUCENT_NAVIGATION,
      	backgroundColor: "white",
      	borderWidth: "8dp",
      	borderColor: "green",
      });
      window.open();
      

      Note 1:
      Internally, Titanium needs to support/apply these flags to allow Android P notches to overlap a fullscreen window. Otherwise the app window will be letterboxed between the notches. So, we might as well as expose the window flags constants for convenience... and they can be used on older Android OS versions (4.4 and higher).

      Note 2:
      Android 4.4 only supports a translucent navigation bar when the app is shown in portrait form. It is opaque when landscape. This is a limitation on Google's end.
      Android 5.0 and newer OS versions support a translucent nav bar for all orientations.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Gary Mathews
              • Watchers:
                3 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