Skip to content

Commit

Permalink
Migrate calendar to Compose (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitletondor authored Dec 11, 2023
1 parent 333d472 commit 5b0b777
Show file tree
Hide file tree
Showing 95 changed files with 1,207 additions and 4,461 deletions.
1 change: 0 additions & 1 deletion Android/EasyBudget/.idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Android/EasyBudget/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ android {
compileSdk = 34
minSdk = 21
targetSdk = 34
versionCode = 113
versionName = "3.0.13"
versionCode = 116
versionName = "3.1.0"
vectorDrawables.useSupportLibrary = true

javaCompileOptions {
Expand Down Expand Up @@ -177,7 +177,6 @@ dependencies {

implementation("com.android.billingclient:billing-ktx:6.1.0")

implementation(project(":caldroid"))
implementation("me.relex:circleindicator:2.1.6@aar")
implementation("com.batch.android:batch-sdk:1.20.1")

Expand All @@ -192,6 +191,7 @@ dependencies {

implementation("io.realm.kotlin:library-sync:$realmVersion")

implementation("com.kizitonwose.calendar:compose:2.4.0")
implementation("net.sf.biweekly:biweekly:0.6.7")

implementation("net.lingala.zip4j:zip4j:2.11.5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class FirebaseAccounts(
INVITATION_DOCUMENT_RECEIVER_EMAIL to email,
INVITATION_DOCUMENT_SENDER_ID to currentUser.id,
INVITATION_DOCUMENT_SENDER_EMAIL to currentUser.email,
INVITATION_DOCUMENT_SENDER_LOCALE to Locale.getDefault()?.toString(),
INVITATION_DOCUMENT_SENDER_LOCALE to Locale.getDefault().toString(),
))
}.await()
}
Expand Down Expand Up @@ -303,7 +303,7 @@ class FirebaseAccounts(
}

private fun <T> Query.watchAsFlow(processData: (QuerySnapshot) -> T): Flow<T> = callbackFlow {
val snapshotListener = addSnapshotListener() { value, error ->
val snapshotListener = addSnapshotListener { value, error ->
if (error != null) {
close(error)
return@addSnapshotListener
Expand Down Expand Up @@ -348,7 +348,7 @@ class FirebaseAccounts(
senderId = getString(INVITATION_DOCUMENT_SENDER_ID) ?: throw IllegalStateException("Missing $INVITATION_DOCUMENT_SENDER_ID to create invitation"),
receiverEmail = getString(INVITATION_DOCUMENT_RECEIVER_EMAIL) ?: throw IllegalStateException("Missing $INVITATION_DOCUMENT_RECEIVER_EMAIL to create invitation"),
accountId = getString(INVITATION_DOCUMENT_ACCOUNT_ID) ?: throw IllegalStateException("Missing $INVITATION_DOCUMENT_ACCOUNT_ID to create invitation"),
status = InvitationStatus.values().firstOrNull {
status = InvitationStatus.entries.firstOrNull {
it.dbValue.toLong() == getLong(INVITATION_DOCUMENT_STATUS)
} ?: throw IllegalStateException("Invalid $INVITATION_DOCUMENT_STATUS (${getLong(INVITATION_DOCUMENT_STATUS)}) to create invitation"),
senderLocale = getString(INVITATION_DOCUMENT_SENDER_LOCALE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

package com.benoitletondor.easybudgetapp.db

import com.benoitletondor.easybudgetapp.model.DataForMonth
import com.benoitletondor.easybudgetapp.model.Expense
import com.benoitletondor.easybudgetapp.model.RecurringExpense
import kotlinx.coroutines.flow.Flow
import java.time.LocalDate
import java.time.YearMonth

interface DB {
val onChangeFlow: Flow<Unit>
Expand All @@ -30,13 +32,11 @@ interface DB {

suspend fun persistExpense(expense: Expense): Expense

suspend fun hasExpenseForDay(dayDate: LocalDate): Boolean

suspend fun hasUncheckedExpenseForDay(dayDate: LocalDate): Boolean
suspend fun getDataForMonth(yearMonth: YearMonth): DataForMonth

suspend fun getExpensesForDay(dayDate: LocalDate): List<Expense>

suspend fun getExpensesForMonth(monthStartDate: LocalDate): List<Expense>
suspend fun getExpensesForMonth(month: YearMonth): List<Expense>

suspend fun getBalanceForDay(dayDate: LocalDate): Double

Expand Down
Loading

0 comments on commit 5b0b777

Please sign in to comment.