Hello all. It might look like a silly question, but I can’t find an answer… I’d like to check the current screen orientation, in order to add and remove css classes according to it, but I really can’t find a way. Can someone point me to the correct answer?
You know I was looking to achieve the same thing… It’s difficult because I couldn’t find any events to specifically listen for it. The most up to date plug in and the one I’m using is https://github.com/yoik/cordova-yoik-screenorientation
What you might be able to do (I haven’t tried it yet, just haven’t gotten to that specific part of my app yet) is use Angular to $watch the screen.orientation and check if it changes.
I’m sure you can achieve a pretty good result with that. If you want to get fancy try fading in the new elements on a time out and that will make it look a lot smoother.
True, however there are a lot of things like dynamic data that may need to be loaded. Example: In my app when you rotate the screen it is going to load and pull data for a type of graph that will be shown that’s not visible in the other view.
Though for simple ui stuff, the media might work really well.
Well that could be solved with CSS properties, classes in a hidden resolution and another does not. I think it’s the easiest way, do not know any method that identifies what you need. If anything, I said.