Added a newline at the end of the file to silence the compiler warning
Properly update the positioning if the device orientation changes