Support rotation and different screen dimensions.