Wednesday, February 11, 2015

Landscape Layouts

     I've been working on the updating the layouts in Android Studio for the CHRONI app and by messing around, I figured out how to add landscape layouts. At first I was only worried about adding layouts for standard size phones, but now I've paused to make these landscape layouts. To create a landscape layout in Android Studio, right click on a layout that has been designed in the layout folder directory, the first option will say "New." Click on that. Once the New tab has been clicked, the first option will say "Layout resource file." Click that. This opens a small screen that will let you choose qualifiers for your layout with options such as Language, Size, Ration, Orientation, Night Mode, and others. Enter the same layout name as the original and tag on the .xml extension. Then select the orientation qualifier and hit the right arrow button in the middle of the window. This will drag it to the chosen qualifiers table. It then gives you screen orientation options. It is set on portrait as a default, but change this to landscape. When creating my layouts, I also added Size as a qualifier to create different layouts for different screen sizes. X-large usually refers to 10 inch tablets, large as 7 inch tablets, normal as standard phones, and small as a Wear Square. I really didn't add any small layouts because I'm very doubtful that a geochronologist would want to use CHRONI with a wear square... Also there's no way layouts we have designed would work with it effectively; however, I added one just to show you the different layout options. Below are screen shots of the GUIs.

xlarge - Nexus 10
large - Nexus 7
normal - Nexus 4
small - Wear Square