From 5dfd900b10dabd2ff361366290b708ec52ea1bd2 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 1 Jan 2024 17:19:48 +0100 Subject: [PATCH] Updated Code style (markdown) --- Code-style.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Code-style.md b/Code-style.md index 5d96294..1f3ee88 100644 --- a/Code-style.md +++ b/Code-style.md @@ -8,6 +8,8 @@ This wiki contains the developer documentation for AntennaPod. If you are a user For the Java code, AntennaPod uses a style similar to [Google's Java style](https://google.github.io/styleguide/javaguide.html). Checkstyle is run automatically when creating a pull request. The gradle `checkstyle` task only checks more relaxed rules ([config/checkstyle/checkstyle.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle.xml)) for the whole code base. On CI, the more strict rules ([config/checkstyle/checkstyle-new-code.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle-new-code.xml)) are used for new code. In Android Studio, you can set the checkstyle version to 8.18 and select the [config/checkstyle/checkstyle-new-code.xml](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle-new-code.xml) config file. Please only reformat lines that you actually modify, not the whole file. This makes it easier to read the version history. +For Android layout XML files, we use indention with 4 spaces. The id, layout_width and layout_height attributes come first. To easily format the files, you can use the same tool as our CI server: https://github.com/ByteHamster/android-xml-formatter + ### Resource ID naming Please use lowerCamelCase for naming `@+id` resources. For some types listed in the table below, please add a suffix noting the type.