-
Notifications
You must be signed in to change notification settings - Fork 106
[MBL-18831] Implement edge-to-edge rendering with landscape support #3346
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
base: master
Are you sure you want to change the base?
Conversation
- Enable edge-to-edge in NavigationActivity with EdgeToEdgeHelper - Apply window insets to bottom navigation bar to handle navigation bar overlap - Apply window insets to DashboardFragment toolbar for status bar spacing - Update toolbar layout to wrap_content with minHeight to accommodate status bar padding - Create WindowInsetsHelper utility to replace deprecated SYSTEM_UI_FLAG APIs - Create EdgeToEdgeHelper utility for consistent edge-to-edge enablement - Update theme to use transparent system bars for edge-to-edge rendering 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Enable edge-to-edge in NavigationActivity with opaque status bar - Add extension functions in WindowInsetsHelper for common inset patterns: - applyTopSystemBarInsets() - applyBottomSystemBarInsets() - applyHorizontalSystemBarInsets() - applySystemBarInsets() with flexible parameters - doOnApplyWindowInsets() for custom handling - Update DashboardFragment to handle toolbar top insets - Update CourseBrowserFragment for collapsing toolbar edge-to-edge support - Apply bottom insets to navigation bar and divider - Change toolbar layouts to wrap_content with minHeight for dynamic sizing - Set status bar to opaque (darkStatusBarColor) and navigation bar to transparent 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Create CanvasScaffold with built-in edge-to-edge support - Automatically handles navigation bar insets via contentWindowInsets - Drop-in replacement for Material Scaffold - Update CanvasAppBar and CanvasThemedAppBar with status bar insets - TopAppBar now includes windowInsets = WindowInsets.statusBars - Automatically pushes toolbar content below status bar - Create WindowInsetsModifiers.kt with reusable modifier extensions - systemBarsPadding() for both status and navigation bar padding - statusBarsPadding() for status bar only - Update CalendarScreen to use CanvasScaffold - Update AssignmentListScreen to use CanvasScaffold All Compose screens can now adopt edge-to-edge by simply using CanvasScaffold instead of Scaffold, with proper inset handling automatically applied. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Add ViewCompat.requestApplyInsets() to WindowInsetsHelper for proper inset dispatch timing - Apply top status bar insets to all XML fragment toolbars - Apply bottom navigation bar insets to scrollable content (RecyclerViews, ScrollViews, WebViews, ViewPagers) - Update CanvasScaffold to automatically wrap content with navigation bar insets for all Compose screens - Change XML toolbar heights from fixed actionBarSize to wrap_content with minHeight - Add missing view IDs and imports Implements MBL-18831 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Apply top status bar insets to toolbars in XML fragments - Apply bottom navigation bar insets to scrollable content (SwipeRefreshLayout, ScrollView) - Update XML toolbar heights from fixed actionBarSize to wrap_content with minHeight - Updated fragments: - EditDashboardFragment - InboxFragment (both toolbar and editToolbar) - EmailNotificationPreferencesFragment - PushNotificationPreferencesFragment - OfflineContentFragment - SyncSettingsFragment - HomeroomFragment Implements MBL-18831 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…e screens - Remove bottom insets from DashboardFragment (has bottom navigation bar) - Update pandautils Compose screens to use CanvasScaffold: - GradesScreen - SettingsScreen - SmartSearchScreen - SmartSearchPreferencesScreen - Add missing import for HomeroomFragment Fixes double padding issue on screens with bottom navigation bars. CanvasScaffold automatically handles navigation bar insets for all Compose screens. Implements MBL-18831 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Implement comprehensive edge-to-edge rendering across Teacher, Parent, Student apps and shared libraries, fixing all layout overlaps and inset handling issues. **Teacher App:** - Fix StudentContextFragment and FileListFragment crashes (LayoutParams type mismatch - RelativeLayout vs CoordinatorLayout) - Add edge-to-edge for 40+ fragments including CourseSettings, QuizList, DiscussionsList, FileSearch, PostPolicy, CommentLibrary, Profile, SpeedGrader fragments, and more - Fix FAB insets across all fragments with correct LayoutParams types - Update 50+ XML layouts with proper toolbar height handling (wrap_content + minHeight pattern) **Parent App:** - Fix DashboardFragment toolbar insets - Add FAB insets to CourseDetailsScreen and ManageStudentsScreen (Compose) - Fix edge-to-edge for QrPairing, AnnouncementDetails, Alerts, AlertSettings, Courses, and CreateAccount screens **Student App:** - Update night mode styles for edge-to-edge compatibility **Shared Libraries:** *pandautils:* - Add edge-to-edge for DiscussionDetailsWebViewFragment, LtiLaunchFragment, AssignmentDetailsFragment - Fix InboxFragment FAB insets with programmatic CoordinatorLayout handling - Fix InboxDetailsScreen Compose toolbar overlap with status bar insets - Fix TriStateBottomSheet navigation bar overlap in SpeedGrader - Remove unnecessary Scaffold padding in SpeedGraderContentScreen - Update theme values for edge-to-edge compatibility *login-api-2:* - Add edge-to-edge for all login activities (FindSchool, LandingPage, SignIn, LoginWithQR, AcceptableUsePolicy) - Update login activity layouts with proper toolbar height handling - Update theme styles for edge-to-edge Key patterns implemented: - Toolbars: applyTopSystemBarInsets() + wrap_content + minHeight - Scrollable content: applyBottomSystemBarInsets() - FABs: Manual insets with correct LayoutParams type matching parent container - Compose: windowInsetsPadding() + contentWindowInsets = WindowInsets(0,0,0,0) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…ixes
This commit completes the edge-to-edge rendering implementation across
all apps (Teacher, Student, Parent) and shared libraries by addressing
HIGH and MEDIUM priority issues identified in comprehensive expert review.
## Expert Review Results
Implementation assessed at ~90% complete with solid architecture and patterns.
All critical functionality now properly supports edge-to-edge rendering with
landscape support and keyboard handling.
## Changes Made
### HIGH Priority Fixes (Expert Review)
1. **Fixed CanvasScaffold to Support Text Input Screens**
- Added contentWindowInsets parameter with default WindowInsets.navigationBars
- Allows screens to specify IME union for text input or zero insets as needed
- Added comprehensive KDoc with usage examples
- Location: libs/pandautils/src/main/java/com/instructure/pandautils/compose/composables/CanvasScaffold.kt
2. **Fixed Missing IME Insets Request in SpeedGraderCommentsFragment**
- Added ViewCompat.requestApplyInsets() for commentInputContainer
- Ensures IME insets apply immediately when view is attached
- Prevents keyboard appearing before insets are applied
- Location: apps/teacher/src/main/java/com/instructure/teacher/fragments/SpeedGraderCommentsFragment.kt:186-188
3. **Completed Parent App Fragment Coverage**
- Updated SimpleWebViewFragment with toolbar and horizontal insets
- Added applyTopSystemBarInsets() to toolbar in applyTheme()
- Added applyHorizontalSystemBarInsets() to root view in onViewCreated()
- Location: apps/parent/src/main/java/com/instructure/parentapp/features/webview/SimpleWebViewFragment.kt
### MEDIUM Priority Fixes
4. **Fixed Missing Toolbar Insets in AttendanceListFragment**
- Added toolbar.applyTopSystemBarInsets() in setupViews()
- Ensures status bar doesn't overlap toolbar
- Location: apps/teacher/src/main/java/com/instructure/teacher/fragments/AttendanceListFragment.kt:117
5. **Updated 5 Compose Screens with Text Input for IME Support**
- Added WindowInsets.ime.union(WindowInsets.navigationBars) to:
* InboxComposeScreen.kt (subject + body fields)
* RecipientPickerScreen.kt (search field)
* InboxSignatureScreen.kt (signature field)
* CreateUpdateToDoScreen.kt (title/description fields)
* CreateUpdateEventScreen.kt (title/location fields)
- Prevents keyboard from obscuring text input fields
- All locations: libs/pandautils/src/main/java/com/instructure/pandautils/features/*/composables/
6. **Updated 11 Compose Screens with Zero Content Insets**
- Added WindowInsets(0, 0, 0, 0) to read-only/list screens:
* CourseSelectorActivity.kt
* SubmissionListScreen.kt
* SelectContextScreen.kt
* GradePreferencesScreen.kt
* AssignmentListFilterScreen.kt
* CalendarFilterScreen.kt
* ProgressScreen.kt
* ToDoScreen.kt
* EventScreen.kt
* CustomFrequencyScreen.kt
* SpeedGraderCommentLibraryScreen.kt
- Ensures proper edge-to-edge rendering without IME interference
## Architecture Summary
**Hybrid Insets Approach:**
- Horizontal insets → Fragment root views (landscape support)
- Vertical insets → Individual scrollable views
- IME insets → Text input containers (keyboard avoidance)
- Compose contentWindowInsets → Properly configured per screen type
**Patterns Established:**
- View-based fragments: applyHorizontalSystemBarInsets() on root
- Toolbars: applyTopSystemBarInsets() before other setup
- Scrollable content: applyBottomSystemBarInsets() or custom IME handling
- Compose screens: Explicit contentWindowInsets configuration
- FABs: windowInsetsPadding() with systemBars horizontal + bottom
## Files Modified Summary
- 1 Helper class (CanvasScaffold.kt) - Enhanced with parameter
- 3 View-based fragments - Fixed missing insets
- 16 Compose screens - Added contentWindowInsets configuration
- Total: 20 files modified
## Build Verification
✅ Teacher app builds successfully (devDebug)
✅ Student app builds successfully (devDebug)
✅ Parent app builds successfully (devDebug)
## Testing Checklist
Verified:
- [x] All apps compile without errors
- [x] CanvasScaffold parameter properly passed through
- [x] IME insets request added where needed
- [x] Parent app View-based fragments covered
Manual testing recommended:
- [ ] Text input screens - keyboard doesn't obscure inputs
- [ ] Landscape mode - horizontal insets working
- [ ] All bottom navigation screens - content not clipped
- [ ] Dialogs and bottom sheets - proper insets handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
Resolved conflict in SmartSearchPreferencesScreen.kt by keeping CanvasScaffold (from our edge-to-edge branch) instead of plain Scaffold (from master), while preserving the onCancel callback fix from master.
📊 Code Coverage Report✅ Student
|
| * Apply status bar insets as padding. | ||
| * Use this for components that should be pushed below the status bar. | ||
| */ | ||
| fun Modifier.statusBarsPadding() = composed { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that needed? There is a builtin Modifier that does the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA Findings in Slack thread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also sent my QA Findings in Slack thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have some really minor suggestions, but haven't tested the build.
| private fun setupWindowInsets() = with(binding) { | ||
| toolbar.applyTopSystemBarInsets() | ||
|
|
||
| androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(annotationCommentsRecyclerView) { view, insets -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also experienced that Claude doesn't really like to import things. Maybe we could add this to the MD as well. And we should refactor these.
| private fun setupWindowInsets() = with(binding) { | ||
| toolbar.applyTopSystemBarInsets() | ||
|
|
||
| ViewCompat.setOnApplyWindowInsetsListener(annotationCommentsRecyclerView) { view, insets -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make this an extension function, I see a lot of duplication here.
Summary
Implements comprehensive edge-to-edge rendering across all Canvas Android apps (Teacher, Student, Parent) and shared libraries, with full landscape mode support and keyboard handling.
Changes
Architecture
contentWindowInsetsconfigurationWindowInsetsHelper.ktwith extension functions for consistent insets applicationImplementation Details
View-Based Fragments (83 files)
applyHorizontalSystemBarInsets()to root views for landscape supportapplyTopSystemBarInsets()to toolbars for status bar handlingapplyBottomSystemBarInsets()to scrollable contentmaxOf(ime.bottom, systemBars.bottom)Compose Screens (32 files)
WindowInsets.ime.union(WindowInsets.navigationBars)WindowInsets(0, 0, 0, 0)windowInsetsPadding(WindowInsets.systemBars.only(...))CanvasScaffoldwith flexiblecontentWindowInsetsparameterTheme Configuration
windowOptOutEdgeToEdgeEnforcementfrom all app themesEdgeToEdgeHelper.enableEdgeToEdge()in onCreateFiles Modified
Test plan:
Manual testing performed:
Testing recommended:
refs: MBL-18831
affects: Teacher, Student, Parent
release note: Implemented edge-to-edge rendering with full landscape support for Android 15+ requirements
Checklist