Skip to content

Conversation

@orbital17
Copy link
Collaborator

Splash screen uses deprecated APIs for setting status bar and navigation bar colors. This PR updates splash screen to use window insets and draw behind the system bars.

Splash screen uses deprecated APIs for setting status bar and navigation
bar colors. This PR updates splash screen to use window insets and draw
behind the system bars.
ImmutableList.of(statusBarProtection, navigationBarProtection));
rootView.addView(protectionLayout);
protectionLayout.setVisibility(View.VISIBLE);
protectionLayout.setElevation(1f);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The splash screen ImageView is added later to this FrameLayout and it draws views by recency, unless we set z-index manually

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed manual elevation setting

super.onCreate(savedInstanceState);

WindowCompat.enableEdgeToEdge(getWindow());
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to move this to splash coordinator, otherwise we have a chance of getting obscured status bar icons.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed offline, status bar icons are not getting obscured

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a fresh look, let's move it to the splash controller and apply when we definitely set a color to system bars.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case the bug that we have now with the behavior without the splash screen will not be fixed.
Right now the transparent activity without splash screen shows black system bars, instead of being transparent. Setting this flag fixes it.

@ukaratkevich
Copy link
Collaborator

@gstepniewski-google can you PTAL too?

super.onCreate(savedInstanceState);

WindowCompat.enableEdgeToEdge(getWindow());
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a fresh look, let's move it to the splash controller and apply when we definitely set a color to system bars.

Copy link
Collaborator

@gstepniewski-google gstepniewski-google left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@orbital17 orbital17 merged commit bb0c9a2 into main Oct 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants