ScreenSizeUtils

Functions

Link copied to clipboard
fun getDensity(context: Context = ContextHelper.getAppContext()): Float

Get the logical density of the display.

Link copied to clipboard
private fun getDisplay(activity: Activity): Display?

Get activity display.

Link copied to clipboard
fun getMobileScreenHeight(context: Context = ContextHelper.getAppContext()): Int

Gets the screen height in the current screen orientation.

Link copied to clipboard
private fun getMobileScreenSize(context: Context): Pair<Int, Int>
Link copied to clipboard
fun getMobileScreenWidth(context: Context = ContextHelper.getAppContext()): Int

Gets the screen width in the current screen orientation.

Link copied to clipboard
fun getScreenOrientation(context: Context = ContextHelper.getAppContext()): Int

Get screen orientation.

Link copied to clipboard

Get screen orientation in degrees. By default, it returns 0.

Link copied to clipboard
@RequiresApi(value = 30)
private fun getScreenSizeApi30(context: Context): Pair<Int, Int>

Get the ScreenSize of your device in api 30.

Link copied to clipboard
private fun getScreenSizeApi30Below(context: Context): Pair<Int, Int>

Get the ScreenSize of your device below api 30.

Link copied to clipboard
@RequiresApi(value = 31)
private fun getScreenSizeApi31(context: Context): Pair<Int, Int>

Get the ScreenSize of your device in api 31.

Link copied to clipboard

Get the StatusBar height.