-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Issue11050.xaml.cs
47 lines (41 loc) · 1.29 KB
/
Issue11050.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
}
}
}