Comments (6)
Do you also recommend colours in colors.xml? And some of the other resources? is dimens.xml standard? What other ones are there?
from java-style-guide.
At the moment I'm thinking that these guidelines should be incorporated within the java style guide in a section dedicated to xml. That ok? If it is then I'll go ahead and make it.
from java-style-guide.
@sammyd also anim and drawable. list here
from java-style-guide.
I like these. I would also add that we should consider setting a specific order for XML attributes, such as:
id
attributelayout_*
attributes- styling attributes such as
gravity
ortextColor
- value attributes such as
text
orsrc
and then alphabetical within those four groups.
This makes it really easy to scan over layout xml and not have to search around every element. The exception I would make is if the tutorial specifically involves writing the attributes in a different order.
from java-style-guide.
I think colors/dimens.xml files are good to use as well. I think of it as CSS in a way. The style of a view should be abstracted away as much as possible unless there is a good reason not to. Same should go for content.
Totally agree with @mluedke2 about the order/alphabetical formatting for XML. I think the default formatter does this for you, so we should assume thats what Google wants us to adopt.
from java-style-guide.
I have added these suggestions to the guide. Please take a look at the new XML section, and if there are any problems then either PR or create a new issue.
Thanks guys
from java-style-guide.
Related Issues (7)
- Field prefixes HOT 3
- Eclipse version
- Copyright Header HOT 4
- Setters/Getters Preferred over public fields HOT 6
- Access Level Modifiers HOT 1
- Discourage Use of Enums HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-style-guide.