Ejemplo n.º 1
0
 internal ScreenMetrics(double width, double height, double density, ScreenOrientation orientation, ScreenRotation rotation)
 {
     Width       = width;
     Height      = height;
     Density     = density;
     Orientation = orientation;
     Rotation    = rotation;
 }
Ejemplo n.º 2
0
        public void DeviceDisplay_Comparison(
            double width1,
            double height1,
            double density1,
            ScreenOrientation orientation1,
            ScreenRotation rotation1,
            double width2,
            double height2,
            double density2,
            ScreenOrientation orientation2,
            ScreenRotation rotation2,
            bool equals)
        {
            var device1 = new ScreenMetrics(
                width: width1,
                height: height1,
                density: density1,
                orientation: orientation1,
                rotation: rotation1);

            var device2 = new ScreenMetrics(
                width: width2,
                height: height2,
                density: density2,
                orientation: orientation2,
                rotation: rotation2);

            if (equals)
            {
                Assert.True(device1.Equals(device2));
                Assert.True(device1 == device2);
                Assert.False(device1 != device2);
                Assert.Equal(device1, device2);
                Assert.Equal(device1.GetHashCode(), device2.GetHashCode());
            }
            else
            {
                Assert.False(device1.Equals(device2));
                Assert.True(device1 != device2);
                Assert.False(device1 == device2);
                Assert.NotEqual(device1, device2);
                Assert.NotEqual(device1.GetHashCode(), device2.GetHashCode());
            }
        }
Ejemplo n.º 3
0
 private void OnEnable()
 {
     _instance        = this;
     _currentRotation = Input.deviceOrientation;
 }
Ejemplo n.º 4
0
 void OnEnable()
 {
     _instance = target as ScreenRotation;
 }
 /// <summary>
 /// Updates the cached screen rotation value.
 /// </summary>
 /// <param name="rotation">The screen's current rotation.</param>
 public static void UpdateScreenRotation(ScreenRotation rotation)
 {
     AndroidScreenRotationService.screenRotation = rotation;
 }
 /// <summary>
 /// Updates the cached screen rotation value.
 /// </summary>
 /// <param name="rotation">The screen's current rotation.</param>
 public static void UpdateScreenRotation(ScreenRotation rotation)
 {
     AndroidScreenRotationService.screenRotation = rotation;
 }