You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a known issue with Dimensions in Android that cause it to report wrong values. I guess it might be different on different devices, in my Galaxy S5 Mini running Android 5 it always gets stuck with the values app had on launch (e.g. if you start in Portrait, dimensions will be stating narrow screen width forever, even if you rotate the device). Naturally media queries relying on Dimensions do not work properly then. I think I've heard of some similar issues on iOS, but as for Android they are present for sure.
Another option for tracking the real screen size (that I am using in my app at the moment) is to have one View that takes the whole screen and watch for its onLayout event - its parameters seem to deliver real view size quite reliably. That is useless for react-native-extended-stylesheet at the moment, but possibly you could allow overriding the default dimensions with whatever clients wants e.g. via .build(forcedCurrentDimensions)?
P.S.
Sorry if I am producing too many issues, @vitalets You made an awesome module that simplifies styling for the different devices a lot, so I am reporting what I discover when getting it into use.
The text was updated successfully, but these errors were encountered:
There is a known issue with Dimensions in Android that cause it to report wrong values. I guess it might be different on different devices, in my Galaxy S5 Mini running Android 5 it always gets stuck with the values app had on launch (e.g. if you start in Portrait, dimensions will be stating narrow screen width forever, even if you rotate the device). Naturally media queries relying on Dimensions do not work properly then. I think I've heard of some similar issues on iOS, but as for Android they are present for sure.
The proper way for fetching the screen size seems to use Android's native
DisplayMetrics
, there is even an npm module doing it - https://www.npmjs.com/package/react-native-extra-dimensions-android (maybereact-native-extended-stylesheet
could depend on this one?).Another option for tracking the real screen size (that I am using in my app at the moment) is to have one
View
that takes the whole screen and watch for itsonLayout
event - its parameters seem to deliver real view size quite reliably. That is useless forreact-native-extended-stylesheet
at the moment, but possibly you could allow overriding the default dimensions with whatever clients wants e.g. via.build(forcedCurrentDimensions)
?P.S.
Sorry if I am producing too many issues, @vitalets You made an awesome module that simplifies styling for the different devices a lot, so I am reporting what I discover when getting it into use.
The text was updated successfully, but these errors were encountered: