Recent Changes‎ > ‎

Layout Editor Context Menu Improvements

posted Sep 13, 2011, 6:55 PM by Tor Norbye
The layout editor has been improved in a couple of different ways.

First, we've recorded what the most commonly set attributes are for each view (based on running some statistics over various open source Android apps.)  The context menu now shows these most common attributes at the top of the menu, so for example if you right click on a Ratings view, you see this:
All widgets commonly set "id", "layout_width" and "layout_height", so those menus are always there. However, for a Ratings view, the numStars, stepSize, style and isIndicator attributes are often set so they are all listed here for easy access.

Second, notice the "Other Properties" pull-right menu above. This contains all the attributes available for this view, and it used to be one giant alphabetical menu which was difficult to navigate (though a scroll-wheel helps). Now, the menu is itself divided into multiple sub menus:
  • The "Recent" menu lists properties you've recently set.
  • The "Layout Parameters" sub menu lists only the layout parameters available here (which depends not on the type of the selected view, but its parent).
  • The "All By Name" menu is precisely what this menu used to contain: All attributes, unfiltered.
  • The menus in the middle of the menu correspond to all the View classes that the current view (in this case RatingBar), inherits from. We now track the source of each attribute, such that we can list them together. If you for example open the attributes "Inherited from ProgressBar", you get this:
Third, we now include submenus for the parents of the selection. If you for example have a Button inside a LinearLayout inside a RelativeLayout, and you right click on the button, your menu will contain this:
Here, "linearLayout1" is the id of the parent LinearLayout, and "relativeLayout1" is the id of the grandparent RelativeLayout. This makes it easy to access the attributes of containers, especially in the case where they are completely covered by child elements such that it's hard to target the view itself in the layout editor. (It's usually easier to access these views from the Outline).
Comments