-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Android Shell BackButtonBehavior TextOverride #20179
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: main
Are you sure you want to change the base?
Android Shell BackButtonBehavior TextOverride #20179
Conversation
|
Hey there @kubaflo! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs
Show resolved
Hide resolved
src/Controls/src/Core/Compatibility/Handlers/Shell/Android/ShellToolbarTracker.cs
Show resolved
Hide resolved
|
/azp run MAUI-UITests-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
a5054e9 to
b23432d
Compare
b23432d to
12e42bc
Compare
|
/rebase |
12e42bc to
d73e014
Compare
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.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
d73e014 to
d00ba53
Compare
|
/rebase |
4c0a993 to
1fdc673
Compare
Introduces UI and NUnit tests to verify that the Shell BackButtonBehavior TextOverride property displays the full text (e.g., 'Cancel') without truncation on Android. These tests ensure the recent fix for text truncation is validated and provide regression coverage for issue dotnet#19747.
…nshot - Use TestShell base class for proper test infrastructure - Add Android baseline screenshot for VerifyScreenshot() to work - Clean up test code and add descriptive comments
1fdc673 to
b5a8d79
Compare
🤖 AI Summary📊 Expand Full Review🔍 Pre-Flight — Context & Validation📝 Review Session — Delete pr-20179.md ·
|
| # | Source | Approach | Test Result | Files Changed | Notes |
|---|---|---|---|---|---|
| PR | PR #20179 | Dynamic font size reduction until text fits within Android's navigation icon width constraints | ⏳ PENDING (Gate) | ShellToolbarTracker.cs (+9) | Original PR - adds loop to decrease TextSize until it fits |
Note: try-fix candidates (1, 2, 3...) are added during Phase 4. PR's fix is reference only.
Exhausted: No
Selected Fix: [PENDING]
Description of Change
This is a fix for the issue related to a NavigationIcon on Android. Generally, a navigation icon should be an image but, MAUI gives us a hacky way of making it a text. It does so by converting a text into an image. The problem is that Android restricts the size of the navigation icon so if we use too long text it will be truncated (this behavior is on both MAUI and Xamarin Apps).
I suggest decreasing the text size until it fits within the available width allowed by Android when someone decides to use custom text as a back icon. The only disadvantage would be that long texts will have a tiny font. On the other hand iOS's shell doesn't even allow having long texts and it displays them as 'back' labels. Maybe we should consider something similar for Android?
Nevertheless, I think it is still better than confusing developers and users with truncated text.
Issues Fixed
Fixes #19747
Screen.Recording.2024-01-26.at.16.53.28.mov