Skip to content

Latest commit

 

History

History
49 lines (37 loc) · 2.1 KB

CONTRIBUTING.md

File metadata and controls

49 lines (37 loc) · 2.1 KB

How to contribute

Simply fork and clone this repo, and download Android Studio to start coding!

When you have made a satisfactory change (and tested it!), submit a pull request.

Style guidelines

Following these style guidelines will increase the chance that your pull request will be accepted!

General

  • Remove trailing whitespace
  • Tab indentation
  • Avoid/break lines longer than 100 characters

Java

  • Use camelCasing in Java files, including naming
  • Use an empty line between methods
  • Use spaces between operands
  • Use a space—not a newline—before {
  • Prefix class variables with m
  • Tag overridden methods with @Override
  • Keep overridden methods at the top of the file

Resource files

  • Use underscores in xml and res files, including naming
  • Order views in the order that they would appear on a device from top to bottom, left to right
  • Order layout properties as follows: id, layout_width, layout_height, other layout_ properties, other properties
  • Write a good commit message!

Coding guidelines

  • Implement Parcelable rather than Serializable
  • Use fragments
  • Simplify the view hierarchy in layouts whenever possible
    • Prefer RelativeLayout over nesting layouts (avoid nesting in most situations)
    • Use a FrameLayout if possible to reduce overhead
    • Remove unnecessary top-level layouts
  • When calling Log, use a class variable as a tag, e.g. private static final String TAG
    • Preferred Log.d call style: Log.d(TAG, "Text");
    • Preferred Log.e call style: Log.e(TAG, "Error text", new Error());

Recommended

  • Optimize imports frequently (Code -> Optimize Imports)
  • Inspect code occasionally (Analyze -> Inspect Code)

Anything not mentioned here? Just take a look at the source code. Based on thoughtbot's contributing.md and style guide.