forked from xamarin/Xamarin.Forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestDeviceInfo.cs
53 lines (47 loc) · 1000 Bytes
/
TestDeviceInfo.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
48
49
50
51
52
53
using Xamarin.Forms.Internals;
namespace Xamarin.Forms.DualScreen.UnitTests
{
internal class TestDeviceInfo : DeviceInfo
{
public TestDeviceInfo()
{
CurrentOrientation = DeviceOrientation.Portrait;
}
public override Size PixelScreenSize
{
get
{
if(CurrentOrientation == DeviceOrientation.Landscape)
return new Size(1000, 2000);
else
return new Size(2000, 1000);
}
}
public override Size ScaledScreenSize
{
get
{
var pixelSize = PixelScreenSize;
return new Size(pixelSize.Width / ScalingFactor, pixelSize.Height / ScalingFactor);
}
}
public override double ScalingFactor
{
get { return 2; }
}
}
internal class TestDeviceInfoPortrait : TestDeviceInfo
{
public TestDeviceInfoPortrait()
{
CurrentOrientation = DeviceOrientation.Portrait;
}
}
internal class TestDeviceInfoLandscape : TestDeviceInfo
{
public TestDeviceInfoLandscape()
{
CurrentOrientation = DeviceOrientation.Landscape;
}
}
}