fix(ADFA-3093): Add bottom padding to prevent overlap on system navigation bar#1021
Conversation
📝 WalkthroughWalkthroughBoth TemplateDetailsFragment and TemplateListFragment are updated to handle system window insets. Each fragment now applies system bars insets as bottom padding to its root view using ViewCompat and WindowInsetsCompat listeners, ensuring content avoids system UI overlays. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/src/main/java/com/itsaky/androidide/fragments/TemplateDetailsFragment.kt (1)
69-73: Consider preserving initial padding from the layout.The current implementation directly sets
bottom = insets.bottom, which will overwrite any existing bottom padding defined in the XML layout. If the layout changes in the future to include bottom padding, it would be lost.A more robust pattern captures the initial padding before setting the listener:
♻️ Suggested improvement
+ val initialPaddingBottom = binding.root.paddingBottom ViewCompat.setOnApplyWindowInsetsListener(binding.root) { v, windowInsets -> val insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) - v.updatePadding(bottom = insets.bottom) + v.updatePadding(bottom = initialPaddingBottom + insets.bottom) windowInsets }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@app/src/main/java/com/itsaky/androidide/fragments/TemplateDetailsFragment.kt` around lines 69 - 73, The current onApplyWindowInsets listener in TemplateDetailsFragment overwrites any XML bottom padding; capture the view's original padding before calling ViewCompat.setOnApplyWindowInsetsListener (e.g., read binding.root.paddingBottom into a local like initialBottomPadding) and then inside the listener call v.updatePadding(bottom = initialBottomPadding + insets.bottom) so you preserve existing layout padding while still applying system inset adjustments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@app/src/main/java/com/itsaky/androidide/fragments/TemplateDetailsFragment.kt`:
- Around line 69-73: The current onApplyWindowInsets listener in
TemplateDetailsFragment overwrites any XML bottom padding; capture the view's
original padding before calling ViewCompat.setOnApplyWindowInsetsListener (e.g.,
read binding.root.paddingBottom into a local like initialBottomPadding) and then
inside the listener call v.updatePadding(bottom = initialBottomPadding +
insets.bottom) so you preserve existing layout padding while still applying
system inset adjustments.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/src/main/java/com/itsaky/androidide/fragments/TemplateDetailsFragment.ktapp/src/main/java/com/itsaky/androidide/fragments/TemplateListFragment.kt
Make room for system navigation bar on
Project Template ListandProject Template Detailsscreens.