diff --git a/kotlin.md b/kotlin.md index 8a17ab2..b45821f 100644 --- a/kotlin.md +++ b/kotlin.md @@ -235,3 +235,61 @@ Examples of specific strings: 24dp 32dp ``` + +### 6. Layouts + +* Always to keep 4 spaces of indentation between levels. +* Prevent double indentation between element name and first property +(which is a default behaviour of android studio) +* Place `android:id` at the first position. +* Place `style` after `android:id`. +* Place `android:layout_width` and `android:layout_height` after `style`. +* Try to keep similar order of properties in different layout's element. +* Always use resources for values such as dimens, strings or colors. + + +Example of well formatted xml: +```xml + + + + + + + + + + + + + + +```