From 4e2b2623bca9b2bd300e265bbf46ac8454769c77 Mon Sep 17 00:00:00 2001 From: Lisheng Guan Date: Thu, 26 Dec 2024 13:26:28 +0800 Subject: [PATCH] Refactor: clean up and format --- .../java/com/money/manager/ex/common/MmxCursorLoader.java | 1 - .../com/money/manager/ex/currency/CurrencyService.java | 7 +++---- .../java/com/money/manager/ex/payee/PayeeListFragment.java | 2 +- .../java/com/money/manager/ex/tag/TagListFragment.java | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/money/manager/ex/common/MmxCursorLoader.java b/app/src/main/java/com/money/manager/ex/common/MmxCursorLoader.java index 9eb1c5bfdb..a26bdc1bb4 100644 --- a/app/src/main/java/com/money/manager/ex/common/MmxCursorLoader.java +++ b/app/src/main/java/com/money/manager/ex/common/MmxCursorLoader.java @@ -39,7 +39,6 @@ public MmxCursorLoader(Context context) { public MmxCursorLoader(Context context, Uri uri, Select query) { // String[] projection, String selection, String[] selectionArgs, String sortOrder super(context, uri, query.projection, query.selection, query.selectionArgs, query.sort); - } @Override diff --git a/app/src/main/java/com/money/manager/ex/currency/CurrencyService.java b/app/src/main/java/com/money/manager/ex/currency/CurrencyService.java index 55a253e2e4..ac0e8eeaed 100644 --- a/app/src/main/java/com/money/manager/ex/currency/CurrencyService.java +++ b/app/src/main/java/com/money/manager/ex/currency/CurrencyService.java @@ -19,7 +19,6 @@ import android.content.Context; import android.database.Cursor; import android.text.TextUtils; -import android.util.Log; import android.util.LongSparseArray; import android.widget.Toast; @@ -228,7 +227,7 @@ public long getBaseCurrencyId() { // could not get base currency from the system. Use Euro? //Currency euro = repo.loadCurrency("EUR"); //result = euro.getCurrencyId(); - Log.w("CurrencyService", "system default currency is null!"); + Timber.tag("CurrencyService").w("system default currency is null!"); result = 2; } else { CurrencyRepository repo = getRepository(); @@ -238,7 +237,7 @@ public long getBaseCurrencyId() { result = defaultCurrency.getCurrencyId(); } else { // currency not found. - Log.w("CurrencyService", "currency " + systemCurrency.getCurrencyCode() + + Timber.tag("CurrencyService").w("currency " + systemCurrency.getCurrencyCode() + "not found!"); result = 2; } @@ -490,7 +489,7 @@ public void updateExchangeRate(long currencyId) { } public void updateExchangeRates(List currencies){ - if (currencies == null || currencies.size() <= 0) return; + if (currencies == null || currencies.size() == 0) return; String symbol; String baseCurrencySymbol = getBaseCurrencyCode(); diff --git a/app/src/main/java/com/money/manager/ex/payee/PayeeListFragment.java b/app/src/main/java/com/money/manager/ex/payee/PayeeListFragment.java index 718fac661d..760bcc3738 100644 --- a/app/src/main/java/com/money/manager/ex/payee/PayeeListFragment.java +++ b/app/src/main/java/com/money/manager/ex/payee/PayeeListFragment.java @@ -247,7 +247,7 @@ public Loader onCreateLoader(int id, Bundle args) { String whereClause = null; String[] selectionArgs = null; if (!TextUtils.isEmpty(mCurFilter)) { - whereClause = Payee.PAYEENAME + " LIKE ?"; // + mCurFilter + "%'"; + whereClause = Payee.PAYEENAME + " LIKE ?"; selectionArgs = new String[]{mCurFilter + '%'}; } PayeeRepository repo = new PayeeRepository(getActivity()); diff --git a/app/src/main/java/com/money/manager/ex/tag/TagListFragment.java b/app/src/main/java/com/money/manager/ex/tag/TagListFragment.java index 0c6376c098..8ec0b11d62 100644 --- a/app/src/main/java/com/money/manager/ex/tag/TagListFragment.java +++ b/app/src/main/java/com/money/manager/ex/tag/TagListFragment.java @@ -220,7 +220,7 @@ public Loader onCreateLoader(int id, Bundle args) { String whereClause = "ACTIVE = 1"; String[] selectionArgs = null; if (!TextUtils.isEmpty(mCurFilter)) { - whereClause += " AND " + Tag.TAGNAME + " LIKE ?"; // + mCurFilter + "%'"; + whereClause += " AND " + Tag.TAGNAME + " LIKE ?"; selectionArgs = new String[]{mCurFilter + '%'}; } TagRepository repo = new TagRepository(getActivity());