M M Arif 2020-04-28 06:42:36 +00:00
parent e46129f9fb
commit 2994892c0e

@ -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. 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; package org.mian.gitnex.adapters;
@ -57,10 +59,12 @@ Note the blank line before declaring any variables and functions.
#### Usage of if statements: #### Usage of if statements:
``` ```
if (response.isSuccessful()) { if (response.isSuccessful()) {
assert response.body() != null; assert response.body() != null;
getReposList(response.body().getSearchedData(), context); getReposList(response.body().getSearchedData(), context);
} }
else { else {
Log.i("onResponse", String.valueOf(response.code())); Log.i("onResponse", String.valueOf(response.code()));
} }
``` ```
@ -154,3 +158,6 @@ GitNex use all the default icons provided with Android Studio licensed under Apa
#### Standard Variable Names #### Standard Variable Names
App Context should be stored at the beggining once in `ctx`. 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).