M M Arif 2020-04-28 06:42:36 +00:00
parent e46129f9fb
commit 2994892c0e
1 changed files with 8 additions and 1 deletions

@ -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`.
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).