Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge branch '4.8.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarinho committed Jul 20, 2020
2 parents a603efd + c318d98 commit 6d3c41f
Show file tree
Hide file tree
Showing 292 changed files with 8,616 additions and 1,050 deletions.
6 changes: 3 additions & 3 deletions Xamarin.Forms.ControlGallery.WindowsUniversal/BorderEffect.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using Xamarin.Forms;
using Xamarin.Forms.ControlGallery.WindowsUniversal;
using Xamarin.Forms.Platform.UWP;
using WSolidColorBrush = Windows.UI.Xaml.Media.SolidColorBrush;

[assembly: ExportEffect(typeof(BorderEffect), "BorderEffect")]
namespace Xamarin.Forms.ControlGallery.WindowsUniversal
Expand All @@ -15,7 +15,7 @@ protected override void OnAttached()
if (control == null)
return;

control.Background = new SolidColorBrush(Windows.UI.Colors.Aqua);
control.Background = new WSolidColorBrush(Windows.UI.Colors.Aqua);

var childLabel = (Element as ScrollView)?.Content as Label;
if (childLabel != null)
Expand All @@ -28,7 +28,7 @@ protected override void OnDetached()
if (control == null)
return;

control.Background = new SolidColorBrush(Windows.UI.Colors.Beige);
control.Background = new WSolidColorBrush(Windows.UI.Colors.Beige);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media;
using WGradientStop = Windows.UI.Xaml.Media.GradientStop;
using WGradientStopCollection = Windows.UI.Xaml.Media.GradientStopCollection;
using WLinearGradientBrush = Windows.UI.Xaml.Media.LinearGradientBrush;
using WRect = Windows.Foundation.Rect;

namespace Xamarin.Forms.ControlGallery.WindowsUniversal
Expand All @@ -24,8 +26,8 @@ public BrokenNativeControl ()
Children.Add (_textBlock);

Background =
new LinearGradientBrush (
new GradientStopCollection { new GradientStop { Color = Colors.Green, Offset = 0.5}, new GradientStop { Color = Colors.Blue, Offset = 1} }, 0);
new WLinearGradientBrush(
new WGradientStopCollection { new WGradientStop { Color = Colors.Green, Offset = 0.5}, new WGradientStop { Color = Colors.Blue, Offset = 1} }, 0);
}

public static readonly DependencyProperty TextProperty = DependencyProperty.Register (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Shapes;
using Xamarin.Forms.ControlGallery.WindowsUniversal;
using Xamarin.Forms.Controls.Issues;
using Xamarin.Forms.Platform.UWP;
using WEllipse = Windows.UI.Xaml.Shapes.Ellipse;
using WShape = Windows.UI.Xaml.Shapes.Shape;
using WSolidColorBrush = Windows.UI.Xaml.Media.SolidColorBrush;

[assembly: ExportRenderer(typeof(Xamarin.Forms.Controls.Issues.Bugzilla42602.TextBoxView), typeof(Xamarin.Forms.ControlGallery.WindowsUniversal.TextBoxViewRenderer))]
[assembly: ExportRenderer(typeof(Issue1683.EntryKeyboardFlags), typeof(EntryRendererKeyboardFlags))]
Expand Down Expand Up @@ -137,7 +138,7 @@ protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
{
Width = 200,
Height = 200,
Background = new SolidColorBrush(Windows.UI.Color.FromArgb(0, 255, 255, 255)),
Background = new WSolidColorBrush(Windows.UI.Color.FromArgb(0, 255, 255, 255)),
IsHitTestVisible = false
};

Expand All @@ -148,7 +149,7 @@ protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
{
Width = 100,
Height = 100,
Fill = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 0, 0)),
Fill = new WSolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 0, 0)),

};
Canvas.SetLeft(ellipse, 0);
Expand All @@ -161,7 +162,7 @@ protected override void OnElementChanged(ElementChangedEventArgs<BoxView> e)
FontSize = 50,
FontWeight = Windows.UI.Text.FontWeights.Normal,
Text = "hello world",
Foreground = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 0, 0))
Foreground = new WSolidColorBrush(Windows.UI.Color.FromArgb(255, 255, 0, 0))
};
Canvas.SetLeft(text, 0);
Canvas.SetTop(text, 150);
Expand Down
10 changes: 3 additions & 7 deletions Xamarin.Forms.ControlGallery.WindowsUniversal/FocusEffect.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI;
using Windows.UI.Xaml.Media;
using Xamarin.Forms;
using Xamarin.Forms.ControlGallery.WindowsUniversal;
using Xamarin.Forms.Platform.UWP;
using WSolidColorBrush = Windows.UI.Xaml.Media.SolidColorBrush;

