-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Implement SafeAreaEdges property for per-edge safe area control #30337
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
Merged
Parent:
[main] Net10.0
Merged
Changes from 31 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
8e5fe27
Initial plan
Copilot 50b9fd0
Add Edge Support for SafeAreas and extend to ScrollView
PureWeen 9d3e947
- fix public APIS
PureWeen ea1d701
- fix publicapi
PureWeen 7568cba
- fix default safearea
PureWeen dfbf462
- fix tests
PureWeen 221807a
- publicapi fix
PureWeen 7d0cc5b
Fix Controls.Sample compilation errors - update SafeAreaElement API u…
Copilot c408853
Remove IgnoreSafeAreaForEdge from ISafeAreaView2 interface and conver…
Copilot 40b81f7
- fix
PureWeen 12ee04a
- fix netstandard
PureWeen 9de66b9
- fix
PureWeen f1ec5ef
Make SafeAreaEdges immutable and update SafeAreaRegions flag values
Copilot 48f80fb
Add *.bak to .gitignore to exclude backup files
Copilot ea762aa
Remove formatting-only changes unrelated to SafeArea functionality
Copilot 5df550a
Add comprehensive diagnostic logging and timing analysis for build pe…
Copilot 63c3b7b
Revert diagnostic logging changes from Cake file
Copilot f21f92d
Simplify Issue28986 test to use buttons only instead of pickers
Copilot f5058c8
Make SafeAreaEdges a readonly struct
Copilot 97dbe78
- fix test
PureWeen 5fae900
Fix SafeArea UI tests to validate actual screen positioning instead o…
Copilot 5c72da1
- fix up defaults
PureWeen f77577e
- fix edge case
PureWeen da577bd
- fix tests and defaults
PureWeen ce8d2e0
- fix tests
PureWeen 1d913bb
- fix test
PureWeen 76817da
- slight adjustment to contentsize
PureWeen a9b3b7f
- maybe?
PureWeen 8a7e376
- cleanup code
PureWeen 8778141
- fix test and add a comment
PureWeen 26b5d87
- fix device test and remove some apis
PureWeen 765fffa
Add per-edge SafeArea validation, ScrollView test suite, and revert .…
Copilot d282b5c
Add Entry control for SoftInput testing and fix ScrollView SafeAreaEdges
Copilot c0af54e
- fix UI Tests to validate more scenarios
PureWeen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| .nuspec/ | ||
| .buildtasks/ | ||
| templatesTest/ | ||
| *.bak | ||
|
|
||
| # User-specific files | ||
| *.rsuser | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/Controls/src/Core.Design/SafeAreaEdgesTypeDesignConverter.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| using System; | ||
| using System.ComponentModel; | ||
| using Controls.Core.Design; | ||
| using Microsoft.Maui; | ||
|
|
||
| namespace Microsoft.Maui.Controls.Design | ||
| { | ||
| public class SafeAreaEdgesTypeDesignConverter : StringConverter | ||
| { | ||
| public override bool IsValid(ITypeDescriptorContext context, object value) | ||
| { | ||
| // MUST MATCH SafeAreaEdgesTypeConverter.ConvertFrom | ||
| string strValue = value?.ToString()?.Trim(); | ||
| if (string.IsNullOrEmpty(strValue)) | ||
| return false; | ||
|
|
||
| // Split by comma and check each part | ||
| string[] parts = strValue.Split(','); | ||
|
|
||
| // Must have 1, 2, or 4 parts | ||
| if (parts.Length != 1 && parts.Length != 2 && parts.Length != 4) | ||
| return false; | ||
|
|
||
| // Each part must be a valid SafeAreaRegions value | ||
| foreach (string part in parts) | ||
| { | ||
| string trimmedPart = part.Trim(); | ||
| if (!string.Equals(trimmedPart, "All", StringComparison.OrdinalIgnoreCase) && | ||
| !string.Equals(trimmedPart, "None", StringComparison.OrdinalIgnoreCase) && | ||
| !string.Equals(trimmedPart, "Default", StringComparison.OrdinalIgnoreCase) && | ||
| !string.Equals(trimmedPart, "SoftInput", StringComparison.OrdinalIgnoreCase) && | ||
| !string.Equals(trimmedPart, "Container", StringComparison.OrdinalIgnoreCase)) | ||
| { | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| return true; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.