Git Product home page Git Product logo

Comments (6)

sammyd avatar sammyd commented on August 17, 2024

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.

sammyd avatar sammyd commented on August 17, 2024

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.

mluedke2 avatar mluedke2 commented on August 17, 2024

@sammyd also anim and drawable. list here

from java-style-guide.

mluedke2 avatar mluedke2 commented on August 17, 2024

I like these. I would also add that we should consider setting a specific order for XML attributes, such as:

  • id attribute
  • layout_* attributes
  • styling attributes such as gravity or textColor
  • value attributes such as text or src

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.

DarrylBayliss avatar DarrylBayliss commented on August 17, 2024

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.

sammyd avatar sammyd commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.