Added orientation changes support.

Thanks for the code, everything's great!
I need to be able to work in landscape mode, so I added support for orientation changes.