How can I get the size of the screen in pixels with navigation bar and status bar being included?
I have already tried getting the size using DisplayMetrics
but the size doesn't include the software navigation bar.
How can I get the size of the screen in pixels with navigation bar and status bar being included?
I have already tried getting the size using DisplayMetrics
but the size doesn't include the software navigation bar.
software navigation is added since API 17 (JELLY_BEAN_MR1) so we need the to include the size of navigation bar only in API 17 and above. and note that when you get the screen size it is based on the current orientation.
link to gist -> here