[assembly: ExportEffect(typeof(FocusEffect), "FocusEffect")]
namespace Xamarin.Forms.ControlGallery.WindowsUniversal
Expand All @@ -19,8 +15,8 @@ protected override void OnAttached()
{
try
{
(Control as Windows.UI.Xaml.Controls.Control).Background = new SolidColorBrush(Colors.Cyan);
(Control as FormsTextBox).BackgroundFocusBrush = new SolidColorBrush(Colors.White);
(Control as Windows.UI.Xaml.Controls.Control).Background = new WSolidColorBrush(Colors.Cyan);
(Control as FormsTextBox).BackgroundFocusBrush = new WSolidColorBrush(Colors.White);
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Xamarin.Forms.Platform.UWP;
using WRectangleGeometry = Windows.UI.Xaml.Media.RectangleGeometry;
using WRect = Windows.Foundation.Rect;
using WSolidColorBrush = Windows.UI.Xaml.Media.SolidColorBrush;

namespace Xamarin.Forms.ControlGallery.WindowsUniversal
{
Expand Down Expand Up @@ -159,7 +160,7 @@ void AddNativeBindings(NativeBindingGalleryPage page)
};

var btnColor = new Windows.UI.Xaml.Controls.Button { Content = "Toggle Label Color", Height = 80 };
btnColor.Click += (sender, args) => txbLabel.Foreground = new SolidColorBrush(Windows.UI.Colors.Pink);
btnColor.Click += (sender, args) => txbLabel.Foreground = new WSolidColorBrush(Windows.UI.Colors.Pink);

var btnTextBox = new Windows.UI.Xaml.Controls.Button { Content = "Change text textbox", Height = 80 };
btnTextBox.Click += (sender, args) => txbBox.Text = "Hello 2 way native";
Expand All @@ -185,15 +186,15 @@ class ColorToBrushNativeBindingConverter : IValueConverter
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is Color)
return new SolidColorBrush(ToWindowsColor((Color)value));
return new WSolidColorBrush(ToWindowsColor((Color)value));

return null;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is SolidColorBrush)
return ToColor(((SolidColorBrush)value).Color);
if (value is WSolidColorBrush)
return ToColor(((WSolidColorBrush)value).Color);

return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Xamarin.Forms.ControlGallery.WindowsUniversal;
using Xamarin.Forms.Controls.Issues;
using Xamarin.Forms.Platform.UWP;
using WBrush = Windows.UI.Xaml.Media.Brush;
using WSolidColorBrush = Windows.UI.Xaml.Media.SolidColorBrush;

[assembly: ExportRenderer(typeof(Bugzilla57114._57114View), typeof(_57114Renderer))]

Expand All @@ -27,9 +28,9 @@ protected override void OnElementChanged(ElementChangedEventArgs<Bugzilla57114._
}
}

