From a582a479654d859658b5534a04dfe03bc9e9df8a Mon Sep 17 00:00:00 2001 From: Lisheng Guan Date: Sat, 28 Dec 2024 16:17:25 +0800 Subject: [PATCH] Refactor: upgrade dagger to v2.54 and clean up subcategoryId code --- app/build.gradle | 4 ++-- .../main/java/com/money/manager/ex/domainmodel/Category.java | 2 +- .../java/com/money/manager/ex/domainmodel/SplitCategory.java | 2 +- .../money/manager/ex/domainmodel/SplitRecurringCategory.java | 2 +- .../com/money/manager/ex/transactions/SplitItemFactory.java | 4 ++-- .../org/moneymanagerex/android/testhelpers/DataHelpers.java | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b39397b87f..c7b19a8be7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -207,8 +207,8 @@ dependencies { implementation fileTree(dir: 'sqlite3mc', include: ['*.aar', '*.jar'], exclude: []) annotationProcessor 'org.parceler:parceler:1.1.13' // Dagger 2 - implementation 'com.google.dagger:dagger:2.53.1' - annotationProcessor 'com.google.dagger:dagger-compiler:2.53.1' + implementation 'com.google.dagger:dagger:2.54' + annotationProcessor 'com.google.dagger:dagger-compiler:2.54' // picasso implementation 'com.squareup.picasso:picasso:2.71828' diff --git a/app/src/main/java/com/money/manager/ex/domainmodel/Category.java b/app/src/main/java/com/money/manager/ex/domainmodel/Category.java index fd96c76503..21421baa2d 100644 --- a/app/src/main/java/com/money/manager/ex/domainmodel/Category.java +++ b/app/src/main/java/com/money/manager/ex/domainmodel/Category.java @@ -66,8 +66,8 @@ public void setName(String value) { } public String getBasename() { return getString(BASENAME);} - public void setBasename(String value) { setString(BASENAME, value);} + public void setBasename(String value) { setString(BASENAME, value);} } diff --git a/app/src/main/java/com/money/manager/ex/domainmodel/SplitCategory.java b/app/src/main/java/com/money/manager/ex/domainmodel/SplitCategory.java index 98b45ccff3..4e3b39d760 100644 --- a/app/src/main/java/com/money/manager/ex/domainmodel/SplitCategory.java +++ b/app/src/main/java/com/money/manager/ex/domainmodel/SplitCategory.java @@ -48,7 +48,7 @@ public class SplitCategory public static final String SPLITTRANSAMOUNT = "SPLITTRANSAMOUNT"; public static final String NOTES = "NOTES"; - public static SplitCategory create(long transactionId, long categoryId, long subcategoryId, TransactionTypes parentTransactionType, Money amount, String notes) { + public static SplitCategory create(long transactionId, long categoryId, TransactionTypes parentTransactionType, Money amount, String notes) { SplitCategory entity = new SplitCategory(); entity.setId(Constants.NOT_SET); diff --git a/app/src/main/java/com/money/manager/ex/domainmodel/SplitRecurringCategory.java b/app/src/main/java/com/money/manager/ex/domainmodel/SplitRecurringCategory.java index a308f3ec61..dbb5f7d9a6 100644 --- a/app/src/main/java/com/money/manager/ex/domainmodel/SplitRecurringCategory.java +++ b/app/src/main/java/com/money/manager/ex/domainmodel/SplitRecurringCategory.java @@ -48,7 +48,7 @@ public class SplitRecurringCategory public static final String SPLITTRANSAMOUNT = "SPLITTRANSAMOUNT"; public static final String NOTES = "NOTES"; - public static SplitRecurringCategory create(long transactionId, long categoryId, long subcategoryId, + public static SplitRecurringCategory create(long transactionId, long categoryId, TransactionTypes parentTransactionType, Money amount, String notes) { SplitRecurringCategory entity = new SplitRecurringCategory(); diff --git a/app/src/main/java/com/money/manager/ex/transactions/SplitItemFactory.java b/app/src/main/java/com/money/manager/ex/transactions/SplitItemFactory.java index b45cfcc0d9..82d8de4a36 100644 --- a/app/src/main/java/com/money/manager/ex/transactions/SplitItemFactory.java +++ b/app/src/main/java/com/money/manager/ex/transactions/SplitItemFactory.java @@ -35,10 +35,10 @@ public static ISplitTransaction create(String entityClassName, TransactionTypes if (entityClassName != null && entityClassName.contains(recurringSplitName)) { entity = SplitRecurringCategory.create(Constants.NOT_SET, Constants.NOT_SET, - Constants.NOT_SET, parentTransactionType, MoneyFactory.fromDouble(0), Constants.EMPTY_STRING); + parentTransactionType, MoneyFactory.fromDouble(0), Constants.EMPTY_STRING); } else { entity = SplitCategory.create(Constants.NOT_SET, Constants.NOT_SET, - Constants.NOT_SET, parentTransactionType, MoneyFactory.fromDouble(0), Constants.EMPTY_STRING); + parentTransactionType, MoneyFactory.fromDouble(0), Constants.EMPTY_STRING); } return entity; diff --git a/app/src/test/java/org/moneymanagerex/android/testhelpers/DataHelpers.java b/app/src/test/java/org/moneymanagerex/android/testhelpers/DataHelpers.java index 05cc3336ee..6ef598e238 100644 --- a/app/src/test/java/org/moneymanagerex/android/testhelpers/DataHelpers.java +++ b/app/src/test/java/org/moneymanagerex/android/testhelpers/DataHelpers.java @@ -104,10 +104,10 @@ public static void createSplitTransaction() { txRepo.insert(tx); // split categories SplitCategoryRepository splitRepo = new SplitCategoryRepository(context); - SplitCategory split1 = SplitCategory.create(tx.getId(), 1, -1, + SplitCategory split1 = SplitCategory.create(tx.getId(), 1, tx.getTransactionType(), MoneyFactory.fromDouble(25), "Note 1"); splitRepo.insert(split1); - SplitCategory split2 = SplitCategory.create(tx.getId(), 1, -1, + SplitCategory split2 = SplitCategory.create(tx.getId(), 1, tx.getTransactionType(), MoneyFactory.fromDouble(25), "Note 2"); splitRepo.insert(split2); }