Created Code style (markdown)

H. Lehmann 2020-09-17 23:14:19 +02:00
parent 5e433ed3a5
commit deabe60058
1 changed files with 13 additions and 0 deletions

13
Code-style.md Normal file

@ -0,0 +1,13 @@
---
This wiki contains the developer documentation for AntennaPod. If you are a user and you are looking for help, have a look at our [website](https://antennapod.org/faq)!
---
### Code style
For the Java code, AntennaPod uses a style similar to [Google's Java style](https://google.github.io/styleguide/javaguide.html). You can find a Checkstyle configuration [here](https://github.com/AntennaPod/AntennaPod/blob/develop/config/checkstyle/checkstyle-new-code.xml). Checkstyle is run automatically when creating a pull request.
### Resource ID naming
Please use lowerCamelCase for naming `@+id` resources. For `TextViews` and `ImageViews`, just describing the element is enough (`title`, `background`). For `ViewGroups` like `LinearLayouts`, describing is usually enough, too: `playbackControls`. Buttons should always have the suffix `Button` (`viewDetailsButton`, `playButton`) and floating action buttons (fab) the suffix `Fab` (`addFeedFab`). In rare cases where it is really clear what the id is referring to, it may also be named after the type of the element (`recyclerView`).