Skip to content
Gabriel Moreno edited this page Nov 16, 2019 · 3 revisions

Welcome to the Equipo5 wiki!

Git-flow

carpetas de los branches

feature/{nombre_del_branch} -> cuando realizamos un task o creamos una nueva funcionalidad

bugfix/{nombre_del_branch} -> Cuando trabajamos en arreglar bugs antes del release

hotfix/{nombre_del_branch} -> Cuando trabajamos en arreglar bugs despues del release y necesitamos arreglarlo urgentemente

Nombre de los branches

{carpeta}/{codigo_del_ticket}_{Descripcion del ticket}

Ejemplo: 
feature/ABC-001_implementacion-del-drawer-menu

Nombre de los commits:

Cuando hacemos un commit primero pondremos el codigo del ticket, la razon es porque asi podremos trackear de donde viene una vez mergeamos el branch con develop ya que una vez mergeado el branch se destruira por defecto.

Ejemplo:
ABC-001: incluir colores predeterminados en colors.xml

Naming Conventions

Companion Object

The companion objects should have been declared just below the class declaration. There are 2 main trends to position this singleton: at the top of the class or at the bottom. Normally it should depend on the importance of the variables or functions declared. Due to we use to write extras, request codes, functions for starting the activities and so on, it is logical to put it at the top of the class.

Functions order

The order of the functions in a class, should follow a logical way for understanding the behavior. For example, in an Activity, the first functions must be the lifeCycle ones: onCreate(), onResume(), onActivityResult(), etc. The order of those functions, should be written (more or less) in the order of trigger that the Activity has. Another example: the init{} statement must be at the very beginning of the class, just below the companion object if it exists.

Package names

Commonly, the name of the packages will be on singular. I.e.: adapters Vs adapter

Class Names

Activities

Activity Example: MainActivity, LoginActivity

Layouts

This way of naming is for handing the lack of subfolders in the layout folder.

Content Views

The layouts for the activities, fragments and so on, must be named starting with the name of the type of class, followed by the name of the feature in snake case. Example: MainActivity activity_main Example: BeautyOnboardingFragment fragment_beauty_onboarding_fragment

Items

The items must be called with the prefix item_.

Views

Prefixes

Widget Prefix
TextView tv
ImageView iv
LinearLayout ll
Button btn
EditText et
ConstraintLayout cl
Toolbar tb
TextureView textureView
Checkbox cb
RecyclerView rv
... ...
Collections

Example: list of countries countries. Avoid things like countriesList or worse, listCountries. If a country is a object of the type Coun try, the list is just its plural (due to collections are the most used list).

Extras & Arguments
Extra

The extra variables used for passing data to an Activity have to follow this convention: EXTRA_

Argument

The argument variables used for passing data to a Fragment have to follow this convention: ARG_

Extra Result

The extra variables used for getting data from an Activity (usually on the onActivityResult) have to follow this convention: EXTRA_RESULT_

Argument Result

The extra variables used for getting data from a Fragment (usually on the onActivityResult) have to follow this convention: ARG_RESULT_

Request Codes

The request code has to follow this naming convention REQUEST_CODE_

Additionally, it is highly recommended to use a single enum or constant values for all the project for ensuring the request code are not repeated with the consequent source of bugs.