This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Android] Fix issue with BoxView Color and CornerRadius (#12069)
* Added repro sample * Fix the issue * Fixed build error
- Loading branch information
1 parent
6153378
commit 6293975
Showing
3 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue12061.cs
This file contains 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,63 @@ | ||
using Xamarin.Forms.Internals; | ||
using Xamarin.Forms.CustomAttributes; | ||
|
||
#if UITEST | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
using Xamarin.Forms.Core.UITests; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.BoxView)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 12061, | ||
"[Bug] [Android] BoxView color is cleared when updating corner radius", | ||
PlatformAffected.Android)] | ||
public class Issue12061 : TestContentPage | ||
{ | ||
public Issue12061() | ||
{ | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
Title = "Issue 12061"; | ||
|
||
var layout = new StackLayout(); | ||
|
||
var instructions = new Label | ||
{ | ||
Padding = 12, | ||
BackgroundColor = Color.Black, | ||
TextColor = Color.White, | ||
Text = "Tap the Button. The BoxView must be updated with ConerRadius but without losing the Color. If the BoxView Color is kept, the test has passed." | ||
}; | ||
|
||
var boxView = new BoxView | ||
{ | ||
CornerRadius = 0, | ||
Color = Color.Red, | ||
HeightRequest = 60 | ||
}; | ||
|
||
var button = new Button | ||
{ | ||
Text = "Update CornerRadius" | ||
}; | ||
|
||
layout.Children.Add(instructions); | ||
layout.Children.Add(boxView); | ||
layout.Children.Add(button); | ||
|
||
Content = layout; | ||
|
||
button.Clicked += (sender, args) => | ||
{ | ||
boxView.CornerRadius = 12; | ||
}; | ||
} | ||
} | ||
} |
This file contains 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 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