Recently, we’ve added a number of new refactorings for Android XML layout files. All the refactorings can be used right in the editor, in the UI designer (from “Design” panel or “Component Tree”) or can be invoked from the Structure View.
So, here’s what we’ve prepared for you:
- Extract Style. Styles in Android is an analogue of cascading stylesheets in web design — they allow you to separate the design from the content. With this new refactoring you can create a new style from a layout XML tag. To perform refactoring just place the caret into an XML tag and choose Refactor | Extract | Style… from a popup menu in XML editor or Refactor | Extract Style… in the UI designer. Moreover, it is possible to extract parent style from an existing style declaration.