I am trying to get Bottom navigation bar height, because my view height is dynamic which is dependent on navigation bar height.
But issue, In some device i get proper height of navigation bar, and in some device the height comes higher number then what height of navigation bar is visible in device.
Please check my code and screenshots of different devices.
val resources = context.resources
val resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android")
var navHeightBottom = 0
if (resourceId > 0) {
navHeightBottom = resources.getDimensionPixelSize(resourceId)
Logger.d("VideoRollComment", "nav height: $navHeightBottom")
}
Device Screenshot one which is not correct