Multi-view Edit with the Xamarin.Android Designer

James Montemagno

Included in the latest releases of Xamarin Studio 4.2 and Xamarin.Android 4.10 in Visual Studio is an exciting new feature in the Android designer, multi-view editing.

[youtube http://www.youtube.com/watch?v=Z9DCL8b9u58]

Android layout management brings a unique approach to optimizing for different screen layouts and sizes by using different resource folder names. You will commonly see layout folder names such as:

MultipleLayoutFolder

Managing the various layout xml files inside each folder can be an extremely tedious chore. However, with multi-view editing in Xamarin.Android, this has all been simplified to make layout file management a breeze for developers. With multi-view editing you can easily create new layouts specifying a wide range of options, view all of your layouts at once, add new controls to all layouts at once, and even update properties on controls in one place and have the designer update all layout files.

Creating New Layouts

One issue I have always had when creating layout folders is trying to remember all of the available qualifiers and what order they need to go in when naming the folder. The Android designer now handles all of this for you. Simply click on “New version” when viewing a layout and the “Create Layout Variation” dialog will appear allowing you to fully customize the new layout to your specific needs. It even gives you a preview of what the layout will look like based on the qualifiers set.

NewVersion CreateLayoutVariation

Multi-view Editing

After setting up the layouts you want for a specific view, you can start editing multiple layouts at once by turning on “Multi-edit”. Once this is enabled you can turn on and off which views you want to edit by selecting the “edit” dot next to the layout preview:

MultiViewEdit

When you add new controls to the designer, it will automatically add it to all of the selected layouts. You can even adjust individual properties of those controls, such as in the following screenshot showing a few TextViews with the text adjusted to 100dp:

AddText

Get started today and speed up your Android layout development and download latest version of Xamarin.Android, available in both Xamarin Studio and Visual Studio.

Feedback usabilla icon