Findings on edge to edge support #6196
Replies: 4 comments 5 replies
-
Try 1Tried to Implement support for edge to edge on Exploration ActivityI used WindowInsetsListener ExplorationActivity val toolbar = findViewById<Toolbar>(R.id.exploration_toolbar)
ViewCompat.setOnApplyWindowInsetsListener(toolbar) { view, insets ->
val vInsets = insets.getInsets(
WindowInsetsCompat.Type.systemBars() or
WindowInsetsCompat.Type.displayCutout()
)
view.updatePadding(top = vInsets.top, left = vInsets.left, right = vInsets.right)
insets
}StateFragmentPresenter val hintview = binding.animableHintsAndSolutionFragmentContainer
ViewCompat.setOnApplyWindowInsetsListener(hintview) { view, insets ->
val vInset = insets.getInsets(
WindowInsetsCompat.Type.systemBars() or
WindowInsetsCompat.Type.displayCutout()
)
view.updatePadding(left = vInset.left, right = vInset.right, bottom = vInset.bottom)
insets
}
Output
ScreenShots
|
Beta Was this translation helpful? Give feedback.
-
Try 2ExploratonActivity val toolbar = findViewById<Toolbar>(R.id.exploration_toolbar)
ViewCompat.setOnApplyWindowInsetsListener(toolbar) { view, insets ->
val vInsets = insets.getInsets(
WindowInsetsCompat.Type.systemBars() or
WindowInsetsCompat.Type.displayCutout()
)
view.updatePadding(top = vInsets.top, left = vInsets.left, right = vInsets.right)
insets
}
// By default, on android version 16, nav bar is translucent and window.isNavigationBarContrastEnforced = true. So android adjusts contrast of nav bar based on background color.
// but we use light theme for this activity, and our background is not properly dark on dark mode. so nav bar by default appears translucent light color for both light and dark mode.
// So I used this window.isNavigationBarContrastEnforced = false
// Note: It makes nav bar transparent and restrict android to adjust contrast of nav bar based on background color.
// Since we are making nav bar transparent. So, we need to give bottom padding to a layout which have color for light and dark mode. (Like I do in state_fragment's framelayout and it works good.)
window.isNavigationBarContrastEnforced = false
state_fragment StateFragmentPresenter val rootView = binding.rootStateLayout
ViewCompat.setOnApplyWindowInsetsListener(rootView) { view, insets ->
val vInset = insets.getInsets(
WindowInsetsCompat.Type.systemBars() or
WindowInsetsCompat.Type.displayCutout()
)
view.updatePadding(left = vInset.left, right = vInset.right, bottom = vInset.bottom)
insets
}Output ScreenShot: Android Version: 16
Output ScreenShot: Android Version: 11
### Output
Reason: Since we are making nav bar transparent. So, we need to give bottom padding to a layout which has color for light and dark mode. (Like I do in state_fragment's framelayout and it works good.) Hi @BenHenning , @adhiamboperes , I have tried to solve overlapping problem in status bar and nav bar on android 16. (Although I have not tried to color the status bar like currently we have). Please Share your thoughts! |
Beta Was this translation helpful? Give feedback.
-
|
Hi @subhajitxyz, Thanks a lot for doing this! I have been working on this issue and I actually posted my findings on #5943 too and honestly our approaches are pretty similar which makes me more confident that we're on the right track. In my investigation I also found that Two things from your testing that are really helpful for me:
In the meeting we discussed the next steps introducing a feature flag, breaking the work into smaller tasks, adding CI scripts, and making a wiki page. I'm going to post a detailed breakdown on #5943 soon. I will take a deeper look into the bottom nav bar part based on your findings and will keep you updated on what I find. Thanks again for testing, that really helps! |
Beta Was this translation helpful? Give feedback.
-
|
One more thing:
However, in the Oppia codebase (maven_install.json), the current versions are: So, enableEdgeToEdge() is not available with the current dependency versions. |
Beta Was this translation helpful? Give feedback.










Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Notes
Overlapping Issue Screenshots (Status Bar & Navigation Bar)
Below screenshots describes about the overlapping issue. (Although almost every screen has this ovelapping issue on status bar and navigation bar, but i have shared few.)
Issue
Screen 1: Toolbar is overlapping with status bar and extra space appears between toolbar and content.
Screen 2: some extra space appears between toolbar and content. but hint is not overlapping with nav bar (Because in state_fragment this framelayout already applied fitssystemwindow = true, that is why, hint is not overlapping but some extra space appear in top. which works on lower devices, but it is not working on version 16. I think that is why android suggest to use windowInsets instead of fitystemwindow.)
Screen 3: welcome screen overlaps with navigation bar which makes hard to use the options(like skip, arrow)
Scree 4: Toolbar is overlapping with status bar and navigation bar. At top right corner, the Three dot option overlaps with nav bar.
Beta Was this translation helpful? Give feedback.
All reactions