Skip to content

Commit

Permalink
Merge branch 'release/2.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitletondor committed Apr 9, 2022
2 parents 54c05b4 + c9e3304 commit 049895f
Show file tree
Hide file tree
Showing 167 changed files with 2,176 additions and 1,761 deletions.
3 changes: 2 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.

3 changes: 1 addition & 2 deletions Android/EasyBudget/EasyBudget.iml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
<component name="FacetManager">
<facet type="java-gradle" name="Java-Gradle">
<configuration>
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" />
<option name="BUILDABLE" value="false" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<component name="NewModuleRootManager">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
Expand Down
68 changes: 38 additions & 30 deletions Android/EasyBudget/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Benoit LETONDOR
* Copyright 2022 Benoit LETONDOR
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -15,7 +15,6 @@
*/
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'dagger.hilt.android.plugin'
Expand All @@ -30,14 +29,14 @@ repositories {
}

android {
compileSdkVersion 30
compileSdkVersion 32

defaultConfig {
applicationId "com.benoitletondor.easybudgetapp"
minSdkVersion 21
targetSdkVersion 30
versionCode 76
versionName "2.3.2"
targetSdkVersion 32
versionCode 81
versionName "2.4.0"
vectorDrawables.useSupportLibrary = true

javaCompileOptions {
Expand Down Expand Up @@ -83,55 +82,64 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11

coreLibraryDesugaringEnabled true
}

kotlinOptions {
jvmTarget = "1.8"
jvmTarget = "11"
}

buildFeatures {
viewBinding true
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.preference:preference-ktx:1.1.1'
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.1.5"

implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.work:work-runtime-ktx:2.5.0'
implementation 'androidx.work:work-gcm:2.5.0'
implementation 'com.google.android.play:core:1.10.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
implementation 'androidx.work:work-runtime-ktx:2.7.1'
implementation 'androidx.work:work-gcm:2.7.1'
implementation 'com.google.android.play:core:1.10.3'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0'

implementation platform("com.google.firebase:firebase-bom:27.1.0")
implementation platform("com.google.firebase:firebase-bom:29.2.1")
implementation "com.google.firebase:firebase-messaging-ktx"
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-crashlytics'
implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
implementation 'com.firebaseui:firebase-ui-auth:7.2.0'

implementation 'com.android.billingclient:billing:3.0.3'
implementation 'com.android.billingclient:billing-ktx:4.1.0'

implementation project(':caldroid')
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'me.relex:circleindicator:2.1.6@aar'
implementation 'com.batch.android:batch-sdk:1.17.1'
implementation 'com.batch.android:batch-sdk:1.18.2'

implementation "com.google.dagger:hilt-android:$hilt_version"
implementation 'androidx.hilt:hilt-work:1.0.0-beta01'
kapt 'androidx.hilt:hilt-compiler:1.0.0-beta01'
implementation 'androidx.hilt:hilt-work:1.0.0'
kapt 'androidx.hilt:hilt-compiler:1.0.0'
kapt "com.google.dagger:hilt-compiler:$hilt_version"

kapt "androidx.room:room-compiler:2.3.0"
implementation "androidx.room:room-runtime:2.3.0"
implementation "androidx.room:room-ktx:2.3.0"
kapt "androidx.room:room-compiler:2.4.2"
implementation "androidx.room:room-runtime:2.4.2"
implementation "androidx.room:room-ktx:2.4.2"

implementation 'net.lingala.zip4j:zip4j:2.5.2'
}
Expand Down
61 changes: 44 additions & 17 deletions Android/EasyBudget/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2021 Benoit LETONDOR
Copyright 2022 Benoit LETONDOR
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -39,7 +39,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="false"
android:theme="@style/LoadingTheme"
tools:ignore="UnusedAttribute">
tools:ignore="DataExtractionRules,UnusedAttribute"
android:dataExtractionRules="@xml/data_extraction_rules">

<!-- Disable advertising ID and SSAID for GA & FCM -->
<meta-data
Expand All @@ -53,16 +54,25 @@
android:value="false" />

<provider
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="${applicationId}.workmanager-init"
tools:node="remove" />
android:name="androidx.startup.InitializationProvider"
android:authorities="${applicationId}.androidx-startup"
android:exported="false"
tools:node="merge">

<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup"
tools:node="remove" />

</provider>

<activity
android:name=".view.main.MainActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize"
android:label="@string/app_name"
android:launchMode="singleTask"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -85,45 +95,62 @@
android:name=".view.report.base.MonthlyReportBaseActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_monthly_report"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"
android:exported="false"/>
<activity
android:name=".view.expenseedit.ExpenseEditActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_add_expense"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"
android:exported="false"/>
<activity
android:name=".view.recurringexpenseadd.RecurringExpenseEditActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_recurring_expense_add"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"
android:exported="false"/>
<activity
android:name=".view.settings.SettingsActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_settings"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"/>
<activity
android:name=".view.welcome.WelcomeActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_welcome"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
tools:ignore="LockedOrientationActivity"
android:exported="false"/>
<activity
android:name=".view.premium.PremiumActivity"
android:configChanges="locale|keyboardHidden|orientation|screenSize"
android:label="@string/title_activity_premium"
android:screenOrientation="portrait" />
android:screenOrientation="portrait"
android:exported="false"
tools:ignore="LockedOrientationActivity"/>
<activity
android:name=".view.settings.backup.BackupSettingsActivity"
android:label="@string/backup_settings_activity_title" />
android:label="@string/backup_settings_activity_title"
android:screenOrientation="portrait"
android:exported="false"
tools:ignore="LockedOrientationActivity" />

<!-- Push -->
<service
android:name=".push.PushService"
tools:ignore="ExportedService">
android:exported="false">
<intent-filter android:priority="999">
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service> <!-- Notif services -->
<receiver android:name=".notif.AppUpdateBroadcastReceiver">
</service>

<receiver
android:name=".notif.AppUpdateBroadcastReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Benoit LETONDOR
* Copyright 2022 Benoit LETONDOR
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Benoit LETONDOR
* Copyright 2022 Benoit LETONDOR
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -90,7 +90,7 @@ class EasyBudget : Application(), Configuration.Provider {
// FIXME this should be done on restore, change that for the whole parameters restoration
if( parameters.getShouldResetInitDate() ) {
runBlocking { getOldestExpense() }?.let { expense ->
parameters.setInitTimestamp(expense.date.time)
parameters.setInitDate(expense.date.toStartOfDayDate())
}

parameters.setShouldResetInitDate(false)
Expand Down Expand Up @@ -118,10 +118,18 @@ class EasyBudget : Application(), Configuration.Provider {
/*
* Save first launch date if needed
*/
val initDate = parameters.getInitTimestamp()
if (initDate <= 0) {
parameters.setInitTimestamp(Date().time)
parameters.setUserCurrency(Currency.getInstance(Locale.getDefault())) // Set a default currency before onboarding
val initDate = parameters.getInitDate()
if (initDate == null) {
parameters.setInitDate(Date())

// Set a default currency before onboarding
val currency = try {
Currency.getInstance(Locale.getDefault())
} catch (e: Exception) {
Currency.getInstance("USD")
}

parameters.setUserCurrency(currency)
}

/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Benoit LETONDOR
* Copyright 2022 Benoit LETONDOR
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,10 +18,10 @@ package com.benoitletondor.easybudgetapp.auth

import android.app.Activity
import android.content.Intent
import androidx.lifecycle.LiveData
import kotlinx.coroutines.flow.StateFlow

interface Auth {
val state: LiveData<AuthState>
val state: StateFlow<AuthState>

fun startAuthentication(activity: Activity)
fun handleActivityResult(requestCode: Int, resultCode: Int, data: Intent?)
Expand Down
Loading

0 comments on commit 049895f

Please sign in to comment.