Compare commits

...

83 Commits

Author SHA1 Message Date
Quentin Hibon
a96b7f0fba Remove dependency on kotlin stdlib
According to:
https://kotlinlang.org/docs/whatsnew14.html#dependency-on-the-standard-library-added-by-default
the explicit dependency is no longer needed.
2023-03-26 12:53:09 +02:00
dependabot[bot]
f1a003fabf Bump com.google.android.material:material from 1.7.0 to 1.8.0
Bumps [com.google.android.material:material](https://github.com/material-components/material-components-android) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/material-components/material-components-android/releases)
- [Commits](https://github.com/material-components/material-components-android/compare/1.7.0...1.8.0)

---
updated-dependencies:
- dependency-name: com.google.android.material:material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-26 12:49:27 +02:00
dependabot[bot]
856a0726f7 Bump logback-classic from 1.4.4 to 1.4.5
Bumps [logback-classic](https://github.com/qos-ch/logback) from 1.4.4 to 1.4.5.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.4.4...v_1.4.5)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 09:43:07 +01:00
dependabot[bot]
df97b1fd4f Bump espressoVersion from 3.4.0 to 3.5.0
Bumps `espressoVersion` from 3.4.0 to 3.5.0.

Updates `espresso-contrib` from 3.4.0 to 3.5.0

Updates `espresso-core` from 3.4.0 to 3.5.0

---
updated-dependencies:
- dependency-name: androidx.test.espresso:espresso-contrib
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.test.espresso:espresso-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 09:42:46 +01:00
dc678e59df GH Actions: Set job timeout 2022-12-23 10:31:30 -06:00
dependabot[bot]
d95084500f Bump daggerVersion from 2.43.2 to 2.44.2 (#1582)
Bumps `daggerVersion` from 2.43.2 to 2.44.2.

Updates `dagger` from 2.43.2 to 2.44.2
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.43.2...dagger-2.44.2)

Updates `dagger-compiler` from 2.43.2 to 2.44.2
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.43.2...dagger-2.44.2)

---
updated-dependencies:
- dependency-name: com.google.dagger:dagger
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:dagger-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-20 04:10:18 -06:00
6f7215b46f Update dependencies 2022-12-19 08:57:30 -06:00
Jakub Kalinowski
c423d2b3ca Issue 1574: Fixed the almost invisible watch hands in snooze activity (#1592)
* Setting the current theme correctly

* Ktlint correction
2022-12-18 04:25:06 -06:00
Jakub Kalinowski
758fc56277 Issue 1576: Solving problems with habitbull import (#1591)
* Recomputing the habit after import, corrected order of magnitude

* Corrected HabitBullCSV3 test and added a new one
2022-12-18 04:05:14 -06:00
Jakub Kalinowski
c7d1e92cae Issue 1589: Fixed crash after choosing Settings/Rate app when there's no Play Store on the device (#1590)
* Using startActivitySafely when launching Play Store

* Returning true for rateApp click
2022-12-12 00:55:58 +01:00
dependabot[bot]
d24dcbf2ca Bump kotlinVersion from 1.7.10 to 1.7.21
Bumps `kotlinVersion` from 1.7.10 to 1.7.21.

Updates `org.jetbrains.kotlin.android` from 1.7.10 to 1.7.21

Updates `org.jetbrains.kotlin.kapt` from 1.7.10 to 1.7.21

Updates `org.jetbrains.kotlin.android.extensions` from 1.7.10 to 1.7.21

Updates `org.jetbrains.kotlin.multiplatform` from 1.7.10 to 1.7.21

Updates `kotlin-stdlib-jdk8` from 1.7.10 to 1.7.21
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.10...v1.7.21)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin.android
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.kapt
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.android.extensions
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin.multiplatform
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib-jdk8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-26 22:12:04 +01:00
dependabot[bot]
579b33cc78 Bump appcompat from 1.5.0 to 1.5.1
Bumps appcompat from 1.5.0 to 1.5.1.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-25 22:12:00 +01:00
dependabot[bot]
1a3e6315a1 Bump opencsv from 5.6 to 5.7.1
Bumps opencsv from 5.6 to 5.7.1.

---
updated-dependencies:
- dependency-name: com.opencsv:opencsv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-25 17:29:07 +01:00
dependabot[bot]
7f4d06d15d Bump logback-classic from 1.4.0 to 1.4.4
Bumps [logback-classic](https://github.com/qos-ch/logback) from 1.4.0 to 1.4.4.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.4.0...v_1.4.4)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-25 17:28:46 +01:00
dependabot[bot]
b8033a6012 Bump sqlite-jdbc from 3.39.2.1 to 3.39.3.0
Bumps [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.39.2.1 to 3.39.3.0.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](https://github.com/xerial/sqlite-jdbc/compare/3.39.2.1...3.39.3.0)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-25 17:28:36 +01:00
404671546c Revert "uhabits-core: Add js targets"
This reverts commit da09df2dd1.
2022-09-24 20:39:54 -05:00
a94c6e8b9f Merge branch 'master' into dev 2022-09-24 19:44:31 -05:00
da09df2dd1 uhabits-core: Add js targets 2022-09-24 19:42:09 -05:00
40a4d254f5 Merge branch 'hotfix/2.1.1' 2022-09-24 19:40:04 -05:00
177d01edd9 Fix Tasker plugin; bump version to 2.1.1
Fixes #1503
2022-09-24 19:25:42 -05:00
9f5da7b4fe Update TEST.md
[skip ci]
2022-09-10 20:44:00 -05:00
e42d41ef30 Bump minSdk to 28
This change is mostly to reduce the number of APIs we need to run tests
for (from 11 APIs to 6). API 27 was released 5 years ago. Also, as of
2022-09-01, 95.1% of our monthly active users are on API 28 or higher.
2022-09-10 19:57:57 -05:00
5498ff8a87 Switch emulator to google_apis; test APIs 28 to 33 2022-09-10 19:25:40 -05:00
20dcc7929b Remove unused folders 2022-09-10 17:04:43 -05:00
1283cf979d Update CHANGELOG 2022-09-10 16:51:20 -05:00
0a493ff065 Merge branch 'master' into dev 2022-09-10 16:50:48 -05:00
16cd249bae Update CHANGELOG 2022-09-10 16:50:16 -05:00
d136572960 Minor fix to BarChart 2022-09-10 16:50:16 -05:00
318aa3c821 Fix ListHabitsScreen.showColorPicker 2022-09-10 16:50:16 -05:00
73712e0d10 Always update widgets on launch
Helps mitigate situations where the widgets mysteriously fail to render.
The user can always force a refresh by opening the app.
2022-09-10 16:50:16 -05:00
bf504641c6 Merge pull request #1488 from iSoron/fix/stackwidget-api33
Widget fixes
2022-09-10 16:11:55 -05:00
2154d8c192 StackWidget: Remove unused remoteViews; fix invalid check 2022-09-09 05:57:13 -05:00
4c5a722dc5 splitLongs: Handle NumberFormatException 2022-09-09 05:17:54 -05:00
ee39ff0eda StackWidget: Avoid storing RemoteViews reference 2022-09-08 20:35:59 -05:00
cheer
6a9c3a36eb Support for Android 13 Themed Icons (#1497) 2022-09-08 20:06:57 -05:00
Eduardo Esparza
99ccb44ad3 fix marker scaling for numerical habits in frequency display (#1489) 2022-09-08 20:01:12 -05:00
dependabot[bot]
8c0655c352 Bump sqlite-jdbc from 3.39.2.0 to 3.39.2.1 (#1483)
Bumps [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.39.2.0 to 3.39.2.1.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](https://github.com/xerial/sqlite-jdbc/compare/3.39.2.0...3.39.2.1)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-03 18:51:50 -05:00
dependabot[bot]
335f8c32fd Bump desugar_jdk_libs from 1.1.5 to 1.2.2 (#1482)
Bumps [desugar_jdk_libs](https://github.com/google/desugar_jdk_libs) from 1.1.5 to 1.2.2.
- [Release notes](https://github.com/google/desugar_jdk_libs/releases)
- [Changelog](https://github.com/google/desugar_jdk_libs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/desugar_jdk_libs/commits)

---
updated-dependencies:
- dependency-name: com.android.tools:desugar_jdk_libs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-03 18:51:40 -05:00
dependabot[bot]
f77c064722 Bump logback-classic from 1.2.11 to 1.4.0 (#1481)
Bumps [logback-classic](https://github.com/qos-ch/logback) from 1.2.11 to 1.4.0.
- [Release notes](https://github.com/qos-ch/logback/releases)
- [Commits](https://github.com/qos-ch/logback/compare/v_1.2.11...v_1.4.0)

---
updated-dependencies:
- dependency-name: ch.qos.logback:logback-classic
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-03 18:51:31 -05:00
dependabot[bot]
8b0b757f04 Bump org.jlleitschuh.gradle.ktlint from 10.3.0 to 11.0.0 (#1480)
Bumps org.jlleitschuh.gradle.ktlint from 10.3.0 to 11.0.0.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle.ktlint
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-03 18:51:20 -05:00
458c9f3b15 Merge branch 'release/2.1.0' into dev 2022-08-17 05:53:48 -05:00
dfa74960b3 Merge branch 'release/2.1.0' into dev 2022-08-17 05:51:36 -05:00
f082842fbe Update Gradle, AGP & Kotlin 2022-08-17 05:36:37 -05:00
d4d818a085 Upgrade dependencies 2022-08-16 05:42:29 -05:00
dependabot[bot]
f074d0331d Bump sqlite-jdbc from 3.36.0.3 to 3.39.2.0 (#1449)
Bumps [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) from 3.36.0.3 to 3.39.2.0.
- [Release notes](https://github.com/xerial/sqlite-jdbc/releases)
- [Changelog](https://github.com/xerial/sqlite-jdbc/blob/master/CHANGELOG)
- [Commits](https://github.com/xerial/sqlite-jdbc/compare/3.36.0.3...3.39.2.0)

---
updated-dependencies:
- dependency-name: org.xerial:sqlite-jdbc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-15 06:36:31 -05:00
Jakub Kalinowski
f94bc62a94 Replaced activity!! with requireActivity, context!! with requireContext etc. (#1458) 2022-08-15 06:36:03 -05:00
b0097fa45e Merge pull request #1450 from iSoron/dependabot/gradle/daggerVersion-2.43.2
Bump daggerVersion from 2.43.1 to 2.43.2
2022-08-14 05:09:35 -05:00
dependabot[bot]
15fa1fea8c Bump daggerVersion from 2.43.1 to 2.43.2
Bumps `daggerVersion` from 2.43.1 to 2.43.2.

Updates `dagger` from 2.43.1 to 2.43.2
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.43.1...dagger-2.43.2)

Updates `dagger-compiler` from 2.43.1 to 2.43.2
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.43.1...dagger-2.43.2)

---
updated-dependencies:
- dependency-name: com.google.dagger:dagger
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.google.dagger:dagger-compiler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-13 16:00:55 +00:00
31368cff45 Merge pull request #1453 from iSoron/dependabot/gradle/org.jetbrains.kotlin-kotlin-stdlib-jdk8-1.7.10
Bump kotlin-stdlib-jdk8 from 1.7.0 to 1.7.10
2022-08-13 11:00:35 -05:00
b44dd96dd3 Merge pull request #1444 from iSoron/dependabot/gradle/org.jetbrains.kotlinx-kotlinx-coroutines-core-jvm-1.6.4
Bump kotlinx-coroutines-core-jvm from 1.6.3 to 1.6.4
2022-08-13 10:59:51 -05:00
dependabot[bot]
08fab0cd8d Bump kotlin-stdlib-jdk8 from 1.7.0 to 1.7.10
Bumps [kotlin-stdlib-jdk8](https://github.com/JetBrains/kotlin) from 1.7.0 to 1.7.10.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.7.10/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.0...v1.7.10)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib-jdk8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-13 09:28:01 +00:00
dependabot[bot]
a142685d2e Bump kotlinx-coroutines-core-jvm from 1.6.3 to 1.6.4
Bumps [kotlinx-coroutines-core-jvm](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.3 to 1.6.4.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.3...1.6.4)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-13 09:27:25 +00:00
a7a95f2030 Merge pull request #1443 from iSoron/dependabot/gradle/org.jetbrains.kotlin-kotlin-stdlib-1.7.10
Bump kotlin-stdlib from 1.7.0 to 1.7.10
2022-08-13 04:26:42 -05:00
dependabot[bot]
d3c90481be Bump kotlin-stdlib from 1.7.0 to 1.7.10
Bumps [kotlin-stdlib](https://github.com/JetBrains/kotlin) from 1.7.0 to 1.7.10.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/v1.7.10/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.7.0...v1.7.10)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-11 10:22:15 +00:00
f9bb0d7d7b Merge pull request #1445 from iSoron/dependabot/gradle/com.linkedin.dexmaker-dexmaker-mockito-2.28.3
Bump dexmaker-mockito from 2.28.1 to 2.28.3
2022-08-11 05:20:29 -05:00
f23a1bedee Merge pull request #1442 from iSoron/dependabot/gradle/daggerVersion-2.43.1
Bump daggerVersion from 2.42 to 2.43.1
2022-08-11 05:20:16 -05:00
dcf31ba115 Merge pull request #1441 from iSoron/dependabot/gradle/kxCoroutinesVersion-1.6.4
Bump kxCoroutinesVersion from 1.6.3 to 1.6.4
2022-08-11 05:20:04 -05:00
dependabot[bot]
5409a324e8 Bump dexmaker-mockito from 2.28.1 to 2.28.3
Bumps [dexmaker-mockito](https://github.com/linkedin/dexmaker) from 2.28.1 to 2.28.3.
- [Release notes](https://github.com/linkedin/dexmaker/releases)
- [Changelog](https://github.com/linkedin/dexmaker/blob/main/CHANGELOG.md)
- [Commits](https://github.com/linkedin/dexmaker/compare/2.28.1...2.28.3)

---
updated-dependencies:
- dependency-name: com.linkedin.dexmaker:dexmaker-mockito
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 03:04:42 +00:00
dependabot[bot]
504362e680 Bump daggerVersion from 2.42 to 2.43.1
Bumps `daggerVersion` from 2.42 to 2.43.1.

Updates `dagger` from 2.42 to 2.43.1
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43.1)

Updates `dagger-compiler` from 2.42 to 2.43.1
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43.1)

---
updated-dependencies:
- dependency-name: com.google.dagger:dagger
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:dagger-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 03:03:08 +00:00
dependabot[bot]
0ce2f8fae2 Bump kxCoroutinesVersion from 1.6.3 to 1.6.4
Bumps `kxCoroutinesVersion` from 1.6.3 to 1.6.4.

Updates `kotlinx-coroutines-android` from 1.6.3 to 1.6.4
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.3...1.6.4)

Updates `kotlinx-coroutines-core` from 1.6.3 to 1.6.4
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.3...1.6.4)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-01 03:02:48 +00:00
2fc6c67432 Merge pull request #1425 from eduebernal/freq-display-normal
fix marker scaling in frequency display
2022-07-30 18:30:53 -05:00
459cf02642 Merge pull request #1370 from iSoron/number-popup
Replace NumberPickerDialog by NumberPopup
2022-07-30 18:30:32 -05:00
44cb64601f Update test screenshots 2022-07-30 17:28:46 -05:00
eduebernal
dd47d4cf08 fix getWeekdaysInMonth test 2022-07-06 15:09:10 -07:00
eduebernal
8912a9d73c add test for getWeekdaysInMonth 2022-07-06 10:48:58 -07:00
eduebernal
9bd1c6f685 change getWeekdaysInMonth method 2022-07-06 10:48:19 -07:00
eduebernal
e15e06034c remove unused maxFreq var and get method 2022-07-06 10:46:50 -07:00
eduebernal
a6180a5049 fix marker scaling in freq display 2022-07-05 21:41:27 -07:00
dependabot[bot]
7c69b17e77 Bump kxCoroutinesVersion from 1.6.2 to 1.6.3
Bumps `kxCoroutinesVersion` from 1.6.2 to 1.6.3.

Updates `kotlinx-coroutines-android` from 1.6.2 to 1.6.3
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.2...1.6.3)

Updates `kotlinx-coroutines-core` from 1.6.2 to 1.6.3
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.2...1.6.3)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 07:42:04 +02:00
dependabot[bot]
602a40a532 Bump simpleclient_httpserver from 0.15.0 to 0.16.0
Bumps [simpleclient_httpserver](https://github.com/prometheus/client_java) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/prometheus/client_java/releases)
- [Commits](https://github.com/prometheus/client_java/compare/parent-0.15.0...parent-0.16.0)

---
updated-dependencies:
- dependency-name: io.prometheus:simpleclient_httpserver
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-03 21:27:22 +02:00
dependabot[bot]
e00998f913 Bump annotation from 1.3.0 to 1.4.0
Bumps annotation from 1.3.0 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.annotation:annotation
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-03 21:26:54 +02:00
dependabot[bot]
af5914c2db Bump kotlinx-coroutines-core-jvm from 1.6.2 to 1.6.3
Bumps [kotlinx-coroutines-core-jvm](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.2 to 1.6.3.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.2...1.6.3)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 12:52:10 +02:00
dependabot[bot]
6c5f70638a Bump kotlin-stdlib-jdk8 from 1.6.21 to 1.7.0
Bumps [kotlin-stdlib-jdk8](https://github.com/JetBrains/kotlin) from 1.6.21 to 1.7.0.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.6.21...v1.7.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib-jdk8
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 12:51:50 +02:00
dependabot[bot]
ba88552919 Bump appcompat from 1.4.1 to 1.4.2
Bumps appcompat from 1.4.1 to 1.4.2.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 07:09:30 +02:00
dependabot[bot]
8c90c4f68d Bump kotlin-stdlib from 1.6.21 to 1.7.0
Bumps [kotlin-stdlib](https://github.com/JetBrains/kotlin) from 1.6.21 to 1.7.0.
- [Release notes](https://github.com/JetBrains/kotlin/releases)
- [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md)
- [Commits](https://github.com/JetBrains/kotlin/compare/v1.6.21...v1.7.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlin:kotlin-stdlib
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 07:09:11 +02:00
dependabot[bot]
08eb1a600d Bump simpleclient_hotspot from 0.15.0 to 0.16.0
Bumps [simpleclient_hotspot](https://github.com/prometheus/client_java) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/prometheus/client_java/releases)
- [Commits](https://github.com/prometheus/client_java/compare/parent-0.15.0...parent-0.16.0)

---
updated-dependencies:
- dependency-name: io.prometheus:simpleclient_hotspot
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 07:08:57 +02:00
dependabot[bot]
8ea0480d4a Bump simpleclient from 0.15.0 to 0.16.0
Bumps [simpleclient](https://github.com/prometheus/client_java) from 0.15.0 to 0.16.0.
- [Release notes](https://github.com/prometheus/client_java/releases)
- [Commits](https://github.com/prometheus/client_java/compare/parent-0.15.0...parent-0.16.0)

---
updated-dependencies:
- dependency-name: io.prometheus:simpleclient
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-01 07:08:46 +02:00
Hielke Morsink
36ee39589e Fix small typo in build instructions 2022-06-28 20:02:46 +02:00
dependabot[bot]
ac7a721940 Bump daggerVersion from 2.41 to 2.42
Bumps `daggerVersion` from 2.41 to 2.42.

Updates `dagger` from 2.41 to 2.42
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.41...dagger-2.42)

Updates `dagger-compiler` from 2.41 to 2.42
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.41...dagger-2.42)

---
updated-dependencies:
- dependency-name: com.google.dagger:dagger
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:dagger-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-02 10:30:33 +02:00
dependabot[bot]
b36ca8673a Bump kxCoroutinesVersion from 1.6.1 to 1.6.2
Bumps `kxCoroutinesVersion` from 1.6.1 to 1.6.2.

Updates `kotlinx-coroutines-android` from 1.6.1 to 1.6.2
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.1...1.6.2)

Updates `kotlinx-coroutines-core` from 1.6.1 to 1.6.2
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.1...1.6.2)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-02 10:30:27 +02:00
dependabot[bot]
7cfac486f9 Bump org.jlleitschuh.gradle.ktlint from 10.2.1 to 10.3.0
Bumps org.jlleitschuh.gradle.ktlint from 10.2.1 to 10.3.0.

---
updated-dependencies:
- dependency-name: org.jlleitschuh.gradle.ktlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 23:07:05 +02:00
dependabot[bot]
21dd413ab5 Bump material from 1.5.0 to 1.6.1
Bumps [material](https://github.com/material-components/material-components-android) from 1.5.0 to 1.6.1.
- [Release notes](https://github.com/material-components/material-components-android/releases)
- [Commits](https://github.com/material-components/material-components-android/compare/1.5.0...1.6.1)

---
updated-dependencies:
- dependency-name: com.google.android.material:material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 23:04:11 +02:00
dependabot[bot]
39e10638b5 Bump kotlinx-coroutines-core-jvm from 1.6.1 to 1.6.2
Bumps [kotlinx-coroutines-core-jvm](https://github.com/Kotlin/kotlinx.coroutines) from 1.6.1 to 1.6.2.
- [Release notes](https://github.com/Kotlin/kotlinx.coroutines/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.coroutines/blob/master/CHANGES.md)
- [Commits](https://github.com/Kotlin/kotlinx.coroutines/compare/1.6.1...1.6.2)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 23:04:01 +02:00
68 changed files with 160 additions and 582 deletions

View File

@@ -9,6 +9,7 @@ on:
jobs: jobs:
Test: Test:
runs-on: self-hosted runs-on: self-hosted
timeout-minutes: 30
steps: steps:
- name: Check out source code - name: Check out source code
uses: actions/checkout@v1 uses: actions/checkout@v1
@@ -17,7 +18,7 @@ jobs:
run: ./build.sh build run: ./build.sh build
- name: Run Android tests - name: Run Android tests
run: ./build.sh android-tests-parallel 23 24 25 26 27 28 30 31 run: ./build.sh android-tests-parallel 28 29 30 31 32 33
- name: Upload artifacts - name: Upload artifacts
if: always() if: always()

5
.gitignore vendored
View File

@@ -12,13 +12,8 @@
.idea .idea
.secret .secret
build build
build/
captures
local.properties local.properties
node_modules node_modules
*xcuserdata* *xcuserdata*
*.sketch *.sketch
/design
/releases
/screenshots
crowdin.yml crowdin.yml

View File

@@ -1,16 +0,0 @@
#!/bin/sh
cd "$(dirname "$0")"
if [ -z "$GPG_PASSWORD" ]; then
echo Env variable GPG_PASSWORD must be defined
exit 1
fi
gpg \
--quiet \
--batch \
--yes \
--decrypt \
--passphrase="$GPG_PASSWORD" \
--output secret.tar.gz \
secret
tar -xzf secret.tar.gz
rm secret.tar.gz

Binary file not shown.

View File

@@ -1,6 +1,10 @@
# Changelog # Changelog
## [2.1.0] -- Unreleased ## [2.1.1] -- 2022-09-24
### Fixed
- Fix Tasker plugin (@iSoron, #1503)
## [2.1.0] -- 2022-09-10
### Added ### Added
- Allow user to add notes to specific dates (@vbh, #1103) - Allow user to add notes to specific dates (@vbh, #1103)
- Allow user to track "at most" numerical habits (@KristianTashkov, #1101) - Allow user to track "at most" numerical habits (@KristianTashkov, #1101)

View File

@@ -1,11 +1,11 @@
plugins { plugins {
val kotlinVersion = "1.6.10" val kotlinVersion = "1.7.21"
id("com.android.application") version ("7.0.3") apply (false) id("com.android.application") version ("7.3.1") apply (false)
id("org.jetbrains.kotlin.android") version kotlinVersion apply (false) id("org.jetbrains.kotlin.android") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.kapt") 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.android.extensions") version kotlinVersion apply (false)
id("org.jetbrains.kotlin.multiplatform") 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.0.0"
} }
apply { apply {

View File

@@ -85,10 +85,10 @@ android_setup() {
$AVDMANAGER delete avd --name $AVDNAME $AVDMANAGER delete avd --name $AVDNAME
log_info "Creating new Android virtual device (API $API)..." 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 \ $AVDMANAGER create avd \
--name $AVDNAME \ --name $AVDNAME \
--package "system-images;android-$API;default;x86_64" \ --package "system-images;android-$API;google_apis;x86_64" \
--device "Nexus 4" || return 1 --device "Nexus 4" || return 1
flock -u 10 flock -u 10

View File

@@ -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". 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. 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. 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. 6. Click the menu "Run" and "uhabits-android". The application should launch.

View File

@@ -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: 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. - **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.
* **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. - **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.
* **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.
## 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 1. Run `./build.sh android-setup API` to create the emulator, where `API` is the desired API level.
./build.sh medium-tests 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 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`.
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.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

2
landing/.gitignore vendored
View File

@@ -1,2 +0,0 @@
out/
.sass-cache

View File

@@ -1,27 +0,0 @@
haml := src/*.haml
sass := src/*.sass
html := $(patsubst src/%, out/%, $(patsubst %.haml,%.html,$(wildcard $(haml))))
css := $(patsubst src/%, out/%, $(patsubst %.sass,%.css,$(wildcard $(sass))))
src := $(wildcard src/**)
compile: $(html) $(css)
@rsync -rupE assets/ out/
out/%.css: src/%.sass $(src)
@echo ' sass $<'
@mkdir -p `dirname $@`
@sass $< $@
out/%.html: src/%.haml $(src)
@echo ' haml $<'
@mkdir -p `dirname $@`
@haml -E UTF-8 $< $@
push:
rsync -avP out/ axavier.org:/www/loophabits.org/
clean:
@rm -rfv out
@rm -rfv tmp

View File

@@ -1,27 +0,0 @@
Loop Habit Tracker Landing Page
===============================
This folder contains the source code that generates the project landing page, currently hosted at https://loophabits.org/
Pull requests with ideas for improving it are very welcome.
Build instructions
------------------
1. Install `haml`:
```bash
sudo apt install ruby-haml
```
2. Install `pandoc-ruby`:
```bash
gem install pandoc-ruby
```
3. Run `Makefile`
```bash
make
```
4. View the results (using, for example, [npm serve](https://www.npmjs.com/package/serve))
```bash
npm serve out/
```

View File

@@ -1 +0,0 @@
<meta http-equiv="Refresh" content="0; url='https://github.com/iSoron/uhabits/discussions/689'" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -1,106 +0,0 @@
!!! 5
%html
%head
%meta(charset="UTF-8")
%link(href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css")
%meta(name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no")
%title Loop Habit Tracker
%link(rel="stylesheet" type="text/css" href="lib/css/bootstrap.min.css")
%link(rel="stylesheet" type="text/css" href="index.css")
%body
.navbar.navbar-expand-md.navbar-light.bg-light
%a.navbar-brand(href="/")
%b Loop
Habit Tracker
%button.navbar-toggler(type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation")
%span.navbar-toggler-icon
#navbar.collapse.navbar-collapse
%ul.navbar-nav.mr-auto.mt-2.mt-lg-0
%li.nav-item
%a.nav-link(href="faq.html") FAQ
%li.nav-item
%a.nav-link(href="privacy.html") Privacy
%li.nav-item
%a.nav-link(href="https://source.loophabits.org") Source Code
%li.nav-item
%a.nav-link(href="https://translate.loophabits.org") Translate
.jumbotron.jumbotron-fluid
.site-wrapper
.container
.row.vertical-align
.col-md
%h1.display-4
Get your life on track
%p.lead
With daily reminders, beautiful charts and insightful statistics,
Loop Habit Tracker&trade; helps you create and maintain great habits. Completely free and open-source.
.store-badges
%a(href="https://play.google.com/store/apps/details?id=org.isoron.uhabits")
%img(src="images/google-play.png")
%a(href="https://f-droid.org/en/packages/org.isoron.uhabits/")
%img(src="images/f-droid.png")
.col-md
.s2
%img.screenshot(src="screenshots/uhabits1.png")
.s1
%img.screenshot(src="screenshots/uhabits4.png")
.section.screenshots
%span
%a(href="screenshots/uhabits1.png")
%img(src="screenshots/uhabits1_th.png")
%a(href="screenshots/uhabits2.png")
%img(src="screenshots/uhabits2_th.png")
%a(href="screenshots/uhabits3.png")
%img(src="screenshots/uhabits3_th.png")
%span
%a(href="screenshots/uhabits4.png")
%img(src="screenshots/uhabits4_th.png")
%a(href="screenshots/uhabits5.png")
%img(src="screenshots/uhabits5_th.png")
.section
.feature-header
%h1
Features
.container
.row
.col-md
%ul
%li
%h3 Habit score
Loop has an advanced formula for calculating the strength of your habits. Every repetition makes your habit stronger and every missed day makes it weaker. A few missed days after a long streak, however, will not completely destroy your progress, unlike many other don't-break-the-chain apps.
%li
%h3 Flexible schedules
In addition to daily habits, Loop supports habits with more complex schedules, such as 3 times per week or every other day.
%li
%h3 Reminders
Schedule notifications to remind you of your habits. Each habit can have its own reminder, at a chosen time of the day. Easily check or dismiss your habit directly from the notification.
%li
%h3 Widgets
Be reminded of your habits whenever you unlock your phone. Colorful widgets allow you to track your habits directly from your home screen, without even opening the app.
.col-md
%ul
%li
%h3 Take control of your data
If you want to further analyze your data, or move it to another service, Loop allows you to export it to spreadsheets (CSV) or to a database file (SQLite). For power users, check marks can be added through task automation apps such as Tasker.
%li
%h3 No limitations
Track as many habits as you wish. Loop imposes no artificial limits on how many habits you can have. All features are available to all users, and there are no in-app purchases.
%li
%h3 Completely ad-free and open source
There are no advertisements, annoying notifications or intrusive permissions in this app, and there will never be. The app is completely open-source (GPLv3).
%li
%h3 Works offline and respects your privacy
Loop doesn't require an Internet connection or online account registration. Your confidential data is never sent to anyone. Neither the developers nor any third-parties have access to it.
.section.footer
Copyright © 2016&ndash;2020, Alinson Santos Xavier. All Rights Reserved.
%script(type="text/javascript" src="lib/js/jquery.min.js")
%script(type="text/javascript" src="lib/js/bootstrap.bundle.min.js")

View File

@@ -1,104 +0,0 @@
html, body
max-width: 100%
overflow-x: hidden
body
font-family: 'Open Sans', sans-serif
padding-bottom: 0
a, a:hover
text-decoration: none
.navbar
box-shadow: rgba(0,0,0,0.4) 0px 0px 20px
background-color: white !important
.nav-link
margin: 0px 18px
.section
background-color: transparent
padding: 18px 0px
.container
ul
list-style-type: none
h3
font-size: 16px
font-weight: bold
margin: 18px 0px 0px 0px
.screenshots
text-align: center
background-color: #222
img
margin: 0.5%
border-radius: 10px
border: 3px solid #fff2
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5)
max-width: 17%
.footer
color: #888
background-color: #222
text-align: center
font-size: 12px
.jumbotron
background: linear-gradient(rgba(0,30,200,0.8),rgba(90,30,150,0.5)), url("images/hero-background-filter.jpg")
box-shadow: rgba(0,0,0,0.5) 0px 0px 20px
margin: 0
h1
max-width: 25rem
font-weight: bold
color: white
p
max-width: 40rem
color: white
.screenshot
box-shadow: rgba(0, 0, 0, 0.5) 5px 5px 20px
padding: 0px 0px 0px 0px
border-radius: 10px
border: 2px solid rgba(255, 255, 255, 0.2)
background-color: transparent
max-width: 300px
.store-badges
margin: 2rem 1rem
img
opacity: 0.8
height: 75px
img:hover
opacity: 1.0
.s1
padding-bottom: 50px
padding-left: 50px
.s2
position: absolute
top: 50px
left: 175px
.feature-header
text-align: center
font-weight: bold
padding: 18px
.align-right
text-align: right
.vertical-align
display: flex
align-items: center
.content
max-width: 800px
margin: 18px auto
padding: 0px 18px
//padding-left: 120px
h2, h3, h4
margin: 27px 0px 9px 0px
h2, h3
//margin-left: -120px
h4
//margin-left: -60px
font-size: 16px
font-weight: bold

View File

@@ -1,32 +0,0 @@
!!! 5
%html
%head
%meta(charset="UTF-8")
%link(href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css")
%meta(name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no")
%title Privacy | Loop Habit Tracker
%link(rel="stylesheet" type="text/css" href="lib/css/bootstrap.min.css")
%link(rel="stylesheet" type="text/css" href="index.css")
%body
.navbar.navbar-expand-md.navbar-light.bg-light
%a.navbar-brand(href="/")
%b Loop
Habit Tracker
%button.navbar-toggler(type="button" data-toggle="collapse" data-target="#navbar" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation")
%span.navbar-toggler-icon
#navbar.collapse.navbar-collapse
%ul.navbar-nav.mr-auto.mt-2.mt-lg-0
%li.nav-item
%a.nav-link(href="faq.html") FAQ
%li.nav-item
%a.nav-link(href="privacy.html") Privacy
%li.nav-item
%a.nav-link(href="https://source.loophabits.org") Source Code
%li.nav-item
%a.nav-link(href="https://translate.loophabits.org") Translate
%body
.content
:markdown
#{File.open("src/privacy.md").read}

View File

@@ -1,14 +0,0 @@
## Privacy Policy
- All data provided to Loop Habit Tracker is only stored locally in your
device. Loop Habit Tracker does not upload your data anywhere. The
developers of Loop Habit Tracker do not have access to your data.
- Your data is not shared with any 3rd parties. Loop Habit Tracker does not
include any advertisement libraries or any 3rd party tracking (analytics)
code, such as Google Analytics or Facebook SDK.
- If you have activated "backup & reset" in your phone settings (Settings /
Backup & Reset / Back up my data), you should be aware that Android itself
will periodically save a copy of your phone's data in Google's servers. The
developers of Loop Habit Tracker do not have access to this data.

View File

@@ -32,12 +32,12 @@ tasks.compileLint {
android { android {
compileSdk = 31 compileSdk = 32
defaultConfig { defaultConfig {
versionCode = 20100 versionCode = 20101
versionName = "2.1.0" versionName = "2.1.1"
minSdk = 23 minSdk = 28
targetSdk = 31 targetSdk = 31
applicationId = "org.isoron.uhabits" applicationId = "org.isoron.uhabits"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -68,12 +68,6 @@ android {
} }
} }
lint {
isCheckReleaseBuilds = false
isAbortOnError = false
disable("GoogleAppIndexingWarning")
}
compileOptions { compileOptions {
isCoreLibraryDesugaringEnabled = true isCoreLibraryDesugaringEnabled = true
targetCompatibility(JavaVersion.VERSION_1_8) targetCompatibility(JavaVersion.VERSION_1_8)
@@ -86,25 +80,25 @@ android {
} }
dependencies { dependencies {
val daggerVersion = "2.41" val daggerVersion = "2.44.2"
val kotlinVersion = "1.6.21" val kotlinVersion = "1.7.21"
val kxCoroutinesVersion = "1.6.1" val kxCoroutinesVersion = "1.6.4"
val ktorVersion = "1.6.8" val ktorVersion = "1.6.8"
val espressoVersion = "3.4.0" val espressoVersion = "3.5.0"
androidTestImplementation("androidx.test.espresso:espresso-contrib:$espressoVersion") androidTestImplementation("androidx.test.espresso:espresso-contrib:$espressoVersion")
androidTestImplementation("androidx.test.espresso:espresso-core:$espressoVersion") androidTestImplementation("androidx.test.espresso:espresso-core:$espressoVersion")
androidTestImplementation("com.google.dagger:dagger:$daggerVersion") androidTestImplementation("com.google.dagger:dagger:$daggerVersion")
androidTestImplementation("com.linkedin.dexmaker:dexmaker-mockito:2.28.1") androidTestImplementation("com.linkedin.dexmaker:dexmaker-mockito:2.28.3")
androidTestImplementation("io.ktor:ktor-client-mock:$ktorVersion") androidTestImplementation("io.ktor:ktor-client-mock:$ktorVersion")
androidTestImplementation("io.ktor:ktor-jackson:$ktorVersion") androidTestImplementation("io.ktor:ktor-jackson:$ktorVersion")
androidTestImplementation("androidx.annotation:annotation:1.3.0") androidTestImplementation("androidx.annotation:annotation:1.5.0")
androidTestImplementation("androidx.test.ext:junit:1.1.3") androidTestImplementation("androidx.test.ext:junit:1.1.4")
androidTestImplementation("androidx.test.uiautomator:uiautomator:2.2.0") androidTestImplementation("androidx.test.uiautomator:uiautomator:2.2.0")
androidTestImplementation("androidx.test:rules:1.4.0") androidTestImplementation("androidx.test:rules:1.5.0")
androidTestImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") androidTestImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
compileOnly("javax.annotation:jsr250-api:1.0") compileOnly("javax.annotation:jsr250-api:1.0")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5") coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.2.2")
implementation("com.github.AppIntro:AppIntro:6.2.0") implementation("com.github.AppIntro:AppIntro:6.2.0")
implementation("com.google.code.findbugs:jsr305:3.0.2") implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation("com.google.dagger:dagger:$daggerVersion") implementation("com.google.dagger:dagger:$daggerVersion")
@@ -116,11 +110,11 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$kxCoroutinesVersion") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$kxCoroutinesVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kxCoroutinesVersion") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kxCoroutinesVersion")
implementation("androidx.appcompat:appcompat:1.4.1") implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.legacy:legacy-preference-v14:1.0.0") implementation("androidx.legacy:legacy-preference-v14:1.0.0")
implementation("androidx.legacy:legacy-support-v4:1.0.0") implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("com.google.android.material:material:1.5.0") implementation("com.google.android.material:material:1.8.0")
implementation("com.opencsv:opencsv:5.6") implementation("com.opencsv:opencsv:5.7.1")
implementation(project(":uhabits-core")) implementation(project(":uhabits-core"))
kapt("com.google.dagger:dagger-compiler:$daggerVersion") kapt("com.google.dagger:dagger-compiler:$daggerVersion")
kaptAndroidTest("com.google.dagger:dagger-compiler:$daggerVersion") kaptAndroidTest("com.google.dagger:dagger-compiler:$daggerVersion")

View File

@@ -20,6 +20,7 @@ package org.isoron.uhabits.acceptance.steps
import android.os.Build import android.os.Build
import android.os.Build.VERSION.SDK_INT import android.os.Build.VERSION.SDK_INT
import android.os.Build.VERSION_CODES
import androidx.annotation.StringRes import androidx.annotation.StringRes
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso import androidx.test.espresso.Espresso
@@ -73,7 +74,7 @@ object CommonSteps : BaseUserInterfaceTest() {
} }
fun offsetHeaders() { fun offsetHeaders() {
device.swipe(750, 160, 600, 160, 20) device.swipe(500, 160, 350, 160, 20)
} }
fun scrollToText(text: String?) { fun scrollToText(text: String?) {

View File

@@ -53,6 +53,7 @@ object ListHabitsSteps {
clickViewWithId(R.id.action_filter) clickViewWithId(R.id.action_filter)
CommonSteps.clickText(R.string.hide_completed) CommonSteps.clickText(R.string.hide_completed)
} }
else -> throw RuntimeException()
} }
device.waitForIdle() device.waitForIdle()
} }

View File

@@ -270,7 +270,7 @@
<!-- Locale/Tasker --> <!-- Locale/Tasker -->
<receiver <receiver
android:name=".automation.FireSettingReceiver" android:name=".automation.FireSettingReceiver"
android:exported="false"> android:exported="true">
<intent-filter> <intent-filter>
<action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING" /> <action android:name="com.twofortyfouram.locale.intent.action.FIRE_SETTING" />
</intent-filter> </intent-filter>

View File

@@ -22,7 +22,6 @@ import android.animation.Keyframe;
import android.animation.ObjectAnimator; import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder; import android.animation.PropertyValuesHolder;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.os.Build;
import android.text.format.Time; import android.text.format.Time;
import android.view.View; import android.view.View;
@@ -43,17 +42,13 @@ public class Utils {
static final String SHARED_PREFS_NAME = "com.android.calendar_preferences"; static final String SHARED_PREFS_NAME = "com.android.calendar_preferences";
public static boolean isJellybeanOrLater() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
}
/** /**
* Try to speak the specified text, for accessibility. Only available on JB or later. * Try to speak the specified text, for accessibility. Only available on JB or later.
* @param text Text to announce. * @param text Text to announce.
*/ */
@SuppressLint("NewApi") @SuppressLint("NewApi")
public static void tryAccessibilityAnnounce(View view, CharSequence text) { public static void tryAccessibilityAnnounce(View view, CharSequence text) {
if (isJellybeanOrLater() && view != null && text != null) { if (view != null && text != null) {
view.announceForAccessibility(text); view.announceForAccessibility(text);
} }
} }

View File

@@ -383,10 +383,6 @@ public abstract class DayPickerView extends ListView implements OnScrollListener
if (child instanceof MonthView) { if (child instanceof MonthView) {
final CalendarDay focus = ((MonthView) child).getAccessibilityFocus(); final CalendarDay focus = ((MonthView) child).getAccessibilityFocus();
if (focus != null) { if (focus != null) {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN_MR1) {
// Clear focus to avoid ListView bug in Jelly Bean MR1.
((MonthView) child).clearAccessibilityFocus();
}
return focus; return focus;
} }
} }

View File

@@ -28,7 +28,7 @@ import org.isoron.uhabits.utils.toPaletteColor
class ColorPickerDialog : ColorPickerDialog() { class ColorPickerDialog : ColorPickerDialog() {
fun setListener(callback: OnColorPickedCallback) { fun setListener(callback: OnColorPickedCallback) {
super.setOnColorSelectedListener { c: Int -> super.setOnColorSelectedListener { c: Int ->
val pc = c.toPaletteColor(context!!) val pc = c.toPaletteColor(requireContext())
callback.onColorPicked(pc) callback.onColorPicked(pc)
} }
} }

View File

@@ -51,12 +51,12 @@ class HistoryEditorDialog : AppCompatDialogFragment(), CommandRunner.Listener {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
clearCurrentDialog() clearCurrentDialog()
val component = (activity!!.application as HabitsApplication).component val component = (requireActivity().application as HabitsApplication).component
commandRunner = component.commandRunner commandRunner = component.commandRunner
habit = component.habitList.getById(arguments!!.getLong("habit"))!! habit = component.habitList.getById(requireArguments().getLong("habit"))!!
preferences = component.preferences preferences = component.preferences
val themeSwitcher = AndroidThemeSwitcher(activity!!, preferences) val themeSwitcher = AndroidThemeSwitcher(requireActivity(), preferences)
themeSwitcher.apply() themeSwitcher.apply()
chart = HistoryChart( chart = HistoryChart(
@@ -71,10 +71,10 @@ class HistoryEditorDialog : AppCompatDialogFragment(), CommandRunner.Listener {
onDateClickedListener = onDateClickedListener ?: object : OnDateClickedListener {}, onDateClickedListener = onDateClickedListener ?: object : OnDateClickedListener {},
padding = 10.0, padding = 10.0,
) )
dataView = AndroidDataView(context!!, null) dataView = AndroidDataView(requireContext(), null)
dataView.view = chart!! dataView.view = chart!!
val dialog = Dialog(context!!).apply { val dialog = Dialog(requireContext()).apply {
val metrics = resources.displayMetrics val metrics = resources.displayMetrics
val maxHeight = resources.getDimensionPixelSize(R.dimen.history_editor_max_height) val maxHeight = resources.getDimensionPixelSize(R.dimen.history_editor_max_height)
setContentView(dataView) setContentView(dataView)

View File

@@ -60,7 +60,7 @@ class WeekdayPickerDialog :
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog { override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val builder = AlertDialog.Builder( val builder = AlertDialog.Builder(
activity!! requireActivity()
) )
builder builder
.setTitle(R.string.select_weekdays) .setTitle(R.string.select_weekdays)

View File

@@ -40,13 +40,13 @@ class HabitTypeDialog : AppCompatDialogFragment() {
val binding = SelectHabitTypeBinding.inflate(inflater, container, false) val binding = SelectHabitTypeBinding.inflate(inflater, container, false)
binding.buttonYesNo.setOnClickListener { binding.buttonYesNo.setOnClickListener {
val intent = IntentFactory().startEditActivity(activity!!, HabitType.YES_NO.value) val intent = IntentFactory().startEditActivity(requireActivity(), HabitType.YES_NO.value)
startActivity(intent) startActivity(intent)
dismiss() dismiss()
} }
binding.buttonMeasurable.setOnClickListener { binding.buttonMeasurable.setOnClickListener {
val intent = IntentFactory().startEditActivity(activity!!, HabitType.NUMERICAL.value) val intent = IntentFactory().startEditActivity(requireActivity(), HabitType.NUMERICAL.value)
startActivity(intent) startActivity(intent)
dismiss() dismiss()
} }

View File

@@ -221,6 +221,7 @@ class ShowHabitActivity : AppCompatActivity(), CommandRunner.Listener {
ShowHabitMenuPresenter.Message.COULD_NOT_EXPORT -> { ShowHabitMenuPresenter.Message.COULD_NOT_EXPORT -> {
showMessage(resources.getString(R.string.could_not_export)) showMessage(resources.getString(R.string.could_not_export))
} }
else -> {}
} }
} }

View File

@@ -22,8 +22,7 @@ import android.app.backup.BackupManager
import android.content.Intent import android.content.Intent
import android.content.SharedPreferences import android.content.SharedPreferences
import android.content.SharedPreferences.OnSharedPreferenceChangeListener import android.content.SharedPreferences.OnSharedPreferenceChangeListener
import android.os.Build import android.net.Uri
import android.os.Build.VERSION.SDK_INT
import android.os.Bundle import android.os.Bundle
import android.provider.Settings import android.provider.Settings
import android.util.Log import android.util.Log
@@ -45,6 +44,7 @@ import org.isoron.uhabits.core.utils.DateUtils.Companion.getLongWeekdayNames
import org.isoron.uhabits.notifications.AndroidNotificationTray.Companion.createAndroidNotificationChannel import org.isoron.uhabits.notifications.AndroidNotificationTray.Companion.createAndroidNotificationChannel
import org.isoron.uhabits.notifications.RingtoneManager import org.isoron.uhabits.notifications.RingtoneManager
import org.isoron.uhabits.utils.StyledResources import org.isoron.uhabits.utils.StyledResources
import org.isoron.uhabits.utils.startActivitySafely
import org.isoron.uhabits.widgets.WidgetUpdater import org.isoron.uhabits.widgets.WidgetUpdater
import java.util.Calendar import java.util.Calendar
@@ -65,7 +65,7 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
addPreferencesFromResource(R.xml.preferences) addPreferencesFromResource(R.xml.preferences)
val appContext = context!!.applicationContext val appContext = requireContext().applicationContext
if (appContext is HabitsApplication) { if (appContext is HabitsApplication) {
prefs = appContext.component.preferences prefs = appContext.component.preferences
widgetUpdater = appContext.component.widgetUpdater widgetUpdater = appContext.component.widgetUpdater
@@ -94,24 +94,31 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
override fun onPreferenceTreeClick(preference: Preference): Boolean { override fun onPreferenceTreeClick(preference: Preference): Boolean {
val key = preference.key ?: return false val key = preference.key ?: return false
if (key == "reminderSound") { when (key) {
showRingtonePicker() "reminderSound" -> {
return true showRingtonePicker()
} else if (key == "reminderCustomize") { return true
if (SDK_INT < Build.VERSION_CODES.O) return true }
createAndroidNotificationChannel(context!!) "reminderCustomize" -> {
val intent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS) createAndroidNotificationChannel(requireContext())
intent.putExtra(Settings.EXTRA_APP_PACKAGE, context!!.packageName) val intent = Intent(Settings.ACTION_CHANNEL_NOTIFICATION_SETTINGS)
intent.putExtra(Settings.EXTRA_CHANNEL_ID, NotificationTray.REMINDERS_CHANNEL_ID) intent.putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName)
startActivity(intent) intent.putExtra(Settings.EXTRA_CHANNEL_ID, NotificationTray.REMINDERS_CHANNEL_ID)
return true startActivity(intent)
return true
}
"rateApp" -> {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(getString(R.string.playStoreURL)))
activity?.startActivitySafely(intent)
return true
}
} }
return super.onPreferenceTreeClick(preference) return super.onPreferenceTreeClick(preference)
} }
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
ringtoneManager = RingtoneManager(activity!!) ringtoneManager = RingtoneManager(requireActivity())
sharedPrefs = preferenceManager.sharedPreferences sharedPrefs = preferenceManager.sharedPreferences
sharedPrefs!!.registerOnSharedPreferenceChangeListener(this) sharedPrefs!!.registerOnSharedPreferenceChangeListener(this)
if (!prefs.isDeveloper) { if (!prefs.isDeveloper) {
@@ -120,11 +127,7 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
} }
updateWeekdayPreference() updateWeekdayPreference()
if (SDK_INT < Build.VERSION_CODES.O) findPreference("reminderSound").isVisible = false
findPreference("reminderCustomize").isVisible = false
else {
findPreference("reminderSound").isVisible = false
}
} }
private fun updateWeekdayPreference() { private fun updateWeekdayPreference() {
@@ -154,8 +157,8 @@ class SettingsFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeLis
val pref = findPreference(key) val pref = findPreference(key)
pref.onPreferenceClickListener = pref.onPreferenceClickListener =
Preference.OnPreferenceClickListener { Preference.OnPreferenceClickListener {
activity!!.setResult(result) requireActivity().setResult(result)
activity!!.finish() requireActivity().finish()
true true
} }
} }

View File

@@ -168,14 +168,12 @@ class AndroidNotificationTray
fun createAndroidNotificationChannel(context: Context) { fun createAndroidNotificationChannel(context: Context) {
val notificationManager = context.getSystemService(Activity.NOTIFICATION_SERVICE) val notificationManager = context.getSystemService(Activity.NOTIFICATION_SERVICE)
as NotificationManager as NotificationManager
if (SDK_INT >= Build.VERSION_CODES.O) { val channel = NotificationChannel(
val channel = NotificationChannel( REMINDERS_CHANNEL_ID,
REMINDERS_CHANNEL_ID, context.resources.getString(R.string.reminder),
context.resources.getString(R.string.reminder), NotificationManager.IMPORTANCE_DEFAULT
NotificationManager.IMPORTANCE_DEFAULT )
) notificationManager.createNotificationChannel(channel)
notificationManager.createNotificationChannel(channel)
}
} }
} }
} }

View File

@@ -33,7 +33,8 @@ import org.isoron.uhabits.HabitsApplication
import org.isoron.uhabits.R import org.isoron.uhabits.R
import org.isoron.uhabits.activities.AndroidThemeSwitcher import org.isoron.uhabits.activities.AndroidThemeSwitcher
import org.isoron.uhabits.core.models.Habit import org.isoron.uhabits.core.models.Habit
import org.isoron.uhabits.core.ui.ThemeSwitcher.Companion.THEME_LIGHT import org.isoron.uhabits.core.ui.views.DarkTheme
import org.isoron.uhabits.core.ui.views.LightTheme
import org.isoron.uhabits.receivers.ReminderController import org.isoron.uhabits.receivers.ReminderController
import org.isoron.uhabits.utils.SystemUtils import org.isoron.uhabits.utils.SystemUtils
import java.util.Calendar import java.util.Calendar
@@ -51,11 +52,8 @@ class SnoozeDelayPickerActivity : FragmentActivity(), OnItemClickListener {
val app = applicationContext as HabitsApplication val app = applicationContext as HabitsApplication
val appComponent = app.component val appComponent = app.component
val themeSwitcher = AndroidThemeSwitcher(this, appComponent.preferences) val themeSwitcher = AndroidThemeSwitcher(this, appComponent.preferences)
if (themeSwitcher.getSystemTheme() == THEME_LIGHT) { themeSwitcher.setTheme()
setTheme(R.style.BaseDialog)
} else {
setTheme(R.style.BaseDialogDark)
}
val data = intent.data val data = intent.data
if (data == null) { if (data == null) {
finish() finish()
@@ -75,6 +73,16 @@ class SnoozeDelayPickerActivity : FragmentActivity(), OnItemClickListener {
SystemUtils.unlockScreen(this) SystemUtils.unlockScreen(this)
} }
private fun AndroidThemeSwitcher.setTheme() {
if (this.isNightMode) {
setTheme(R.style.BaseDialogDark)
this.currentTheme = DarkTheme()
} else {
setTheme(R.style.BaseDialog)
this.currentTheme = LightTheme()
}
}
private fun showTimePicker() { private fun showTimePicker() {
val calendar = Calendar.getInstance() val calendar = Calendar.getInstance()
val dialog = TimePickerDialog.newInstance( val dialog = TimePickerDialog.newInstance(

View File

@@ -21,18 +21,11 @@ package org.isoron.uhabits.utils
import android.app.Activity import android.app.Activity
import android.app.KeyguardManager import android.app.KeyguardManager
import android.content.Context import android.content.Context
import android.os.Build
import android.os.Build.VERSION.SDK_INT
import android.view.WindowManager
object SystemUtils { object SystemUtils {
fun unlockScreen(activity: Activity) { fun unlockScreen(activity: Activity) {
if (SDK_INT >= Build.VERSION_CODES.O) { val km = activity.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager
val km = activity.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager km.requestDismissKeyguard(activity, null)
km.requestDismissKeyguard(activity, null)
} else {
activity.window.addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD)
}
} }
} }

View File

@@ -21,9 +21,7 @@ package org.isoron.uhabits.widgets
import android.app.PendingIntent import android.app.PendingIntent
import android.content.Context import android.content.Context
import android.os.Build
import android.view.View import android.view.View
import androidx.annotation.RequiresApi
import org.isoron.platform.gui.toInt import org.isoron.platform.gui.toInt
import org.isoron.uhabits.core.models.Entry import org.isoron.uhabits.core.models.Entry
import org.isoron.uhabits.core.models.Habit import org.isoron.uhabits.core.models.Habit
@@ -49,7 +47,6 @@ open class CheckmarkWidget(
} }
} }
@RequiresApi(Build.VERSION_CODES.O)
override fun refreshData(widgetView: View) { override fun refreshData(widgetView: View) {
(widgetView as CheckmarkWidgetView).apply { (widgetView as CheckmarkWidgetView).apply {
val today = DateUtils.getTodayWithOffset() val today = DateUtils.getTodayWithOffset()

View File

@@ -1,6 +1,10 @@
2.1.1:
* Fix Tasker plugin
2.1: 2.1:
* Add notes to specific dates * Add notes to specific dates
* Track at-most measurable habits * Track at-most measurable habits
* Add skips to measurable habits * Add skips to measurable habits
* Bring back custom frequencies * Bring back custom frequencies
* Other minor improvements and bug fixes * Other minor improvements and bug fixes

View File

@@ -1,39 +0,0 @@
<!--
~ Copyright (C) 2016-2021 Álinson Santos Xavier <git@axavier.org>
~
~ This file is part of Loop Habit Tracker.
~
~ Loop Habit Tracker is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by the
~ Free Software Foundation, either version 3 of the License, or (at your
~ option) any later version.
~
~ Loop Habit Tracker is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="1dp"
android:left="1dp"
android:bottom="3dp"
android:right="3dp">
<ripple
android:color="#60ffffff">
<item android:id="@android:id/mask">
<shape android:shape="rectangle">
<corners android:radius="5dp"/>
<solid android:color="?android:colorPrimary"/>
</shape>
<color android:color="@color/white"/>
</item>
</ripple>
</item>
</layer-list>

View File

@@ -17,18 +17,23 @@
~ with this program. If not, see <http://www.gnu.org/licenses/>. ~ with this program. If not, see <http://www.gnu.org/licenses/>.
--> -->
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true"> <item
<layer-list> android:top="1dp"
<item android:bottom="3dp" android:left="1dp"
android:left="1dp" android:bottom="3dp"
android:right="3dp" android:right="3dp">
android:top="1dp"> <ripple
android:color="#60ffffff">
<item android:id="@android:id/mask">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<corners android:radius="5dp"/> <corners android:radius="5dp"/>
<solid android:color="#30ffffff"/> <solid android:color="?android:colorPrimary"/>
</shape> </shape>
<color android:color="@color/white"/>
</item> </item>
</layer-list> </ripple>
</item> </item>
</selector>
</layer-list>

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2016-2021 Álinson Santos Xavier <git@axavier.org>
~
~ This file is part of Loop Habit Tracker.
~
~ Loop Habit Tracker is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by the
~ Free Software Foundation, either version 3 of the License, or (at your
~ option) any later version.
~
~ Loop Habit Tracker is distributed in the hope that it will be useful, but
~ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
~ more details.
~
~ You should have received a copy of the GNU General Public License along
~ with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<resources>
</resources>

View File

@@ -160,11 +160,9 @@
</Preference> </Preference>
<Preference <Preference
android:key="rateApp"
android:title="@string/pref_rate_this_app" android:title="@string/pref_rate_this_app"
app:iconSpaceReserved="false"> app:iconSpaceReserved="false">
<intent
android:action="android.intent.action.VIEW"
android:data="@string/playStoreURL" />
</Preference> </Preference>
<Preference <Preference

View File

@@ -0,0 +1,3 @@
HabitName,HabitDescription,HabitCategory,CalendarDate,Value,CommentText
Caffeine,,Coffee Consumption,2022-11-21,80,
Caffeine,,Coffee Consumption,2022-11-22,80,
1 HabitName HabitDescription HabitCategory CalendarDate Value CommentText
2 Caffeine Coffee Consumption 2022-11-21 80
3 Caffeine Coffee Consumption 2022-11-22 80

View File

@@ -43,13 +43,12 @@ kotlin {
val jvmMain by getting { val jvmMain by getting {
dependencies { dependencies {
implementation(kotlin("stdlib-jdk8")) implementation(kotlin("stdlib-jdk8"))
compileOnly("com.google.dagger:dagger:2.41") compileOnly("com.google.dagger:dagger:2.44.2")
implementation("com.google.guava:guava:31.1-android") implementation("com.google.guava:guava:31.1-android")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.6.21") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.1") implementation("androidx.annotation:annotation:1.5.0")
implementation("androidx.annotation:annotation:1.3.0")
implementation("com.google.code.findbugs:jsr305:3.0.2") implementation("com.google.code.findbugs:jsr305:3.0.2")
implementation("com.opencsv:opencsv:5.6") implementation("com.opencsv:opencsv:5.7.1")
implementation("commons-codec:commons-codec:1.15") implementation("commons-codec:commons-codec:1.15")
implementation("org.apache.commons:commons-lang3:3.12.0") implementation("org.apache.commons:commons-lang3:3.12.0")
} }
@@ -59,7 +58,7 @@ kotlin {
dependencies { dependencies {
implementation(kotlin("test")) implementation(kotlin("test"))
implementation(kotlin("test-junit")) implementation(kotlin("test-junit"))
implementation("org.xerial:sqlite-jdbc:3.36.0.3") implementation("org.xerial:sqlite-jdbc:3.40.0.0")
implementation("org.hamcrest:hamcrest:2.2") implementation("org.hamcrest:hamcrest:2.2")
implementation("org.apache.commons:commons-io:1.3.2") implementation("org.apache.commons:commons-io:1.3.2")
implementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") implementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")

View File

@@ -86,10 +86,12 @@ class HabitBullCSVImporter
logger.info("Found a value of $value, considering this habit as numerical.") logger.info("Found a value of $value, considering this habit as numerical.")
h.type = HabitType.NUMERICAL h.type = HabitType.NUMERICAL
} }
h.originalEntries.add(Entry(timestamp, value, notes)) h.originalEntries.add(Entry(timestamp, value * 1000, notes))
} }
} }
} }
map.forEach { (_, habit) -> habit.recompute() }
} }
private fun parseTimestamp(rawValue: String): Timestamp { private fun parseTimestamp(rawValue: String): Timestamp {

View File

@@ -85,8 +85,8 @@ class ImportTest : BaseUnitTest() {
assertThat(habit.type, equalTo(HabitType.NUMERICAL)) assertThat(habit.type, equalTo(HabitType.NUMERICAL))
assertThat(habit.description, equalTo("")) assertThat(habit.description, equalTo(""))
assertThat(habit.frequency, equalTo(Frequency.DAILY)) assertThat(habit.frequency, equalTo(Frequency.DAILY))
assertThat(getValue(habit, 2021, 9, 1), equalTo(30)) assertThat(getValue(habit, 2021, 9, 1), equalTo(30000))
assertThat(getValue(habit, 2022, 1, 8), equalTo(100)) assertThat(getValue(habit, 2022, 1, 8), equalTo(100000))
val habit2 = habitList.getByPosition(1) val habit2 = habitList.getByPosition(1)
assertThat(habit2.name, equalTo("run")) assertThat(habit2.name, equalTo("run"))
@@ -98,6 +98,21 @@ class ImportTest : BaseUnitTest() {
assertTrue(isChecked(habit2, 2022, 1, 19)) assertTrue(isChecked(habit2, 2022, 1, 19))
} }
@Test
@Throws(IOException::class)
fun testHabitBullCSV4() {
importFromFile("habitbull4.csv")
assertThat(habitList.size(), equalTo(1))
val habit = habitList.getByPosition(0)
assertThat(habit.name, equalTo("Caffeine"))
assertThat(habit.type, equalTo(HabitType.NUMERICAL))
assertThat(habit.description, equalTo(""))
assertThat(habit.frequency, equalTo(Frequency.DAILY))
assertThat(getValue(habit, 2022, 11, 21), equalTo(80000))
assertThat(getValue(habit, 2022, 11, 22), equalTo(80000))
}
@Test @Test
@Throws(IOException::class) @Throws(IOException::class)
fun testLoopDB() { fun testLoopDB() {

View File

@@ -34,8 +34,8 @@ application {
dependencies { dependencies {
val ktorVersion = "1.6.8" val ktorVersion = "1.6.8"
val kotlinVersion = "1.6.21" val kotlinVersion = "1.7.21"
val logbackVersion = "1.2.11" val logbackVersion = "1.4.5"
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion") implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("ch.qos.logback:logback-classic:$logbackVersion") implementation("ch.qos.logback:logback-classic:$logbackVersion")
@@ -43,9 +43,9 @@ dependencies {
implementation("io.ktor:ktor-html-builder:$ktorVersion") implementation("io.ktor:ktor-html-builder:$ktorVersion")
implementation("io.ktor:ktor-jackson:$ktorVersion") implementation("io.ktor:ktor-jackson:$ktorVersion")
implementation("org.jetbrains:kotlin-css-jvm:1.0.0-pre.148-kotlin-1.4.30") implementation("org.jetbrains:kotlin-css-jvm:1.0.0-pre.148-kotlin-1.4.30")
implementation("io.prometheus:simpleclient:0.15.0") implementation("io.prometheus:simpleclient:0.16.0")
implementation("io.prometheus:simpleclient_httpserver:0.15.0") implementation("io.prometheus:simpleclient_httpserver:0.16.0")
implementation("io.prometheus:simpleclient_hotspot:0.15.0") implementation("io.prometheus:simpleclient_hotspot:0.16.0")
testImplementation("io.ktor:ktor-server-tests:$ktorVersion") testImplementation("io.ktor:ktor-server-tests:$ktorVersion")
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0") testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0")
testImplementation(kotlin("test")) testImplementation(kotlin("test"))