Recent Changes‎ > ‎

    New Configuration Chooser in the Layout Editor

    posted May 16, 2012, 9:30 AM by Tor Norbye   [ updated May 16, 2012, 9:34 AM ]
    The Layout Editor has a "configuration chooser" area above the layout editor, where you can choose screen size, orientation, etc:
    It works just fine, but has some disadvantages:
    • It takes up a lot of space
    • Switching orientations requires multiple clicks
    • It's showing some settings that are rarely used
    • It does not handle narrow widths well; take a look at what happens to the menus on the second row for example:

    In ADT 20, the old configuration chooser has been replaced by a brand new configuration toolbar:
    Instead of combo boxes, it uses drop down menus, which allows us to use icons, separators and perhaps more importantly, we can lazily compute the contents of the menus.

    Here's the locale menu for example, showing the usefulness of icons in these menus:
    And here's the theme menu. As you can see we now have logical nesting and grouping, so unlike in the old drop down menu you don't have to scroll to find for example Holo.Light.Dialog. And all the themes local to the project, and any themes referenced explicitly in the manifest, are also grouped together:
    Right to the left of the welcome menu is the orientation menu. You can just click on it to quickly flip orientation, so in the above screenshot the layout is currently in landscape orientation, and the flip button shows the portrait mode. You can also click on the drop down arrow next to the button, to see the other associated options:
    Notice how the UI Mode and the Night mode have been moved into this menu; they aren't used often enough that they warrant permanent visibility in the layout editor.

    And instead, we've added a new menu: The Activity chooser. This lets you choose the activity context to use for this layout:
    When you open a layout the first time, we attempt to guess the right layout (by looking at your activity classes and seeing which layouts they reference), but you can choose a different activity here. The activity associated with a layout is used to pick which theme to render with, in the case where you've assigned themes to activities in your manifest file. You can also open the activity in the Java editor by choosing "Open activity name". In the future we will also use the activity<->layout association to drive other features.

    The leftmost menu lists the current configuration, such as "default", or "layout-xlarge", etc. If you open the associated menu, you can see which other versions of this layout you have:
    You can also create a new layout (which is what the "Create..." button in the old configuration chooser did).

    The device menu to its right should be obvious; it's where you choose among the various screen sizes to render your layout with. We plan to add your AVD's into this menu as soon as possible. 

    And finally, the Android logo on the right is where you pick the rendering target for your layout. Instead of showing the version name (e.g. Android 4.0), we now show just the API number, though in the drop down menu you can see the full labels:
    While the goal of the new configuration toolbar is to fit in a single line (which is why we abbreviate your screen names, the rendering target name, strip the "Theme." prefix off of theme names etc), in the case where it just won't fit, the toolbar will wrap:
    We'll have a Preview 2 of ADT 20 out soon. Please give the new configuration toolbar a try and let us know if you see any problems.
    Comments