Git Product home page Git Product logo

java-style-guide's People

Contributors

mluedke2 avatar morbix avatar rwenderlich avatar sammyd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-style-guide's Issues

Field prefixes

The Android style guide recommends using m and s prefixes for member fields and static fields respectively.

This is of questionable use, and a lot of the wider Java community has decided to drop this convention, since IDEs will inform you of this kind of thing.

What should we do?

XML Styling

Because XML is arguably just as important as Java on the Android system, I propose that we come up with some sort of convention that also falls in line with the guides governing attributes of conciseness, readability and simplicity.

What I'm suggesting is based on a general look at how XML is declared for standard components/suggested names in Android Studio and looking at other similar guides on GitHub

Prefix view based .xml files with the type of view they represent.

  • activity_login.xml
  • fragment_main_screen.xml
  • button_rounded_edges.xml

XML Indentation

Indentation for elements should be kept to 2 characters

Keep style based XML attributes in the styles.xml file

Unless there is good reason to deviate. All styling for your view components in your app should be done in the styles.xml file to keep style elements in one place.

Keep all strings in the strings.xml file

Again unless there is good reason to deviate we should keep any strings in the app in strings.xml for quick availability.

Mostly likely other things and I hope others chime in.

Copyright Header

There is a section in the guide regarding the copyright header. Is this appropriate to have in there?

Access Level Modifiers

I think we should recommend explicitly stating the access level modifier of a member variable (private, protected, public). This will make sure there is no ambiguity to access modifiers for variables and reduce the chance accidentally omitting access levels.

Eclipse version

It would be great if there were an installation files for Eclipse as well.

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.