First, set the Java code format
1. Open Eclipse and Find window---->perferences---->java---->code style-->formatter
2. Create a new formatter, inherit the built-in style, then click Edit to Modify
Second, set the XML file format
1. open window---->perferences---->xml---->xml files-->editor
2. Select Split multiple attributes each on a new lines (each property of the tag is displayed on a separate line)
Uncheck Align final bracket in multi-line element tags (tag terminator does not occupy a single line)
Check Indent using spaces (indent using spaces instead of tab)
Indentation size is set to 4, that is, 4 spaces are indented (set indent width)
Third, resolve the problem that the format format of the resource file (XML file) is not satisfactory
After setting the XML file format settings as described above, it is found that the layout file format achieves the desired goal, while the XML file in the Drawable resource file is still quite chaotic.
Set the perfect solution to the problem as follows.
1. open window---->preferences---->android---->editors
Check out the places you've marked.
Eclipse Code Formatting