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.
|
||||
|
||||
**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()));
|
||||
}
|
||||
```
|
||||
|
@ -154,3 +158,6 @@ GitNex use all the default icons provided with Android Studio licensed under Apa
|
|||
|
||||
#### Standard Variable Names
|
||||
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).
|
Loading…
Reference in New Issue