Android Rotation and Screen Size Handling with Xamarin
This demo shows how to deal with different layouts based on screen sizes and rotation of devices.
I have read so much about handling screen sizes and layout that I wanted to try and play a bit myself to get a better understanding. My goals were:
- Support phone screens with full screen transitions
- Use a navigation drawer for middle sized tablets (wether that makes sense or not is another discussion)
- Use a dual pane layout for 10 inch devices
- Base everything on Fragments only
- Apply custom animations when transitioning between the screens
- Declaring layouts: https://developer.android.com/guide/topics/ui/declaring-layout.html
- Screen size management using the "smallest width" selectors: http://android-developers.blogspot.de/2011/07/new-tools-for-managing-screen-sizes.html
- Handling rotation with Xamarin: http://developer.xamarin.com/guides/android/application_fundamentals/handling_rotation/
- Definitions of smallest widths for various devices: http://android.amberfog.com/?tag=smallestwidth
Dual Pane on big(ger) Tablets
Drawer Layout on small(er) Tablets
Two screens on phones
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.