-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(CornerRadius): [Android]Remove twice drawn border, adjust Backgro…
…und that was underneath the border and properly calculate inner corner radius for common cases
- Loading branch information
Agnès Zitte
committed
Sep 1, 2021
1 parent
d97a9b6
commit 4d0976a
Showing
8 changed files
with
310 additions
and
171 deletions.
There are no files selected for viewing
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
37 changes: 37 additions & 0 deletions
37
...amplesApp/UITests.Shared/Windows_UI_Xaml_Controls/BorderTests/Border_BorderThickness.xaml
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,37 @@ | ||
<Page x:Class="Uno.UI.Samples.UITests.BorderTestsControl.Border_BorderThickness" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml_Controls.BorderTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:controls="using:Uno.UI.Samples.Controls" | ||
mc:Ignorable="d"> | ||
|
||
<StackPanel> | ||
<!-- With BorderBrush and BorderThickness --> | ||
<TextBlock Text="With BorderBrush and BorderThickness" /> | ||
<Border Width="100" | ||
Height="50" | ||
Background="Red" | ||
BorderBrush="#66121212" | ||
BorderThickness="15"> | ||
</Border> | ||
|
||
<!-- With BorderBrush but no BorderThickness --> | ||
<TextBlock Margin="0,30,0,0" | ||
Text="With BorderBrush but no BorderThickness" /> | ||
<Border Width="100" | ||
Height="50" | ||
Background="Red" | ||
BorderBrush="#66121212"> | ||
</Border> | ||
|
||
<!-- With BorderThickness but no BorderBrush --> | ||
<TextBlock Margin="0,30,0,0" | ||
Text="With BorderThickness but no BorderBrush" /> | ||
<Border Width="100" | ||
Height="50" | ||
Background="Red" | ||
BorderThickness="15" /> | ||
</StackPanel> | ||
</Page> |
27 changes: 27 additions & 0 deletions
27
...lesApp/UITests.Shared/Windows_UI_Xaml_Controls/BorderTests/Border_BorderThickness.xaml.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,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Runtime.InteropServices.WindowsRuntime; | ||
using Uno.UI.Samples.Controls; | ||
using Windows.Foundation; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Controls.Primitives; | ||
using Windows.UI.Xaml.Data; | ||
using Windows.UI.Xaml.Input; | ||
using Windows.UI.Xaml.Media; | ||
using Windows.UI.Xaml.Navigation; | ||
|
||
namespace Uno.UI.Samples.UITests.BorderTestsControl | ||
{ | ||
[Sample("Border")] | ||
public sealed partial class Border_BorderThickness : Page | ||
{ | ||
public Border_BorderThickness() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
} | ||
} |
100 changes: 58 additions & 42 deletions
100
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/BorderTests/Border_CornerRadius.xaml
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 |
---|---|---|
@@ -1,51 +1,67 @@ | ||
<Page x:Class="Uno.UI.Samples.UITests.BorderTestsControl.Border_CornerRadius" | ||
xmlns:controls="using:Uno.UI.Samples.Controls" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.UI.Samples.UITests.BorderTestsControl" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:ios="http://uno.ui/ios" | ||
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:android="http://uno.ui/android" | ||
mc:Ignorable="d ios android"> | ||
xmlns:controls="using:Uno.UI.Samples.Controls" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:Uno.UI.Samples.UITests.BorderTestsControl" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:ios="http://uno.ui/ios" | ||
xmlns:win="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:android="http://uno.ui/android" | ||
mc:Ignorable="d ios android"> | ||
|
||
<ScrollViewer> | ||
<StackPanel> | ||
<Border Width="100" | ||
Height="50" | ||
CornerRadius="4" | ||
BorderThickness="1" | ||
BorderBrush="Black" /> | ||
|
||
<controls:SampleControl SampleDescription="Border_Simple"> | ||
<controls:SampleControl.SampleContent> | ||
<DataTemplate> | ||
<StackPanel> | ||
<Border Height="30" /> | ||
<Border Background="Red" | ||
Width="100" | ||
Height="100" | ||
CornerRadius="24,50,50,12" /> | ||
|
||
<Border Width="100" | ||
Height="50" | ||
CornerRadius="4" | ||
BorderThickness="1" | ||
BorderBrush="Black" /> | ||
|
||
<Border Height="30" /> | ||
<Border Background="Red" | ||
Width="100" | ||
Height="100" | ||
CornerRadius="24,50,50,12" /> | ||
<Border Height="30" /> | ||
<Border Background="Red" | ||
Width="100" | ||
Height="50" | ||
CornerRadius="24,50,50,12" /> | ||
|
||
<Border Height="30" /> | ||
<Border Background="Black"> | ||
<Border Background="Red" | ||
Width="150" | ||
Height="50" | ||
BorderBrush="Aqua" | ||
BorderThickness="5" | ||
CornerRadius="75" /> | ||
</Border> | ||
|
||
<Border Height="30" /> | ||
<Border Background="Red" | ||
Width="100" | ||
Height="50" | ||
CornerRadius="24,50,50,12" /> | ||
<Border Height="30" /> | ||
<Border Width="100" | ||
Height="50" | ||
Background="Red" | ||
CornerRadius="12" | ||
BorderBrush="#66121212" | ||
BorderThickness="1" /> | ||
|
||
<Border Height="30" /> | ||
<Border Background="Black"> | ||
<Border Background="Red" | ||
Width="150" | ||
Height="50" | ||
BorderBrush="Aqua" | ||
BorderThickness="5" | ||
CornerRadius="75" /> | ||
</Border> | ||
</StackPanel> | ||
<Border Height="30" /> | ||
<Border Width="100" | ||
Height="50" | ||
Background="Red" | ||
CornerRadius="12" | ||
BorderBrush="#66121212" | ||
BorderThickness="5" /> | ||
|
||
</DataTemplate> | ||
</controls:SampleControl.SampleContent> | ||
</controls:SampleControl> | ||
<Border Height="30" /> | ||
<Border Width="100" | ||
Height="50" | ||
Background="Red" | ||
CornerRadius="15" /> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</Page> |
Oops, something went wrong.