|
| 1 | +# Contributing code to Matrix |
| 2 | + |
| 3 | +Please read https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst |
| 4 | + |
| 5 | +Android support can be found in this [](https://riot.im/app/#/room/#riot-android:matrix.org) |
| 6 | + |
| 7 | +# Specific rules for Matrix Android projects |
| 8 | + |
| 9 | +## Compilation |
| 10 | + |
| 11 | +Riot Android uses by default the Matrix Android SDK library (file `matrix-sdk.aar`). |
| 12 | +At each release, this library is updated. |
| 13 | +Between two releases, the Riot code may not compile due to evolution of the library API. |
| 14 | +To compile against the source of the Matrix Android library, please clone the project [AndroidMatrixSdk](https://github.com/matrix-org/matrix-android-sdk) |
| 15 | + and run the following command: |
| 16 | + |
| 17 | +> ./compile_with_sdk_project.sh |
| 18 | +
|
| 19 | +## I want to help translating Riot |
| 20 | + |
| 21 | +If you want to fix an issue with an English string, please submit a PR. |
| 22 | +If you want to fix an issue in other languages, or add a missing translation, or even add a new language, please use [Weblate](https://translate.riot.im/projects/riot-android/). |
| 23 | + |
| 24 | +## I want to submit a PR to fix an issue |
| 25 | + |
| 26 | +Please check if a corresponding issue exists. If yes, please let us know in a comment that you're working on it. |
| 27 | +If an issue does not exist yet, it may be relevant to open a new issue and let us know that you're implementing it. |
| 28 | + |
| 29 | +### Kotlin |
| 30 | + |
| 31 | +Please write every new classes in Kotlin. You can also convert existing Java classes (limited to classes impacted by the PR) to Kotlin (Android Studio has a tool to do this), but if you do so, please do atomic commit of the conversion, to ensure there is no other change, it will facilitate code review. |
| 32 | +Also please check that everything works fine after Kotlin conversion, especially regarding nullity check. |
| 33 | + |
| 34 | +### CHANGES.rst |
| 35 | + |
| 36 | +Please add a line in the file `CHANGES.rst` describing your change. |
| 37 | + |
| 38 | +### Code quality |
| 39 | + |
| 40 | +Make sure the following commands execute without any error: |
| 41 | + |
| 42 | +> ./tools/check/check_code_quality.sh |
| 43 | +> ./gradlew lintAppRelease |
| 44 | +
|
| 45 | +### Unit tests |
| 46 | + |
| 47 | +Make sure the following commands execute without any error: |
| 48 | + |
| 49 | +> ./gradlew testAppReleaseUnitTest |
| 50 | +
|
| 51 | +### Internationalisation |
| 52 | + |
| 53 | +When adding new string resources, please only add new entries in file `value/strings.xml`. Translations will be added later by the community of translators with a specific tool named [Weblate](https://translate.riot.im/projects/riot-android/). |
| 54 | +Do not hesitate to use plurals when appropriate. |
| 55 | + |
| 56 | +### Layout |
| 57 | + |
| 58 | +When adding or editing layouts, make sure the layout will render correctly if device uses a RTL (Right To Left) language. |
| 59 | +You can check this in the layout editor preview by selecting any RTL language (ex: Arabic). |
| 60 | + |
| 61 | +Also please check that the colors are ok for all the current themes of Riot. Please use `?attr` instead of `@color` to reference colors in the layout. You can check this in the layout editor preview by selecting all the main themes (`AppTheme.Status`, `AppTheme.Dark`, etc.). |
| 62 | + |
| 63 | +### Authors |
| 64 | + |
| 65 | +Feel free to add an entry in file AUTHORS.rst |
| 66 | + |
| 67 | +## Thanks |
| 68 | + |
| 69 | +Thanks for contributing to Matrix projects! |
0 commit comments