Loading core/java/android/view/InsetsFlags.java +11 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS; import static android.view.WindowInsetsController.BEHAVIOR_DEFAULT; import static android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE; Loading Loading @@ -54,7 +56,15 @@ public class InsetsFlags { @ViewDebug.FlagToString( mask = APPEARANCE_LIGHT_NAVIGATION_BARS, equals = APPEARANCE_LIGHT_NAVIGATION_BARS, name = "LIGHT_NAVIGATION_BARS") name = "LIGHT_NAVIGATION_BARS"), @ViewDebug.FlagToString( mask = APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS, equals = APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS, name = "SEMI_TRANSPARENT_STATUS_BARS"), @ViewDebug.FlagToString( mask = APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS, equals = APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS, name = "SEMI_TRANSPARENT_NAVIGATION_BARS") }) public @Appearance int appearance; Loading core/java/android/view/WindowInsetsController.java +14 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,18 @@ public interface WindowInsetsController { */ int APPEARANCE_LIGHT_NAVIGATION_BARS = 1 << 4; /** * Makes status bars semi-transparent with dark background and light foreground. * @hide */ int APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS = 1 << 5; /** * Makes navigation bars semi-transparent with dark background and light foreground. * @hide */ int APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS = 1 << 6; /** * Determines the appearance of system bars. * @hide Loading @@ -73,7 +85,8 @@ public interface WindowInsetsController { @Retention(RetentionPolicy.SOURCE) @IntDef(flag = true, value = {APPEARANCE_OPAQUE_STATUS_BARS, APPEARANCE_OPAQUE_NAVIGATION_BARS, APPEARANCE_LOW_PROFILE_BARS, APPEARANCE_LIGHT_STATUS_BARS, APPEARANCE_LIGHT_NAVIGATION_BARS}) APPEARANCE_LIGHT_NAVIGATION_BARS, APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS, APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS}) @interface Appearance { } Loading packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; import static android.view.InsetsState.containsType; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS; import static android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; Loading Loading @@ -994,6 +995,8 @@ public class NavigationBar implements View.OnAttachStateChangeListener, return MODE_LIGHTS_OUT_TRANSPARENT; } else if ((appearance & APPEARANCE_OPAQUE_NAVIGATION_BARS) != 0) { return MODE_OPAQUE; } else if ((appearance & APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS) != 0) { return MODE_SEMI_TRANSPARENT; } else { return MODE_TRANSPARENT; } Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +3 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static android.view.InsetsState.ITYPE_STATUS_BAR; import static android.view.InsetsState.containsType; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS; import static androidx.lifecycle.Lifecycle.State.RESUMED; Loading Loading @@ -2430,6 +2431,8 @@ public class StatusBar extends SystemUI implements DemoMode, return MODE_LIGHTS_OUT_TRANSPARENT; } else if ((appearance & APPEARANCE_OPAQUE_STATUS_BARS) != 0) { return MODE_OPAQUE; } else if ((appearance & APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS) != 0) { return MODE_SEMI_TRANSPARENT; } else { return MODE_TRANSPARENT; } Loading services/core/java/com/android/server/wm/ActivityRecord.java +3 −6 Original line number Diff line number Diff line Loading @@ -1431,14 +1431,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } /** * @return {@code true} if bar shown within a given rectangle is allowed to be transparent * @return {@code true} if bar shown within a given rectangle is allowed to be fully transparent * when the current activity is displayed. */ boolean isTransparentBarAllowed(Rect rect) { // TODO(b/175482966): Allow status and navigation bars to be semi-transparent black // in letterbox mode. return mLetterbox == null || mLetterbox.notIntersectsOrFullyContains(rect) || mWmService.isLetterboxActivityCornersRounded(); boolean isFullyTransparentBarAllowed(Rect rect) { return mLetterbox == null || mLetterbox.notIntersectsOrFullyContains(rect); } /** Loading Loading
core/java/android/view/InsetsFlags.java +11 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ import static android.view.WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS; import static android.view.WindowInsetsController.BEHAVIOR_DEFAULT; import static android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE; Loading Loading @@ -54,7 +56,15 @@ public class InsetsFlags { @ViewDebug.FlagToString( mask = APPEARANCE_LIGHT_NAVIGATION_BARS, equals = APPEARANCE_LIGHT_NAVIGATION_BARS, name = "LIGHT_NAVIGATION_BARS") name = "LIGHT_NAVIGATION_BARS"), @ViewDebug.FlagToString( mask = APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS, equals = APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS, name = "SEMI_TRANSPARENT_STATUS_BARS"), @ViewDebug.FlagToString( mask = APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS, equals = APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS, name = "SEMI_TRANSPARENT_NAVIGATION_BARS") }) public @Appearance int appearance; Loading
core/java/android/view/WindowInsetsController.java +14 −1 Original line number Diff line number Diff line Loading @@ -66,6 +66,18 @@ public interface WindowInsetsController { */ int APPEARANCE_LIGHT_NAVIGATION_BARS = 1 << 4; /** * Makes status bars semi-transparent with dark background and light foreground. * @hide */ int APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS = 1 << 5; /** * Makes navigation bars semi-transparent with dark background and light foreground. * @hide */ int APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS = 1 << 6; /** * Determines the appearance of system bars. * @hide Loading @@ -73,7 +85,8 @@ public interface WindowInsetsController { @Retention(RetentionPolicy.SOURCE) @IntDef(flag = true, value = {APPEARANCE_OPAQUE_STATUS_BARS, APPEARANCE_OPAQUE_NAVIGATION_BARS, APPEARANCE_LOW_PROFILE_BARS, APPEARANCE_LIGHT_STATUS_BARS, APPEARANCE_LIGHT_NAVIGATION_BARS}) APPEARANCE_LIGHT_NAVIGATION_BARS, APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS, APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS}) @interface Appearance { } Loading
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java +3 −0 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import static android.view.InsetsState.ITYPE_NAVIGATION_BAR; import static android.view.InsetsState.containsType; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_NAVIGATION_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS; import static android.view.WindowInsetsController.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE; import static android.view.WindowManager.LayoutParams.PRIVATE_FLAG_NO_MOVE_ANIMATION; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; Loading Loading @@ -994,6 +995,8 @@ public class NavigationBar implements View.OnAttachStateChangeListener, return MODE_LIGHTS_OUT_TRANSPARENT; } else if ((appearance & APPEARANCE_OPAQUE_NAVIGATION_BARS) != 0) { return MODE_OPAQUE; } else if ((appearance & APPEARANCE_SEMI_TRANSPARENT_NAVIGATION_BARS) != 0) { return MODE_SEMI_TRANSPARENT; } else { return MODE_TRANSPARENT; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +3 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static android.view.InsetsState.ITYPE_STATUS_BAR; import static android.view.InsetsState.containsType; import static android.view.WindowInsetsController.APPEARANCE_LOW_PROFILE_BARS; import static android.view.WindowInsetsController.APPEARANCE_OPAQUE_STATUS_BARS; import static android.view.WindowInsetsController.APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS; import static androidx.lifecycle.Lifecycle.State.RESUMED; Loading Loading @@ -2430,6 +2431,8 @@ public class StatusBar extends SystemUI implements DemoMode, return MODE_LIGHTS_OUT_TRANSPARENT; } else if ((appearance & APPEARANCE_OPAQUE_STATUS_BARS) != 0) { return MODE_OPAQUE; } else if ((appearance & APPEARANCE_SEMI_TRANSPARENT_STATUS_BARS) != 0) { return MODE_SEMI_TRANSPARENT; } else { return MODE_TRANSPARENT; } Loading
services/core/java/com/android/server/wm/ActivityRecord.java +3 −6 Original line number Diff line number Diff line Loading @@ -1431,14 +1431,11 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A } /** * @return {@code true} if bar shown within a given rectangle is allowed to be transparent * @return {@code true} if bar shown within a given rectangle is allowed to be fully transparent * when the current activity is displayed. */ boolean isTransparentBarAllowed(Rect rect) { // TODO(b/175482966): Allow status and navigation bars to be semi-transparent black // in letterbox mode. return mLetterbox == null || mLetterbox.notIntersectsOrFullyContains(rect) || mWmService.isLetterboxActivityCornersRounded(); boolean isFullyTransparentBarAllowed(Rect rect) { return mLetterbox == null || mLetterbox.notIntersectsOrFullyContains(rect); } /** Loading