Skip to content

Conventions

Noah Robert edited this page May 13, 2024 · 6 revisions

Git

Branches

Use lowercase letters, - to separate words, and the prefix feature/ when developing a new feature.

Examples

  • feature/simple
  • feature/more-than-one-word

Commits

Start with a capital letter and use present tense. The first line should be a very short description of the commit. Optionally, longer explanations can be added after a blank line.

Example

Very short description in present tense

Optionally a longer explanation.
This might use multiple lines.

Code

Strings

All text displayed to the user should be extracted to the strings.xml resource. Use only lowercase letters and _ to separate words. Prefix with the name of the file.

Examples

  • login_screen_login_button_text
  • login_screen_email_label

Note

When your cursor is on a string, you can use the short-cut Alt+Enter then Extract string resource to extract the string.

Interfaces and Implementations

Suffix the implementation with Impl if there is only one. Otherwise, use a prefix which defines the implementation.

Example

  • Interface Repository and implementation RepositoryImpl
  • Interface AuthenticationService and implementations FirebaseAuthenticationService, SupabaseAuthenticationService

Imports

Icons

In order to import new icons, we cannot just import the whole library of icons from androidx.compose.material:material-icons-extended. Because it is way too large, therefore we must import them following this tutorial.

To see all possible icons, we should refer to google's icon library

You can use the icon as a painter in compose with the painterResource(id = R.drawable.icon_id) method. Beware that the color/tint you set manually in the XML file will be overwritten by the theme, therefore if you face any problems with this you can just remove the field or put a random hexadecimal color.

Clone this wiki locally