I am working on a home screen widget. I hope this widget can support auto rotation. For example, if the phone is in portrait mode, I want this home screen widget to be 2 cell * 2 cell on the home screen; if the phone is in landscape mode, I want this home screen widget changes be 3 cell * 1 cell on the home screen. Is it possible that I can make it?
Thanks.
You can specify a different layout file in the /res/layout-land directory to give your widget a different layout when the home screen is in layout orientation.
However you can’t change from 2×2 to 3×1 on orientation change, as this could very easily cause a conflict with other widgets/icons on the home screen.
To test screen orientation change on the emulator you can press the ‘Home’ key on the number pad of your computer’s keyboard (‘7’ on the number pad with ‘Num Lock’ turned off).