Skip to content

Commit

Permalink
[Android] Make functions static that accidentally became non-static i…
Browse files Browse the repository at this point in the history
…n Kotlin
  • Loading branch information
RobDangerous committed Nov 10, 2023
1 parent 71f9d24 commit 64632e3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class KincActivity: NativeActivity(), KeyEvent.Callback {
return manager.defaultDisplay.rotation
}

@JvmStatic
fun getScreenDpi(): Int {
val context: Context = instance!!.applicationContext
val manager: WindowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
Expand All @@ -71,12 +72,14 @@ class KincActivity: NativeActivity(), KeyEvent.Callback {
return metrics.xdpi.toInt()
}

@JvmStatic
fun getRefreshRate(): Int {
val context: Context = instance!!.applicationContext
val manager: WindowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
return manager.defaultDisplay.refreshRate.toInt()
}

@JvmStatic
fun getDisplayWidth(): Int {
val context: Context = instance!!.applicationContext
val manager: WindowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
Expand All @@ -85,6 +88,7 @@ class KincActivity: NativeActivity(), KeyEvent.Callback {
return size.x
}

@JvmStatic
fun getDisplayHeight(): Int {
val context: Context = instance!!.applicationContext
val manager: WindowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
Expand Down

0 comments on commit 64632e3

Please sign in to comment.