Brush ColorToBrush(Color color)
WBrush ColorToBrush(Color color)
{
return new SolidColorBrush(Windows.UI.Color.FromArgb((byte)(color.A * 255), (byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255)));
return new WSolidColorBrush(Windows.UI.Color.FromArgb((byte)(color.A * 255), (byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255)));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Xamarin.Forms.ControlGallery.iOS/_11132CustomRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected override void OnElementChanged(ElementChangedEventArgs<Issue11132Contr
Path = clipPath
};
layer.Mask = clipShapeLayer;
layer.Mask.Name = "test";
layer.Mask.Name = null;

Debug.WriteLine($"_11132CustomRenderer Layer Name { layer.Mask.Name}");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class GroupedItem : ObservableCollection<string>

protected override void Init()
{
var label = new Label { Text = Instructions };
var label = new Label { Text = Instructions, AutomationId = "TestReady" };
grouped = new ObservableCollection<GroupedItem>();
lstView = new ListView(ListViewCachingStrategy.RecycleElement) {
IsGroupingEnabled = true,
Expand Down Expand Up @@ -73,6 +73,7 @@ protected override void Init()
[Category(UITestCategories.ManualReview)]
public void Bugzilla36802Test()
{
RunningApp.WaitForElement("TestReady");
RunningApp.Screenshot("AccessoryView partially hidden test");
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class GroupedItem : ObservableCollection<string>

protected override void Init()
{
var label = new Label { Text = Instructions };
var label = new Label { Text = Instructions, };
grouped = new ObservableCollection<GroupedItem>();
lstView = new ListView()
{
Expand All @@ -57,6 +57,7 @@ protected override void Init()
ItemTemplate = new DataTemplate(typeof(MyViewCell)),
GroupHeaderTemplate = new DataTemplate(typeof(MyHeaderViewCell)),
ItemsSource = grouped,
AutomationId = "TestReady"
};

var grp1 = new GroupedItem() { LongName = "Group 1", ShortName = "1" };
Expand Down Expand Up @@ -87,6 +88,7 @@ protected override void Init()
[Category(UITestCategories.ManualReview)]
public void Bugzilla53834Test()
{
RunningApp.WaitForElement("TestReady");
RunningApp.Screenshot("incorrect row heights test");
}
#endif
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.Forms.Controls.Issues.Issue11050"
Title="Issue 11050">
<ContentPage.Resources>
<ResourceDictionary>

<Style TargetType="Path">
<Setter Property="Stroke" Value="Black" />
<Setter Property="StrokeThickness" Value="2" />
<Setter Property="Fill" Value="White" />
</Style>

</ResourceDictionary>
</ContentPage.Resources>
<Grid BackgroundColor="Red"
x:Name="grid"
WidthRequest="200"
HeightRequest="200"
HorizontalOptions="Start"
VerticalOptions="Start">
<!-- Small tick marks -->
<Path
WidthRequest="200"
HeightRequest="200"
Fill="{x:Null}"
StrokeThickness="3"
StrokeDashArray="0.1 3.04159">
<Path.Data>
<EllipseGeometry
RadiusX="90"
RadiusY="90" />
</Path.Data>
</Path>
<!-- Long tick marks -->
<Path
StrokeThickness="6"
StrokeDashArray="0.1 7.754">
<Path.Data>
<EllipseGeometry
RadiusX="90"
RadiusY="90" />
</Path.Data>
</Path>
<!-- Hour hand pointing straight up -->
<Path>
<Path.Data>
<PathGeometry
Figures="M 0 -60 C 0 -30, 20 -30, 5 -20 L 5 0
C 5 7.5, -5 7.5, -5 0 L -5 -20
C -20 -30, 0 -30, 0 -60" />
</Path.Data>
<Path.RenderTransform>
<RotateTransform
x:Name="hourHand"/>
</Path.RenderTransform>
</Path>
<!-- Minute hand pointing straight up -->
<Path>
<Path.Data>
<PathGeometry
Figures="M 0 -80 C 0 -75, 0 -70, 2.5 -60 L 2.5 0
C 2.5 5, -2.5 5, -2.5 0 L -2.55 -60
C 0 -70, 0 -75, 0 -80" />
</Path.Data>
<Path.RenderTransform>
<RotateTransform
x:Name="minuteHand" />
</Path.RenderTransform>
</Path>
<!-- Second hand pointing straight up -->
<Path>
<Path.Data>
<PathGeometry
Figures="M 0 10 L 0 -80" />
</Path.Data>
<Path.RenderTransform>
<RotateTransform
x:Name="secondHand"/>
</Path.RenderTransform>
</Path>
</Grid>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
using Xamarin.Forms.Core.UITests;
#endif

namespace Xamarin.Forms.Controls.Issues
{
#if UITEST
[Category(UITestCategories.Shape)]
#endif
[Preserve(AllMembers = true)]
[Issue(IssueTracker.Github, 11050, "[Bug][iOS][Android] Shapes: clock drawing erro", PlatformAffected.Android | PlatformAffected.iOS)]
public partial class Issue11050 : ContentPage
{
public Issue11050()
{
#if APP
Device.SetFlags(new List<string> { ExperimentalFlags.ShapesExperimental });

InitializeComponent();

Device.StartTimer(TimeSpan.FromMilliseconds(15), () =>
{
DateTime dateTime = DateTime.Now;
secondHand.Angle = 6 * (dateTime.Second + dateTime.Millisecond / 1000.0);
minuteHand.Angle = 6 * dateTime.Minute + secondHand.Angle / 60;
hourHand.Angle = 30 * (dateTime.Hour % 12) + minuteHand.Angle / 12;
return true;
});

SizeChanged += (sender, args) =>
{
grid.AnchorX = 0;
grid.AnchorY = 0;
grid.Scale = Math.Min(Width, Height) / 200;
};
#endif
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ protected override void Init()
var path = new Path
{
BackgroundColor = Color.LightGray,
Stroke = Color.Black,
Fill = Color.Blue,
Stroke = Brush.Black,
Fill = Brush.Blue,
StrokeThickness = 4,
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Expand Down
Loading

0 comments on commit 6d3c41f

Please sign in to comment.