parent
5a0205b64b
commit
60f626a45f
|
@ -101,3 +101,50 @@ popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Variable names and scope
|
||||||
|
Variable names has to be clear for what it is used. Scope should be defined properly for the variable. Example,
|
||||||
|
|
||||||
|
```
|
||||||
|
private TextView issueNumber;
|
||||||
|
private ImageView issueAssigneeAvatar;
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Layout ID's name
|
||||||
|
Every layout must have components with defined ID's. Example,
|
||||||
|
|
||||||
|
```
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/branchName"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/branchCommitAuthor"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/branchCommitHash"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="@color/colorWhite"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColorLink="@color/lightBlue" />
|
||||||
|
```
|
||||||
|
|
||||||
|
#### String names
|
||||||
|
All the string names in strings.xml must be meaningful. Also check for the string if it is already defined.
|
||||||
|
|
||||||
|
```
|
||||||
|
<string name="mergePRSuccessMsg">Pull Request was merged successfully</string>
|
||||||
|
<string name="mergePR404ErrorMsg">Pull Request is not available for merge</string>
|
||||||
|
```
|
Loading…
Reference in New Issue