Skip to content

Commit e9a7c06

Browse files
committed
Merge branch 'release/5.50.0'
2 parents 5b2bde5 + 2bfe0c4 commit e9a7c06

File tree

8 files changed

+15
-18
lines changed

8 files changed

+15
-18
lines changed

app/version/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION=5.50.0
1+
VERSION=5.50.0

styleguide/IDE_kotlin_style.png

-315 KB
Binary file not shown.

styleguide/IDE_line_wrap.png

-114 KB
Binary file not shown.

styleguide/STYLEGUIDE.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
1-
## General
1+
## DuckDuckGo Android Style Guide
22
* We care about clean code and aim to make this codebase as self-documenting and readable as possible.
3-
* We primarily use Kotlin and follow the standard coding conventions outlined in https://kotlinlang.org/docs/reference/coding-conventions.html
3+
* We primarily use Kotlin and follow coding conventions based on the [Android Kotlin Style Guide](https://developer.android.com/kotlin/style-guide)
44
* There may be instances of code that pre-dates our use of this style guide, these can be refactored as we encounter them.
55

6-
**IDE Setup:**
7-
* Open Android Studio preferences
8-
* Tap on code style, select Kotlin
9-
* Select Set From, Predefined Style, Kotlin Style Guide
10-
![Setting kotlin style screenshot](IDE_kotlin_style.png)
6+
### Android Studio Setup
117

12-
## Line breaks
13-
* We use a line margin of 150 rather than the default of 100 as the default causes excessive line breaks. The larger margin allows us to take advantage of modern widescreen monitors with more screen real-estate.
8+
We've provided a coding style that can be imported into Android Studio.
9+
The file can be found [here](ddg-settings.zip).
1410

15-
**IDE Setup:**
16-
* Open android studio preferences
17-
* Tap on code style
18-
* Enter 150 into "Page margin"
11+
* From Android Studio click on File -> Import Settings
1912

20-
![Setting kotlin style screenshot](IDE_line_wrap.png)
13+
![Setting kotlin style screenshot](import_settings_one.png)
2114

15+
* Select the file you just downloaded
16+
* Import all components required (AndroidEditors and Code Style)
2217

23-
## Timber
18+
## Code conventions
19+
20+
### Logging
2421
When logging with Timber we use the new Kotlin styles strings
2522

2623
```Timber.w("Loading $url")```
@@ -31,7 +28,7 @@ Rather than C style strings
3128

3229
Mixing the two styles within a single statement can lead to crashes so we have standardized on the more readable Kotlin style. This is slightly less efficient - should efficiency become an issue we can use proguard to optimize away log statements for releases.
3330

34-
## Package Names
31+
### Package Names
3532
Case in package names is problematic as some file system and tools do not handle case sensitive file changes well. For this reason, we opt for lowercase packages in our project. Thus we have:
3633

3734
```package com.duckduckgo.app.trackerdetection```
@@ -40,7 +37,7 @@ rather than:
4037

4138
```package com.duckduckgo.app.trackerDetection```
4239

43-
## Unit test names
40+
### Unit test names
4441
We use the when then convention for test:
4542

4643
```when <condition> then <expected result>```

styleguide/ddg-settings.zip

1.85 KB
Binary file not shown.

styleguide/import_settings_one.png

198 KB
Loading
35.1 KB
Loading

styleguide/import_settings_two.png

208 KB
Loading

0 commit comments

Comments
 (0)