diff --git a/Code-Standards.md b/Code-Standards.md index d99f66f..b65dd8b 100644 --- a/Code-Standards.md +++ b/Code-Standards.md @@ -1,5 +1,7 @@ Writing clean and understandable code is GitNex core value from the start. Here are the few standards when writing code for GitNex. +**Note: You can use code reformat in Android Studio(Code -> Reformat Code) to format the code automatically. GitNex has code style applied already.** + ``` package org.mian.gitnex.adapters; @@ -57,10 +59,12 @@ Note the blank line before declaring any variables and functions. #### Usage of if statements: ``` if (response.isSuccessful()) { + assert response.body() != null; getReposList(response.body().getSearchedData(), context); } else { + Log.i("onResponse", String.valueOf(response.code())); } ``` @@ -153,4 +157,7 @@ All the string names in `strings.xml` must be meaningful. Also check for the str GitNex use all the default icons provided with Android Studio licensed under Apache. All drawables are SVG. In case there is no matching resource found in the drawable library, a third party resource can be used under an allowed license for that resource. Resource must be SVG. **No gif/png etc are allowed**. #### Standard Variable Names -App Context should be stored at the beggining once in `ctx`. \ No newline at end of file +App Context should be stored at the beggining once in `ctx`. + +#### Static Variables +Static and standard reusable variables should be stored in [StaticGlobalVariables.java](https://gitea.com/gitnex/GitNex/src/branch/master/app/src/main/java/org/mian/gitnex/helpers/StaticGlobalVariables.java). \ No newline at end of file