Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set enableEdgeToEdge() directly in Activity´s onCreate() #4889

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

Rafael2616
Copy link
Contributor

reference: https://developer.android.com/develop/ui/views/layout/edge-to-edge?hl=en#enable-edge-to-edge-display

this fixes the black nav bar in some older android devices form factors running api 28 this issue only affects dark theme in my device, in light theme the nav bar is transparent as espected. this commits fixes this by ensuring edge to edge is appled - tested and worked

Description

Fixes #(issue)

Type of change

❌ General change (non-breaking change that doesn't fit the below categories like copyediting)
❌ Bug fix (non-breaking change which fixes an issue)
❌ New feature (non-breaking change which adds functionality)
❌ Breaking change (fix or feature that would cause existing functionality to not work as expected)

reference: https://developer.android.com/develop/ui/views/layout/edge-to-edge?hl=en#enable-edge-to-edge-display

this fixes the black nav bar in some older android devices form factors running api 28
this issue only affects dark theme in my device, in light theme the nav bar is transparent as espected. this commits fixes this by ensuring edge to edge is appled - tested and worked
@Rafael2616
Copy link
Contributor Author

20241014_000954-COLLAGE

@Rafael2616
Copy link
Contributor Author

home screen:
20241014_002218-COLLAGE

@Rafael2616 Rafael2616 closed this Oct 14, 2024
@Rafael2616
Copy link
Contributor Author

Rafael2616 commented Oct 15, 2024

hi @MrSluffy, i found an issue with edge to edge implementation, this is a long time issue in lower api devices, so i was able to solve it by adding this in LawnchairLauncher.kt onCreate()

        if (!Utilities.ATLEAST_Q) {
            enableEdgeToEdge(
                navigationBarStyle = SystemBarStyle.auto(
                    Color.TRANSPARENT,
                    Color.TRANSPARENT,
                ),
            )
        }

but i dont think that this is an good solution because it override the actual EdgeToEdge implememntation defined in Theme.kt, thats why i close this pull. so this issue only affects dark mode in api 28 or lower in some form factors. but i saw that LawnchairLauncher.kt uses View system to construct the screen and I'm not very familiar, do you think it can be easily fixed??

@MrSluffy
Copy link
Member

Yes this is great, I'll merge it

@Rafael2616
Copy link
Contributor Author

ok, I'll reopen this and make the changes as in the comment

@Rafael2616 Rafael2616 reopened this Oct 16, 2024
@Rafael2616
Copy link
Contributor Author

done

@MrSluffy MrSluffy merged commit 1591775 into LawnchairLauncher:14-dev Oct 18, 2024
5 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.

2 participants