Skip to content

Commit

Permalink
Update src/Core/src/Platform/Tizen/WindowExtensions.cs
Browse files Browse the repository at this point in the history
Co-authored-by: Kangho Hur <kangho.hur@samsung.com>
  • Loading branch information
PureWeen and rookiejava committed May 19, 2022
1 parent dc2c2ec commit 3f870e2
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/Core/src/Platform/Tizen/WindowExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,14 @@ static void OnBackButtonPressed(Window window)
s_windowCloseRequestHandler[window].Invoke();
}

internal static Devices.DisplayOrientation GetOrientation(this IWindow window)
{
int displayWidth = PlatformUtils.GetFeatureInfo<int>("screen.width");
int displayHeight = PlatformUtils.GetFeatureInfo<int>("screen.height");

if (displayHeight >= displayWidth)
{
return Devices.DisplayOrientation.Portrait;
}
else
internal static Devices.DisplayOrientation GetOrientation(this IWindow window) =>
window.Handler?.MauiContext?.GetPlatformWindow()?.Rotation switch
{
return Devices.DisplayOrientation.Landscape;
}
}
0 => Devices.DisplayOrientation.Portrait,
90 => Devices.DisplayOrientation.Landscape,
180 => Devices.DisplayOrientation.Portrait,
270 => Devices.DisplayOrientation.Landscape,
_ => Devices.DisplayOrientation.Unknown
};
}
}

0 comments on commit 3f870e2

Please sign in to comment.