Device-Independent Pixels

The Dimensions module’s Dimensions.get('screen').scale and Dimensions.get('window').scale are calculated differently in You.i Platform compared to the Facebook RN. In order to provide Device-independent Pixels (DIP) units across all supported platforms, You.i React Native calculates the scale with the equation below, where BASE_DPI is 72 DPI.

((pixel density along the x-axis + pixel density along the y-axis) / 2 ) / BASE DPI

Dimensions.get('screen').width and Dimensions.get('window').width are calculated in the same way in You.i React Native as in the Facebook RN. The screen and widow width are equal to actual device resolution’s width or scale. Note that the scale is calculated differently in You.i React Native, the values for the window and screen width are different from the those returned by the Facebook RN for the same device. This is expected and necessary to support DIPs across all of the You.i React Native’s supported target platforms. Similarly Dimensions.get('screen').height and Dimensions.get('window').height are calculated as actual device resolution’s height or scale.