Skip to content

Instantly share code, notes, and snippets.

@skydoves
Created January 20, 2022 05: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 skydoves/7209aa0daae1e5ac3bbaad42fe80e331 to your computer and use it in GitHub Desktop.
Save skydoves/7209aa0daae1e5ac3bbaad42fe80e331 to your computer and use it in GitHub Desktop.
window_calculator
val wmc = WindowMetricsCalculator.getOrCreate()
val currentWM = wmc.computeCurrentWindowMetrics(this).bounds.flattenToString()
val maximumWM = wmc.computeMaximumWindowMetrics(this).bounds.flattenToString()
binding.metrics.text = "${currentWM}\n$maximumWM"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment