Commit 2c8cee6
[release/10.0.1xx-sr1] [Android] Refactor WindowInsetListener to per-view registry with MauiWindowInsetListener (#32443)
* Initial plan
* Implement improved WindowInsetListener with per-coordinator layout support
- Add CoordinatorLayoutEntry registry for tracking local listeners
- Implement optimized IsViewContainedIn with early termination
- Add proper nullability markers on all fields
- Update GlobalWindowInsetListener with comprehensive thread safety documentation
- Refactor IME animation handling with helper method
- Remove global listener from MauiAppCompatActivity
- Update ShellContentFragment and ShellSectionRenderer with local listeners
- Update NavigationRootManager with local listener support
- Improve code formatting and comments throughout
Co-authored-by: PureWeen <[email protected]>
* Complete improved WindowInsetListener implementation
- Update ViewHandler.Android.cs to use registry-based approach
- Update ContentViewGroup, LayoutViewGroup, MauiScrollView to use FindListenerForView
- Update SafeAreaExtensions.cs to use new listener pattern
- Update WindowHandler.Android.cs with cleanup comments
- Remove modal-specific listener code from ModalNavigationManager.Android.cs
- Format all changed files according to .editorconfig
Co-authored-by: PureWeen <[email protected]>
* Fix nullable annotations in files with #nullable disable
- Remove '?' from field declarations in ShellContentFragment and ShellSectionRenderer
- These files have #nullable disable directive so explicit nullable annotations cause errors
- Fields are still properly handled as nullable through null checks
Co-authored-by: PureWeen <[email protected]>
* Simplify Shell fragment storage by using typed CoordinatorLayout fields
- Change _root from AView to CoordinatorLayout in ShellContentFragment
- Change _rootView from AView to CoordinatorLayout in ShellSectionRenderer
- Remove redundant _managedCoordinatorLayout fields since _root/_rootView are now typed
- GlobalWindowInsetListener registry already tracks the layout-listener pairs
- NavigationRootManager keeps _managedCoordinatorLayout since _rootView can be different types
Co-authored-by: PureWeen <[email protected]>
* - simplify listener code
* - rework a bit with how listeners are applied
* - fix code so it doesn't add layout listener to everything
* - fix a few wrong registrations
* - fix test for CollectionView
* Rename GlobalWindowInsetListener to MauiWindowInsetListener and add RegisterParentForChildViews
- Rename GlobalWindowInsetListener class to MauiWindowInsetListener for better clarity
- Rename GlobalWindowInsetListenerExtensions to MauiWindowInsetListenerExtensions
- Update extension methods: TrySetMauiWindowInsetListener, RemoveMauiWindowInsetListener
- Add RegisterParentForChildViews static method to register a parent for child insets without attaching listener to parent
- Update FlyoutViewHandler to use RegisterParentForChildViews instead of instantiating listener
- Update all references across codebase
Co-authored-by: PureWeen <[email protected]>
* Set SafeAreaEdges to None in ScrollViewTests.ShouldGrow test
- Set SafeAreaEdges = SafeAreaEdges.None on childLayout (VerticalStackLayout)
- Set SafeAreaEdges = SafeAreaEdges.None on scrollView (ScrollView)
- Set SafeAreaEdges = SafeAreaEdges.None on parentLayout (Grid)
- This ensures the test is isolated from safe area inset handling changes
Co-authored-by: PureWeen <[email protected]>
* Revert formatting-only changes to focus on functional changes
Reverted formatting changes (indentation, whitespace) from files that had no functional changes:
- EditTextExtensions.cs
- ViewExtensions.cs
- PickerExtensions.cs
- SearchViewExtensions.cs
- StepperHandlerManager.cs
- MauiPageControl.cs
- MauiSwipeView.cs
- MauiWebView.cs
- IHandleWindowInsets.cs
- ShellToolbarTracker.cs
- ShellFlyoutTemplatedContentRenderer.cs
Kept functional change in SafeAreaExtensions.cs (MauiWindowInsetListener.FindListenerForView) while reverting formatting changes.
This makes the PR focused on functional changes only, with formatting changes deferred to a separate PR.
Co-authored-by: PureWeen <[email protected]>
* Revert "Revert formatting-only changes to focus on functional changes"
This reverts commit 534c071.
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: PureWeen <[email protected]>
Co-authored-by: Shane Neuville <[email protected]>1 parent 5762c7b commit 2c8cee6
File tree
30 files changed
+956
-790
lines changed- src
- Controls
- src/Core
- Compatibility/Handlers/Shell/Android
- Handlers/Items/Android
- tests
- DeviceTests/Elements/ScrollView
- Core/src
- Core
- Handlers
- FlyoutView
- Toolbar
- View
- Window
- Platform/Android
30 files changed
+956
-790
lines changedLines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| 139 | + | |
| 140 | + | |
138 | 141 | | |
139 | 142 | | |
140 | 143 | | |
| |||
143 | 146 | | |
144 | 147 | | |
145 | 148 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
| |||
Lines changed: 56 additions & 47 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
| 104 | + | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
| 117 | + | |
| 118 | + | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
139 | 141 | | |
140 | | - | |
| 142 | + | |
141 | 143 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
152 | 154 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
163 | 165 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
167 | 172 | | |
168 | 173 | | |
169 | | - | |
| 174 | + | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | | - | |
| 178 | + | |
173 | 179 | | |
174 | 180 | | |
175 | 181 | | |
| |||
202 | 208 | | |
203 | 209 | | |
204 | 210 | | |
205 | | - | |
| 211 | + | |
206 | 212 | | |
207 | 213 | | |
208 | 214 | | |
| |||
718 | 724 | | |
719 | 725 | | |
720 | 726 | | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
721 | 733 | | |
722 | 734 | | |
723 | 735 | | |
| |||
726 | 738 | | |
727 | 739 | | |
728 | 740 | | |
729 | | - | |
730 | | - | |
| 741 | + | |
731 | 742 | | |
732 | 743 | | |
733 | 744 | | |
734 | 745 | | |
735 | | - | |
736 | | - | |
| 746 | + | |
737 | 747 | | |
738 | 748 | | |
739 | 749 | | |
| |||
764 | 774 | | |
765 | 775 | | |
766 | 776 | | |
767 | | - | |
768 | | - | |
| 777 | + | |
769 | 778 | | |
770 | 779 | | |
771 | 780 | | |
| |||
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
| 71 | + | |
70 | 72 | | |
71 | 73 | | |
72 | 74 | | |
| |||
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
104 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
194 | 198 | | |
195 | 199 | | |
196 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
197 | 207 | | |
198 | 208 | | |
199 | 209 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | | - | |
478 | | - | |
| 477 | + | |
479 | 478 | | |
480 | 479 | | |
481 | 480 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
Lines changed: 1 addition & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
| |||
320 | 319 | | |
321 | 320 | | |
322 | 321 | | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | 322 | | |
333 | 323 | | |
334 | 324 | | |
| |||
383 | 373 | | |
384 | 374 | | |
385 | 375 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 376 | | |
401 | 377 | | |
402 | 378 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
178 | | - | |
179 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
0 commit comments