106 Commits

Author SHA1 Message Date
338e637cb5 🌺 Spring cleaning
Several code improvements, lint suggestion, unused code removal and more
2025-03-29 12:43:15 -04:00
05004d9181 🚧 WIP 2025-03-28 14:40:23 -04:00
90d844e5ad 🚨 Fix build issues
The build task is failing even though the app is working fine. Time to
fix.
2025-02-08 12:05:35 -05:00
fe01f59ef8 🩹 Fix missing dependency from SQLDelight and Koin conflict
Based on opened issues, adding this explicit dependency solves the
problem.

https://github.com/cashapp/sqldelight/issues/4888
2024-06-04 18:08:57 -04:00
fd929a8fd7 🫣 Fix and disable rules
Making ktlint happier.
2024-06-04 17:41:55 -04:00
58b7013a8c 📽️ Update Kotlin DSL with new extensions
The extensions from KmpExtensions were replaced by the new additions in
the latest KMP plugin.
2024-05-25 19:29:41 -04:00
d4f3395fd0 🔄 Replace Moko Resources with Compose Resources
Moko Resources is great, but the simplicity and first-party support in
Compose got me.
2024-05-25 13:36:42 -04:00
0216e9dd49 🍫 Fix Ktlint
Fix Ktlint new changes in the latest update - some annoying rules were
disabled
2024-05-17 19:50:52 -04:00
f6a8ee4864 🧃 Update SQLDelight to run the insert + select in a transaction
To ensure that the "select last row" will work properly after inserting
the task, the code was updated to run inside a transaction. This is
required because it "only works on the connection where the write
happened". Despite working fine in Android, this was not working on iOS.

Source: https://github.com/cashapp/sqldelight/issues/1828
2024-05-04 11:30:45 -04:00
c3523a4559 🧐 Changes after code review
- KDoc improved
2024-05-04 11:04:07 -04:00
7960e277f6 📦 Update Insert Task query to return the last inserted row
Having the last inserted row in the Task table will allow the app to
schedule an alarm right after inserting the task. The lack of this
support is what is causing the bug where the alarm is not schedule when
using the botom sheet.
2024-05-03 20:08:53 -04:00
003ccf184b ⬆️ Update more libraries
Let's goooo!
2024-04-18 10:41:21 -04:00
6b43827664 🐞 Fix wrong decoder for LocalDateTime
In the database we are storing the time in milliseconds, however, the
encoder was wrongly set as "fromEpochSeconds". The function was updated
to use the appropriate API.
2023-11-01 09:48:29 -04:00
e82bafbbb2 Introduce category pre-population on iOS
Since the SQLDelight does have a callback when the database schema is
created, the solution was checking if the database is created before
inserting the categories. The library creates the database on a specific
folder, which is now checked on iOS variant.

