Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.2.0 #1884

Merged
merged 155 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
39e1063
Bump kotlinx-coroutines-core-jvm from 1.6.1 to 1.6.2
dependabot[bot] Jun 1, 2022
21dd413
Bump material from 1.5.0 to 1.6.1
dependabot[bot] Jun 1, 2022
7cfac48
Bump org.jlleitschuh.gradle.ktlint from 10.2.1 to 10.3.0
dependabot[bot] Jun 1, 2022
b36ca86
Bump kxCoroutinesVersion from 1.6.1 to 1.6.2
dependabot[bot] Jun 1, 2022
ac7a721
Bump daggerVersion from 2.41 to 2.42
dependabot[bot] Jun 1, 2022
36ee395
Fix small typo in build instructions
Broxzier Jun 28, 2022
8ea0480
Bump simpleclient from 0.15.0 to 0.16.0
dependabot[bot] Jul 1, 2022
08eb1a6
Bump simpleclient_hotspot from 0.15.0 to 0.16.0
dependabot[bot] Jul 1, 2022
8c90c4f
Bump kotlin-stdlib from 1.6.21 to 1.7.0
dependabot[bot] Jul 1, 2022
ba88552
Bump appcompat from 1.4.1 to 1.4.2
dependabot[bot] Jul 1, 2022
6c5f706
Bump kotlin-stdlib-jdk8 from 1.6.21 to 1.7.0
dependabot[bot] Jul 1, 2022
af5914c
Bump kotlinx-coroutines-core-jvm from 1.6.2 to 1.6.3
dependabot[bot] Jul 1, 2022
e00998f
Bump annotation from 1.3.0 to 1.4.0
dependabot[bot] Jul 1, 2022
602a40a
Bump simpleclient_httpserver from 0.15.0 to 0.16.0
dependabot[bot] Jul 1, 2022
7c69b17
Bump kxCoroutinesVersion from 1.6.2 to 1.6.3
dependabot[bot] Jul 3, 2022
a6180a5
fix marker scaling in freq display
eduebernal Jul 6, 2022
e15e060
remove unused maxFreq var and get method
eduebernal Jul 6, 2022
9bd1c6f
change getWeekdaysInMonth method
eduebernal Jul 6, 2022
8912a9d
add test for getWeekdaysInMonth
eduebernal Jul 6, 2022
dd47d4c
fix getWeekdaysInMonth test
eduebernal Jul 6, 2022
44cb646
Update test screenshots
iSoron Jul 30, 2022
459cf02
Merge pull request #1370 from iSoron/number-popup
iSoron Jul 30, 2022
2fc6c67
Merge pull request #1425 from eduebernal/freq-display-normal
iSoron Jul 30, 2022
0ce2f8f
Bump kxCoroutinesVersion from 1.6.3 to 1.6.4
dependabot[bot] Aug 1, 2022
504362e
Bump daggerVersion from 2.42 to 2.43.1
dependabot[bot] Aug 1, 2022
5409a32
Bump dexmaker-mockito from 2.28.1 to 2.28.3
dependabot[bot] Aug 1, 2022
dcf31ba
Merge pull request #1441 from iSoron/dependabot/gradle/kxCoroutinesVe…
iSoron Aug 11, 2022
f23a1be
Merge pull request #1442 from iSoron/dependabot/gradle/daggerVersion-…
iSoron Aug 11, 2022
f9bb0d7
Merge pull request #1445 from iSoron/dependabot/gradle/com.linkedin.d…
iSoron Aug 11, 2022
d3c9048
Bump kotlin-stdlib from 1.7.0 to 1.7.10
dependabot[bot] Aug 11, 2022
a7a95f2
Merge pull request #1443 from iSoron/dependabot/gradle/org.jetbrains.…
iSoron Aug 13, 2022
a142685
Bump kotlinx-coroutines-core-jvm from 1.6.3 to 1.6.4
dependabot[bot] Aug 13, 2022
08fab0c
Bump kotlin-stdlib-jdk8 from 1.7.0 to 1.7.10
dependabot[bot] Aug 13, 2022
b44dd96
Merge pull request #1444 from iSoron/dependabot/gradle/org.jetbrains.…
iSoron Aug 13, 2022
31368cf
Merge pull request #1453 from iSoron/dependabot/gradle/org.jetbrains.…
iSoron Aug 13, 2022
15fa1fe
Bump daggerVersion from 2.43.1 to 2.43.2
dependabot[bot] Aug 13, 2022
b0097fa
Merge pull request #1450 from iSoron/dependabot/gradle/daggerVersion-…
iSoron Aug 14, 2022
f94bc62
Replaced activity!! with requireActivity, context!! with requireConte…
kalina559 Aug 15, 2022
f074d03
Bump sqlite-jdbc from 3.36.0.3 to 3.39.2.0 (#1449)
dependabot[bot] Aug 15, 2022
d4d818a
Upgrade dependencies
iSoron Aug 16, 2022
f082842
Update Gradle, AGP & Kotlin
iSoron Aug 17, 2022
dfa7496
Merge branch 'release/2.1.0' into dev
iSoron Aug 17, 2022
458c9f3
Merge branch 'release/2.1.0' into dev
iSoron Aug 17, 2022
8b0b757
Bump org.jlleitschuh.gradle.ktlint from 10.3.0 to 11.0.0 (#1480)
dependabot[bot] Sep 3, 2022
f77c064
Bump logback-classic from 1.2.11 to 1.4.0 (#1481)
dependabot[bot] Sep 3, 2022
335f8c3
Bump desugar_jdk_libs from 1.1.5 to 1.2.2 (#1482)
dependabot[bot] Sep 3, 2022
8c0655c
Bump sqlite-jdbc from 3.39.2.0 to 3.39.2.1 (#1483)
dependabot[bot] Sep 3, 2022
99ccb44
fix marker scaling for numerical habits in frequency display (#1489)
eduebernal Sep 9, 2022
6a9c3a3
Support for Android 13 Themed Icons (#1497)
cheeeeer Sep 9, 2022
ee39ff0
StackWidget: Avoid storing RemoteViews reference
iSoron Sep 9, 2022
4c5a722
splitLongs: Handle NumberFormatException
iSoron Sep 9, 2022
2154d8c
StackWidget: Remove unused remoteViews; fix invalid check
iSoron Sep 9, 2022
bf50464
Merge pull request #1488 from iSoron/fix/stackwidget-api33
iSoron Sep 10, 2022
73712e0
Always update widgets on launch
iSoron Aug 17, 2022
318aa3c
Fix ListHabitsScreen.showColorPicker
iSoron Sep 4, 2022
d136572
Minor fix to BarChart
iSoron Sep 4, 2022
16cd249
Update CHANGELOG
iSoron Sep 9, 2022
0a493ff
Merge branch 'master' into dev
iSoron Sep 10, 2022
1283cf9
Update CHANGELOG
iSoron Sep 10, 2022
20dcc79
Remove unused folders
iSoron Sep 10, 2022
5498ff8
Switch emulator to google_apis; test APIs 28 to 33
iSoron Sep 11, 2022
e42d41e
Bump minSdk to 28
iSoron Sep 11, 2022
9f5da7b
Update TEST.md
iSoron Sep 11, 2022
da09df2
uhabits-core: Add js targets
iSoron Sep 13, 2022
a94c6e8
Merge branch 'master' into dev
iSoron Sep 25, 2022
4046715
Revert "uhabits-core: Add js targets"
iSoron Sep 25, 2022
b8033a6
Bump sqlite-jdbc from 3.39.2.1 to 3.39.3.0
dependabot[bot] Oct 1, 2022
7f4d06d
Bump logback-classic from 1.4.0 to 1.4.4
dependabot[bot] Nov 1, 2022
1a3e631
Bump opencsv from 5.6 to 5.7.1
dependabot[bot] Nov 1, 2022
579b33c
Bump appcompat from 1.5.0 to 1.5.1
dependabot[bot] Nov 25, 2022
d24dcbf
Bump kotlinVersion from 1.7.10 to 1.7.21
dependabot[bot] Nov 25, 2022
c7d1e92
Issue 1589: Fixed crash after choosing Settings/Rate app when there's…
kalina559 Dec 11, 2022
758fc56
Issue 1576: Solving problems with habitbull import (#1591)
kalina559 Dec 18, 2022
c423d2b
Issue 1574: Fixed the almost invisible watch hands in snooze activity…
kalina559 Dec 18, 2022
6f7215b
Update dependencies
iSoron Dec 18, 2022
d950845
Bump daggerVersion from 2.43.2 to 2.44.2 (#1582)
dependabot[bot] Dec 20, 2022
dc678e5
GH Actions: Set job timeout
iSoron Dec 23, 2022
df97b1f
Bump espressoVersion from 3.4.0 to 3.5.0
dependabot[bot] Jan 1, 2023
856a072
Bump logback-classic from 1.4.4 to 1.4.5
dependabot[bot] Jan 1, 2023
f1a003f
Bump com.google.android.material:material from 1.7.0 to 1.8.0
dependabot[bot] Mar 20, 2023
eb68220
Remove dependency on kotlin stdlib (#1669)
hiqua Mar 26, 2023
c609ece
Update Play Store and F-Droid badges (#1668)
AdrianMiozga Mar 26, 2023
d0f32df
Bump espressoVersion from 3.5.0 to 3.5.1
dependabot[bot] Apr 1, 2023
9d4df73
Bump androidx.test.ext:junit from 1.1.4 to 1.1.5
dependabot[bot] Apr 1, 2023
499eb46
Bump daggerVersion from 2.44.2 to 2.46
dependabot[bot] May 1, 2023
6a55d3c
Merge branch 'master' into dev
iSoron May 27, 2023
f70d338
Remove obsolete permission
iSoron May 28, 2023
916cd76
Update checkout actions (#1715)
Jean-BaptisteC Jun 4, 2023
07065a6
Add "github-actions" ecosystem to dependabot.yml (#1716)
ezio-melotti Jun 4, 2023
e4d2c93
Bump actions/upload-artifact from 2 to 3 (#1724)
dependabot[bot] Jun 4, 2023
7348dde
Bump minSdk back to 28 from 23 (#1759)
hiqua Jul 10, 2023
11ca993
Bump org.jlleitschuh.gradle.ktlint from 11.0.0 to 11.4.2
hiqua Jul 3, 2023
6b793c7
Bump com.android.application from 7.3.1 to 7.4.2
hiqua Jul 25, 2023
b083899
Make AGP version explicit
hiqua Jul 25, 2023
0526d37
Use official version of mockito-kotlin
hiqua Jul 26, 2023
1264914
Migrate junit.framework.Assert.assertEquals to kotlin.test.assertEquals
hiqua Jul 25, 2023
8e4274d
Use assertThrows instead of ExpectedException
hiqua Jul 25, 2023
35097e1
Bump targetSdk to 32
hiqua Jul 25, 2023
af21fd2
Migrate FrequencyPickerDialog to view bindings
hiqua Jul 26, 2023
4f9ab6d
Migrate EditHabitActivity to view bindings
hiqua Jul 26, 2023
4bbb20e
Remove android extensions (deprecated)
hiqua Jul 26, 2023
9f66a27
Bump com.android.tools:desugar_jdk_libs from 1.2.2 to 2.0.3
dependabot[bot] Aug 3, 2023
5df3ee0
Bump org.jlleitschuh.gradle.ktlint from 11.4.2 to 11.5.1
dependabot[bot] Aug 7, 2023
f4e5b68
Bump org.apache.commons:commons-lang3 from 3.12.0 to 3.13.0
dependabot[bot] Aug 7, 2023
f58d8a5
Bump kxCoroutinesVersion from 1.6.4 to 1.7.3
dependabot[bot] Aug 7, 2023
761fe59
Bump commons-codec:commons-codec from 1.15 to 1.16.0
dependabot[bot] Aug 7, 2023
80f783b
Bump mockito-kotlin from 2.2.11 to 4.1.0
hiqua Aug 8, 2023
19de2a2
Bump androidx.annotation:annotation from 1.5.0 to 1.6.0
dependabot[bot] Aug 8, 2023
98b2c9c
Bump com.google.guava:guava from 31.1-android to 32.1.2-android
dependabot[bot] Aug 8, 2023
9951525
Bump com.opencsv:opencsv from 5.7.1 to 5.8
dependabot[bot] Aug 8, 2023
ca0a9dd
Bump org.xerial:sqlite-jdbc from 3.40.0.0 to 3.42.0.0
dependabot[bot] Aug 8, 2023
b9253d4
Bump daggerVersion from 2.46 to 2.47
dependabot[bot] Aug 8, 2023
b465ee5
Update dependabot.yml
hiqua Aug 8, 2023
5add03b
Bump org.junit.jupiter:junit-jupiter from 5.8.1 to 5.10.0
dependabot[bot] Aug 8, 2023
b53ef75
Bump ch.qos.logback:logback-classic from 1.4.5 to 1.4.9
dependabot[bot] Aug 8, 2023
5cd616f
Bump org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm
dependabot[bot] Aug 8, 2023
f0e8643
Bump com.google.android.material:material from 1.8.0 to 1.9.0
dependabot[bot] Aug 8, 2023
b2fc79a
Bump com.github.triplet.play from 3.7.0 to 3.8.4
dependabot[bot] Aug 8, 2023
334dabb
Use default locale instead of hardcoded US locale (#1763)
Slartibartfass2 Aug 18, 2023
cc7178e
Bump daggerVersion from 2.47 to 2.48
dependabot[bot] Sep 1, 2023
248ff2e
Bump mockito-kotlin from 2.2.11 to 4.1.0 in -server
hiqua Aug 8, 2023
4139f09
Add @Deprecated when overriding @Deprecated methods
hiqua Aug 8, 2023
3b0fba1
Remove unused imports in datetimepicker
hiqua Aug 8, 2023
a9f028a
Target JVM 11
hiqua Aug 8, 2023
a013635
Bump mockito-kotlin from 4.1.0 to 5.0.0
hiqua Aug 8, 2023
b51f6ab
Target JVM 17 in uhabits-server
hiqua Aug 8, 2023
ef7454a
Bump kotlin from 1.7.21 to 1.8.20
hiqua Aug 8, 2023
8a9b719
Bump org.mockito.kotlin:mockito-kotlin from 2.2.11 to 5.1.0
dependabot[bot] Sep 20, 2023
b0944d3
Bump actions/checkout from 3 to 4
dependabot[bot] Oct 1, 2023
21a512a
Bump androidx.annotation:annotation from 1.6.0 to 1.7.0
dependabot[bot] Oct 1, 2023
b32a6ad
Bump org.jlleitschuh.gradle.ktlint from 11.5.1 to 11.6.0
dependabot[bot] Oct 1, 2023
7735247
Bump daggerVersion from 2.48 to 2.48.1
dependabot[bot] Nov 1, 2023
ed8c60e
Implement runtime notification permission; bump targetSdk to 33
iSoron Nov 25, 2023
4975ba2
Add permission: USE_EXACT_ALARM
iSoron Nov 25, 2023
f0ce05e
API 34: Implement workaround to keep sticky notifications non-dismiss…
iSoron Nov 25, 2023
dee93fd
Upgrade to AGP 8.1.4
iSoron Nov 28, 2023
70fe513
Bump targetSdk to 34
iSoron Nov 28, 2023
d01044b
GH Actions: Add API 34
iSoron Nov 28, 2023
93363bf
GH Actions: Add API 34
iSoron Nov 28, 2023
b2421dc
GH Actions: Increase number of attempts
iSoron Nov 28, 2023
4bd5cee
Update libraries
iSoron Nov 30, 2023
7e7f682
Update Kotlin
iSoron Nov 30, 2023
c590734
Update dependencies
iSoron Nov 30, 2023
8eff782
Update dependencies
iSoron Nov 30, 2023
481a3d5
Bump org.junit.jupiter:junit-jupiter from 5.10.0 to 5.10.1 (#1878)
dependabot[bot] Dec 2, 2023
8837326
Bump com.opencsv:opencsv from 5.8 to 5.9 (#1880)
dependabot[bot] Dec 2, 2023
0762699
Bump org.apache.commons:commons-lang3 from 3.13.0 to 3.14.0 (#1881)
dependabot[bot] Dec 2, 2023
3bb119c
Bump com.github.triplet.play from 3.8.4 to 3.8.6 (#1879)
dependabot[bot] Dec 2, 2023
e06ed3e
Bump ch.qos.logback:logback-classic from 1.4.11 to 1.4.13 (#1882)
dependabot[bot] Dec 2, 2023
800f92f
Create locales_config.xml for per-app language
leondzn Oct 18, 2022
27df792
Update CHANGELOG
iSoron Dec 2, 2023
08f77a5
Merge branch 'master' into release/2.2.0
iSoron Dec 2, 2023
0683ea4
Fix splash screen background color in dark mode
SIKV Dec 6, 2023
b627ff4
Use colorBackground property instead of splash screen lib
SIKV Jan 23, 2024
02e9e23
Update CHANGELOG
iSoron Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ updates:
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 10
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ on:
jobs:
Test:
runs-on: self-hosted
timeout-minutes: 30
steps:
- name: Check out source code
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Build project
run: ./build.sh build

- name: Run Android tests
run: ./build.sh android-tests-parallel 24 25 26 28 30 31
run: ./build.sh android-tests-parallel 28 29 30 32 33 34

- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build
path: |
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,9 @@
.idea
.secret
build
build/
captures
local.properties
node_modules
*xcuserdata*
*.sketch
/design
/releases
/screenshots
crowdin.yml
kotlin-js-store
16 changes: 0 additions & 16 deletions .secret/decrypt.sh

This file was deleted.

Binary file removed .secret/secret
Binary file not shown.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [2.2.0] -- 2024-01-30
### Added
- Add support for Android 14 (@iSoron, @hiqua)
- Allow user to change app language (@leondzn)

### Fixed
- Implement workaround to make notifications non-dismissible in Android 14 (@iSoron, #1872)
- Fix splash screen background color in dark mode (@SIKV, #1888)

## [2.1.3] -- 2023-08-28
### Fixed
- Use text input on Samsung devices (@iSoron, #1719)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ show you how your habits improved over time. It is completely ad-free and open
source.

<p align="center">
<a href="https://play.google.com/store/apps/details?id=org.isoron.uhabits&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-AC-global-none-all-co-pr-py-PartBadges-Oct1515-1"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/apps/en-play-badge-border.png" height="75px"/></a>
<a href="https://f-droid.org/app/org.isoron.uhabits"><img alt="Get it on F-Droid" src="https://i.imgur.com/baSPE7X.png" height="75px"/></a>
<a href="https://play.google.com/store/apps/details?id=org.isoron.uhabits&utm_source=global_co&utm_medium=prtnr&utm_content=Mar2515&utm_campaign=PartBadge&pcampaignid=MKT-AC-global-none-all-co-pr-py-PartBadges-Oct1515-1"><img alt="Get it on Google Play" src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" height="80px"/></a>
<a href="https://f-droid.org/app/org.isoron.uhabits"><img alt="Get it on F-Droid" src="https://f-droid.org/badge/get-it-on.png" height="80px"/></a>
</p>

## Screenshots
Expand Down
7 changes: 3 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
plugins {
val kotlinVersion = "1.6.10"
id("com.android.application") version ("7.0.3") apply (false)
val kotlinVersion = "1.9.21"
id("com.android.application") version "8.1.4" apply (false)
id("org.jetbrains.kotlin.android") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.kapt") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.android.extensions") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.multiplatform") version kotlinVersion apply (false)
id("org.jlleitschuh.gradle.ktlint") version "10.2.1"
id("org.jlleitschuh.gradle.ktlint") version "11.6.1"
}

apply {
Expand Down
6 changes: 3 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ android_setup() {
$AVDMANAGER delete avd --name $AVDNAME

log_info "Creating new Android virtual device (API $API)..."
(echo "y" | $SDKMANAGER --install "system-images;android-$API;default;x86_64") || return 1
(echo "y" | $SDKMANAGER --install "system-images;android-$API;google_apis;x86_64") || return 1
$AVDMANAGER create avd \
--name $AVDNAME \
--package "system-images;android-$API;default;x86_64" \
--package "system-images;android-$API;google_apis;x86_64" \
--device "Nexus 4" || return 1

flock -u 10
Expand Down Expand Up @@ -181,7 +181,7 @@ android_test() {
OUT_INSTRUMENT=${ANDROID_OUTPUTS_DIR}/instrument-${API}.txt
OUT_LOGCAT=${ANDROID_OUTPUTS_DIR}/logcat-${API}.txt
FAILED_TESTS=""
for i in {1..5}; do
for i in {1..10}; do
log_info "Running $size instrumented tests (attempt $i)..."
$ADB shell am instrument \
-r -e coverage true -e size "$size" $FAILED_TESTS \
Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The repository will be downloaded to the directory `uhabits`.
2. When the IDE asks you for the project location, select `uhabits` and click "Ok".
3. Android Studio will spend some time indexing the project. When this is complete, click the toolbar icon "Sync Project with Gradle File", located near the right corner of the top toolbar.
4. The operation will likely fail several times due to missing Android SDK components. Each time it fails, click the link "Install missing platforms", "Install build tools", etc, and try again.
5. To test the application, create a virtual Android device using the menu "Tools" and "AVD Manager". The default options should work fine, but free to customize the device.
5. To test the application, create a virtual Android device using the menu "Tools" and "AVD Manager". The default options should work fine, but feel free to customize the device.
6. Click the menu "Run" and "uhabits-android". The application should launch.


Expand Down
54 changes: 14 additions & 40 deletions docs/TEST.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,25 @@

Loop Habit Tracker has a fairly large number of automated tests to reduce the chance of bugs being silently introduced in our code base. The tests are divided into three categories:

* **Small tests:** These tests run very quickly on the developer's computer, inside a JVM, and do not need an Android emulator or device. They typically test the correctness of core functions of the application, such as the computation of scores and streaks.
* **Medium tests:** These tests require an Android emulator or device, but they are still quite fast to run, since only individual classes are tested. The app itself does not need to be launched. Examples include *view tests*, which render our custom views on the device and compare them against prerendered images.
* **Large tests:** These are end-to-end tests, which launch the application on an Android emulator and interact with it by touching the screen, much like a regular user.
- **Unit tests:** These tests run very quickly on the developer's computer, inside a JVM, and do not need an Android emulator or device. They typically test the correctness of core functions of the application, such as the computation of scores and streaks.
- **Instrumented tests:** These tests require an Android emulator or device. _Medium_ instrumented tests are still quite fast to run, since only individual classes are tested. The app itself does not need to be launched. Examples include _view tests_, which render our custom views on the device and compare them against prerendered images. _Large_ instrumented tests launch the application on an Android emulator and interact with it by touching the screen, much like a regular user.

## Running small tests
## Running unit tests

Small tests can be launched by running `./gradlew test` or by right-clicking a particular class/method in Android Studio and selecting "Run testMethod()" or "Run ClassTest". An alternative way is to use `build.sh`, the script used by our continuous integration server. By running `./build.sh build`, the script will automatically build and run all small tests.
Unit tests can be launched by running `./gradlew test` or by right-clicking a particular class/method in Android Studio and selecting "Run testMethod()" or "Run ClassTest". An alternative way is to use `build.sh`, the script used by our continuous integration server. By running `./build.sh build`, the script will automatically build and run all small tests.

## Running medium tests
## Running instrumented tests

To run medium tests, it is recommended to use the `build.sh` script:
To run medium tests, it is recommended to use the `build.sh` script.

./build.sh build
./build.sh medium-tests
1. Run `./build.sh android-setup API` to create the emulator, where `API` is the desired API level.
2. Run `./build.sh android-tests API` to run the tests on a single API.
3. Run `./build.sh android-tests-parallel API API...` to run the tests on multiple APIs in parallel.

Note that instrumented tests are designed to run on a clean install, inside an emulator. They will not work on actual devices. All tests are also designed for a particular screen size, namely the Nexus 4 configuration (4.7" 768x1280 xhdpi), and a particular locale, namely English (US). Furthermore:

For this script to succeed, make sure that an emulator is currently running, or that a device (with developer mode activated) is connected via USB.
- No additional apps should be installed on the device;
- The homescreen must look exactly like it was when the emulator was originally created, with no additional icons or widgets;
- All animations must be manually disabled.

**WARNING!** This script will uninstall the app prior to testing it, and therefore delete all user data!


If there are failing view tests (that is, if some custom views do not render exactly like the prerendered images we have), then the script `./build.sh fetch-images` can be used to download both the actual and the expected images from the device. The images will be downloaded from the device into the folder `tmp/`. After verifying the differences, if you feel that the actual images are actually fine and should replace the prerendered ones, then run `./build.sh accept-images`.

## Running large tests

Large tests are significantly more complicated to run. In particular, they require:

* An Android emulator; they will **not** work on actual devices;
* A vanilla x86 AOSP image; they will **not** work with Google API images;
* A particular screen size, namely the Nexus 4 configuration on Android Studio (4.7 768x1280 xhdpi);
* A particular locale, namely English (US).

Furthermore:

* No additional apps should be installed on the device;
* The homescreen must look exactly like it was when the emulator was originally created, with no additional icons or widgets;
* Developer mode must be activated, and all animations must be manually disabled.

Only the following Android versions are supported by our test suite:

* Android 7.0 (API 24)
* Android 7.1.1 (API 25)
* Android 8.0 (API 26)
* Android 8.1 (API 27)
* Android 9.0 (API 28)
* Android 10.0 (API 29)

After creating an emulator and configuring it exactly as described above, launch it, wait for it to finish booting up, then run `./build.sh large-tests`. As mentioned before, this script will uninstall the app before testing it, and therefore will delete all the user data.
If there are failing view tests (that is, if some custom views do not render exactly like the prerendered images we have), then both the actual and expected images will be automatically downloaded from the device to the folder `uhabits-android/build/outputs`. After verifying the differences, if you feel that the actual images are actually fine and should replace the prerendered ones, then run `./build.sh android-accept-images`.
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ org.gradle.daemon=true
org.gradle.jvmargs=-Xms2048m -Xmx2048m
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 0 additions & 2 deletions landing/.gitignore

This file was deleted.

27 changes: 0 additions & 27 deletions landing/Makefile

This file was deleted.

27 changes: 0 additions & 27 deletions landing/README.md

This file was deleted.

1 change: 0 additions & 1 deletion landing/assets/faq.html

This file was deleted.

Binary file removed landing/assets/images/f-droid.png
Binary file not shown.
Binary file removed landing/assets/images/google-play.png
Binary file not shown.
Binary file removed landing/assets/images/hero-background-filter.jpg
Binary file not shown.
7 changes: 0 additions & 7 deletions landing/assets/lib/css/bootstrap.min.css

This file was deleted.

1 change: 0 additions & 1 deletion landing/assets/lib/css/bootstrap.min.css.map

This file was deleted.

7 changes: 0 additions & 7 deletions landing/assets/lib/js/bootstrap.bundle.min.js

This file was deleted.

1 change: 0 additions & 1 deletion landing/assets/lib/js/bootstrap.bundle.min.js.map

This file was deleted.

2 changes: 0 additions & 2 deletions landing/assets/lib/js/jquery.min.js

This file was deleted.

Binary file removed landing/assets/screenshots/uhabits1.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits1_th.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits2.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits2_th.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits3.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits3_th.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits4.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits4_th.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits5.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits5_th.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits6.png
Binary file not shown.
Binary file removed landing/assets/screenshots/uhabits6_th.png
Binary file not shown.
106 changes: 0 additions & 106 deletions landing/src/index.haml

This file was deleted.

Loading
Loading