-
Notifications
You must be signed in to change notification settings - Fork 2k
Make sure to redraw the background drawable when the size is updated #22626
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
db5deae
don't reuse the same bounds instance
PureWeen 06bc5d8
the bounds is not used
mattleibow 6058254
- add tests
PureWeen b466d80
- add snapshots and cleanup testbase
PureWeen a0ebcd4
- update height images
PureWeen c699f99
- add one screenshot retry
PureWeen d9c5b49
Added Windows snapshots
jsuarezruiz 025b7e6
Updated snapshot
jsuarezruiz b648408
More changes
jsuarezruiz 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
Binary file added
BIN
+29.2 KB
...droid.Tests/snapshots/android/BorderBackgroundSizeUpdatesWhenRotatingScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.1 KB
...s/tests/TestCases.Android.Tests/snapshots/android/Issue22606_SetHeightTo200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.1 KB
...s/tests/TestCases.Android.Tests/snapshots/android/Issue22606_SetHeightTo500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions
35
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue22606.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,35 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues | ||
| { | ||
| public class Issue22606 : _IssuesUITest | ||
| { | ||
| public Issue22606(TestDevice device) : base(device) { } | ||
|
|
||
| public override string Issue => "Border does not expand on Content size changed"; | ||
|
|
||
| [Test] | ||
| public void BorderBackgroundExpandsOnContentSizeChanged() | ||
| { | ||
| App.WaitForElement("SetHeightTo200"); | ||
| App.Tap("SetHeightTo200"); | ||
| VerifyScreenshot("Issue22606_SetHeightTo200"); | ||
|
|
||
| App.Tap("SetHeightTo500"); | ||
| VerifyScreenshot("Issue22606_SetHeightTo500"); | ||
| } | ||
|
|
||
| #if ANDROID || IOS | ||
| [Test] | ||
| public void BorderBackgroundSizeUpdatesWhenRotatingScreen() | ||
| { | ||
| App.WaitForElement("SetHeightTo200"); | ||
| App.Tap("SetHeightTo200"); | ||
| App.SetOrientationLandscape(); | ||
| VerifyScreenshot(); | ||
| } | ||
| #endif | ||
| } | ||
| } |
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
Binary file added
BIN
+7.55 KB
...ols/tests/TestCases.WinUI.Tests/snapshots/windows/Issue22606_SetHeightTo200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.49 KB
...ols/tests/TestCases.WinUI.Tests/snapshots/windows/Issue22606_SetHeightTo500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.6 KB
...Cases.iOS.Tests/snapshots/ios/BorderBackgroundSizeUpdatesWhenRotatingScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.6 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Issue22606_SetHeightTo200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.7 KB
src/Controls/tests/TestCases.iOS.Tests/snapshots/ios/Issue22606_SetHeightTo500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,23 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <ContentPage | ||
| xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| x:Class="Maui.Controls.Sample.Issues.Issue22606" | ||
| Title="Issue 22606"> | ||
| <VerticalStackLayout> | ||
| <Border Stroke="Red" | ||
| BackgroundColor="blue" | ||
| StrokeThickness="5" | ||
| Margin="20"> | ||
| <Grid x:Name="content" | ||
| HeightRequest="200" | ||
| WidthRequest="300"/> | ||
| </Border> | ||
| <Button Text="Set Height to 200" | ||
| Clicked="OnSetHeightTo200Clicked" | ||
| AutomationId="SetHeightTo200"/> | ||
| <Button Text="Set Height to 500" | ||
| Clicked="OnSetHeightTo500Clicked" | ||
| AutomationId="SetHeightTo500"/> | ||
| </VerticalStackLayout> | ||
| </ContentPage> |
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,26 @@ | ||
| using System; | ||
| using Microsoft.Maui.Controls; | ||
| using Microsoft.Maui.Controls.Xaml; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues | ||
| { | ||
| [XamlCompilation(XamlCompilationOptions.Compile)] | ||
| [Issue(IssueTracker.Github, 22606, "Border does not expand on Content size changed", PlatformAffected.All)] | ||
| public partial class Issue22606 : ContentPage | ||
| { | ||
| public Issue22606() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| void OnSetHeightTo200Clicked(object sender, EventArgs e) | ||
| { | ||
| content.HeightRequest = 200; | ||
| } | ||
|
|
||
| void OnSetHeightTo500Clicked(object sender, EventArgs e) | ||
| { | ||
| content.HeightRequest = 500; | ||
| } | ||
| } | ||
| } |
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
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.
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.
It is not important for this PR, but just like we do in portrait, in landscape we must eliminate the navigation bar.