New Feature of intellij idea 12: Provides New XML refactoring tools for Android Developers

Source: Internet
Author: User

I have been using intellij idea for Android development, and I feel quite comfortable. The latest intellij idea 12 (What's New ?) Released, including many new features. I have selected a feature related to the android development framework for you to introduce. The translation is as follows:

Recently, we have added a new refactoring tool for the android XML layout file. All refactoring operations can now be used in the editor, In the uidesigner, or directly in the quick view.

We have prepared for you as follows:

    • Extract Style. Styles in Android are similar to stacked Style Sheets (CSS) in web design. They allow you to separate designs from the content. With This refactoring tool, you can create a new style with a layout xml tag. You only need to place the cursor in the XML tag, and select refactor | extract | style… In the shortcut menu of the XML editor ..., You can also select refactor | extract style… In the uidesigner...

In addition, it is also feasible to extract the parent style from the declared style.

    • Inline Style. Sometimes, you need to perform the opposite operation: add all attributes in a style to the relevant components (one or all), or merge the parent style to its successor. To perform this operation, you need to select refactor | inline style… from the pop-up menu... . Alternatively, you can use the common "inline..." function to place the cursor in "@ style/..." and pressCTRL + ALT + n(Or MacMeta + ALT + n). On the UI design page, you can select refactor | inline style... .
    • Extract Layout. Android can use <include> tag reuse layout. With This refactoring, you can move some la s into independent files and insert the <include> label in the original position to replace it. Therefore, you can select one or more elements in the layout, and then select refactor | extract | layout... . In the uidesigner, refactor | extract layout… can be used for refactoring... Run.

    • Inline Layout. This refactoring allows you to inline some included labels. To do this, you need to select an included file in the project view, or place the cursor to "@ layout /..." Press CTRL + ALT + N. Like other refactoring operations, you can also use the pop-up menu in the uidesigner.

Suggestions: There is a good way to execute all the refactoring, that is,Refactor | refactor this .... Remember Its shortcut keys and you will be able to use them.

Prompt: All Android-related functions are available for free.In intellij idea community versions

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.