This change also required a few structure changes, such as the place of
the strings and implementing the resource access on each platform.
2023-10-12 09:07:09 -04:00
2e250a5cbb ♻️ Create plugin template for KMP modules
Creating plugins to make the setup easier and reduce boilerplate.
Additional changes need to comply with the build checks.
2023-08-24 09:24:00 -04:00
3c79591485 ♻️ Update KMP Android target reference
From "android" to "androidTarget"
2023-08-24 09:24:00 -04:00
f248f38bf3 🍏 Do the actual implementation of iOS SQLDelight
Local database is now supported in iOS.
2023-08-22 13:21:02 -04:00
ec4d5a0c01 🔀 Merge remote-tracking branch 'origin/alkaa-multiplatform' into amp/local
# Conflicts:
#	app/src/androidTest/java/com/escodro/alkaa/NotificationFlowTest.kt
#	data/local/build.gradle.kts
#	data/local/src/main/java/com/escodro/local/mapper/TaskMapper.kt
#	features/task/src/main/java/com/escodro/task/presentation/detail/alarm/TaskAlarmViewModel.kt
#	features/task/src/test/java/com/escodro/task/presentation/detail/TaskAlarmViewModelTest.kt
2023-08-16 08:42:31 -04:00
c8d1ff8c88 ♻️ Update the Local repository to use LocalDateTime
Since one more layer was converted from java.Calendar to
kotlinx.DateTime, now the local layer will be responsible for the
mapping.
2023-08-15 21:10:55 -04:00
4a443b7a37 Fix more tests
KMP doesn't support space in names in the minimum Android SDK.
Minor notification test failures fixed.
2023-08-15 18:58:45 -04:00
5d52bb0268 Update instrumented tests
Instrumented tests updated to work properly after all the module changes
2023-08-15 10:19:01 -04:00
2f94602cc0 🧐 Minor code changes after code review
Quick self code review there
2023-08-14 13:54:14 -04:00
6081ea1377 🔀 Merge remote-tracking branch 'origin/alkaa-multiplatform' into amp/local
# Conflicts:
#	data/local/build.gradle.kts
#	data/local/src/main/java/com/escodro/local/mapper/TaskMapper.kt
#	features/task/src/main/java/com/escodro/task/presentation/detail/alarm/TaskAlarmViewModel.kt
#	features/task/src/test/java/com/escodro/task/presentation/detail/TaskAlarmViewModelTest.kt
#	gradle/libs.versions.toml
#	plugins/src/main/java/extension/CommonExtension.kt
2023-08-14 13:48:45 -04:00
b148ae6c35 ♻️ Update the Local repository to use LocalDateTime
Since one more layer was converted from java.Calendar to
kotlinx.DateTime, now the local layer will be responsible for the
mapping.
2023-08-14 13:19:18 -04:00
e48f792809 Update tests
Tests updated to work properly after all the module changes
2023-08-14 13:04:05 -04:00
2687a61622 Create platform-specific SQLDelight setup
Using Koin and `expect class`, the code inside `commonMain` is
platform-agnostic. Now, every module implements its own platform driver.
For now, the prepopulation will only be executed in Android platform.
When the time comes, we refactor the code to also make it agnostic.
2023-08-14 13:03:38 -04:00
d6d7a30a4a ♻️ Setup module as KMP
One more module receives the power of KMP! 
2023-08-14 12:57:43 -04:00
425813256e 🚚 Move the files from main/java to commonMain/kotlin
Following the KMP module structure, the files were moved accordingly.
Also some minor import changes required regarding the Dispatchers.
2023-08-14 12:56:49 -04:00
e7758355bc Update unit tests
A single unit test was updated
2023-08-11 10:46:12 -04:00
5c7f9f0b1a Integrate SQLDelight
Replacing Room with SQLDelight was _delightful_.
2023-08-11 10:24:21 -04:00
157edebf51 🔥 Remove Room from the local module
Room was removed to make space for the new-shiny-multiplatform
SQLDelight.
2023-08-11 10:22:30 -04:00
4866d7cf4f ♻️ Update the Local repository to use LocalDateTime
Since one more layer was converted from java.Calendar to
kotlinx.DateTime, now the local layer will be responsible for the
mapping.
2023-08-08 09:01:50 -04:00
7e32913854 🗑️ Remove deprecated OptIn annotations
The `runTest` function is not longer Experimental and the annotations
were removed.
2023-05-15 10:26:15 -04:00
18d32de139 🚚 Remove transitive R references
Since Gradle 8.0 discourage us to use transitive R, each reference was
moved to the appropriate module
2023-04-26 09:46:56 -04:00
6a81b111b7 🔧 Move namespace from Manifest to build.gradle (#446)
Google is deprecating the AndroidManifest declaration for namespace.
Thanks to the AGP Upgrade Assistant, it was just a matter of running a
script.
2023-03-30 13:54:52 -04:00
0a88a7639c Update room to v2.5.0 (#413)
* Update room to v2.5.0

* 👽️ Update imports on new Room version

New Room version moved the `OnConflictStrategy` to a Companion object,
which means that the import should reflect this change.

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Igor Escodro <escodro@outlook.com>
2023-01-12 14:34:56 -05:00
19260b5e85 ♻️ Create custom CoroutineScope to be used application-wide (#410)
A new class called `AppCoroutineScope` was created to wrap the
functionality of a `CoroutineScope` without exposing the `.cancel()`
API. Since this scope should match the lifecycle of the App, it should
never be cancelled. This class will avoid human error by not exposing
the function to cancel the scope.

The decision to create a wrapper instead of implementing the
`CoroutineScope` interface was because the `.cancel()` function is not
part of the interface itself, it's an extension function. Due to the
Liskov Substitution Principle, it would be possible to attribute a
`CustomCoroutineScope` in a `CoroutineScope` interface, making it
possible to access the `.cancel()` function even if it was implemented
in the custom one.

For the moment, only the `.launch()` function is exposed. If other
functions (such as `.async()`) is needed, than future changes will add
them.
2023-01-04 19:24:17 -05:00
83fac8cf83 Update dependency com.pinterest:ktlint to v0.48.0 (#396)
* Update dependency com.pinterest:ktlint to v0.48.0

* 🚨 Add trailing comma

Finally this rule is in place for Ktlint. Command was executed to add
trailing comma in every single Kotlin file.

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Igor Escodro <escodro@outlook.com>
2022-12-16 10:26:54 -05:00
71b882294f 🔥 Clean all unused dependencies
The best commit is the commit to remove lines of code. If this include
unused ones, even better!
2022-12-08 09:13:51 -05:00
498cbfb8e7 ♻️ Remove duplicated CoroutineScope (#385)
While creating the new ApplicationScope, I didn't realized that a Scope
was already in place. That was confusing, especially because both have
the same goal. In order to make it better, one was removed and the one
with qualifier is kept.
2022-12-02 12:15:37 -05:00
50f27ced6f ⬆️ Replace KAPT with KSP (#378)
At last! Bye, bye, KAPT 👋
2022-11-23 11:38:11 -05:00
7815dd6a71 ♻️ Update all the KotlinX dependencies under the same tree
Version Catalog updated since now we have 4 KotlinX dependencies
2022-11-18 10:23:46 -05:00
5d500911a3 ♻️ Move the Koin injections to use class constructor (#357)
Recently, I found out that is possible to use class constructor instead
of manual instantiation. No more `get(), get(), get(), get()...`.
2022-11-11 14:04:58 -05:00
53d816055a Update deprecated Test class and fix imports
The Database Migration test class were using deprecated API and the
dependency for AndroidJUnit4 was missing due to wrong Gradle
configuration.
2022-10-12 13:40:18 -04:00
2d7663f393 🔀 Fix merge and make it run with all Material You
It's time to make it finally run, updating all the references to
Material You (M3)! 🎉
2022-09-26 14:28:24 -04:00
e44d0039c7 👽️ Update codebase with new Ktlint rules
Codebase updated
2022-06-20 12:18:23 -03:00
0c638e51d6 Update Coroutine Test deprecated APIs
Removing `runBlockingTest` in favor of `runTest` and also updated
the TestDispatcher to more modern ones
2022-06-17 15:48:30 -03:00
90cebda72e ️ Revert database encapsulation
Encapsulation reverted to be used in E2E tests.
2022-05-31 14:05:12 -03:00
e05aaaed9b 🔧 Update All Gradle files to use JVM plugins
Now that the buildSrc no longer exists, all the references were updated
to JVM Convention Plugins.
2022-05-26 15:29:08 -03:00
e31f087d09 ⬆️ Update Android Runner version
Update Android Android Runner dependency and change the runner in the
Database test
2022-05-04 09:40:54 -03:00