No effect when device is landscape
Using MediaQueryDebug to watch my device params. When i invert my device to landscape, window params not change. So when i use <MediaQuery maxDeviceWidth={768}> он my tablet(1280*720), in landscape mode it show me same as in portraint. Did i do something wrong?
You need to watch for Dimensions API
I thought this would already be built-in! Without that, it doesn't make much sense
I create this thing:
<MediaQuery minDeviceWidth={this.state.minDeviceWidth}></MediaQuery> /* landscape version*/
<MediaQuery maxDeviceWidth={this.state.maxDeviceWidth}></MediaQuery> /* portrait version*/
And i change minDeviceWidth, maxDeviceWidth on orientationchange(it works), but MediaQuery does not rebuild, how can i force rerender?
I was having the same issue than @vonovak and I strongly agree that it makes no sense if that is not built-in. I am not talking about live changes on dimensions but at least static ones (ie: starting the app already in landscape mode).
I was investigating a bit more and I found what causes the module to apply always portrait dimensions:
In lib/api/utils/device.js the device width and hieght are defined as follows:
static dpWidth = Math.min(Dimensions.get("window").width, Dimensions.get("window").height)
static dpHeight = Math.max(Dimensions.get("window").width, Dimensions.get("window").height)
That is, from my point of view, completely wrong since then your width is always the small one even when using your device in landscape. Replaching those lines by the default window width and height would make the app to work as expected.
static dpWidth = Dimensions.get("window").width
static dpHeight = Dimensions.get("window").height
@adbayb @raarts What are you thoughts on that?