Skip to content

[Bug] Null safe bug fix #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Nicole's comment
  • Loading branch information
Leo Neat committed May 28, 2020
commit a973f34f3d13ff88bd8e849c56e112d003a62e30
Original file line number Diff line number Diff line change
Expand Up @@ -1263,9 +1263,10 @@ class MediaAppTestingActivity : AppCompatActivity() {
// Gets the current screen height in pixels
fun getScreenHeightPx(context: Context): Int {
val displayMetrics = DisplayMetrics()
val windowManager = ContextCompat.getSystemService(context, WindowManager::class.java)
val display = windowManager?.defaultDisplay
display?.getMetrics(displayMetrics)
val windowManager = context.getSystemService(WindowManager::class.java)
?: throw IllegalStateException("Could not get WindowManager")
val display = windowManager.defaultDisplay
display.getMetrics(displayMetrics)
return displayMetrics.heightPixels
}
}
Expand Down