Skip to content

Instantly share code, notes, and snippets.

View EhsanMashhadi's full-sized avatar
🎯
Focusing

EM EhsanMashhadi

🎯
Focusing
View GitHub Profile
@EhsanMashhadi
EhsanMashhadi / android-team-code-convention.md
Last active June 28, 2018 13:30
Android team's code convention

Fields definition and naming

Fields should be defined at the top of the file and they should follow the naming rules listed below.

  • Private, non-static field names start with m.
  • Private, static field names start with s.
  • Other fields start with a lower case letter.
  • Static final fields (constants) are ALL_CAPS_WITH_UNDERSCORES.
  • For components in addition to the top rules,we use component+description.

Example:

import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.Display;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
public class OffsetItemDecoration extends RecyclerView.ItemDecoration {