Skip to content

Instantly share code, notes, and snippets.

@MartinZikmund
Created April 4, 2019 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinZikmund/441b8c866eb2b641c6e6c4a98d5d9219 to your computer and use it in GitHub Desktop.
Save MartinZikmund/441b8c866eb2b641c6e6c4a98d5d9219 to your computer and use it in GitHub Desktop.
partial void Initialize()
{
UpdateProperties();
}
private void UpdateProperties()
{
var realDisplayMetrics = new DisplayMetrics();
var windowManager = ContextHelper.Current.GetSystemService(Context.WindowService).JavaCast<IWindowManager>();
windowManager.DefaultDisplay.GetRealMetrics(realDisplayMetrics);
UpdateRawProperties(realDisplayMetrics);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment