From: Damyan Ivanov Date: Thu, 9 Jan 2020 21:19:58 +0000 (+0200) Subject: whitespace X-Git-Tag: v0.12.0~100 X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=commitdiff_plain;h=18bc95ab692b0073bd1f2766850e8fc0841b8a9d whitespace --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/Data.java b/app/src/main/java/net/ktnx/mobileledger/model/Data.java index 2cc40198..9b832b03 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/Data.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/Data.java @@ -79,10 +79,12 @@ public final class Data { public static int getProfileIndex(MobileLedgerProfile profile) { try (LockHolder ignored = profilesLocker.lockForReading()) { List prList = profiles.getValue(); - if (prList == null) throw new AssertionError(); + if (prList == null) + throw new AssertionError(); for (int i = 0; i < prList.size(); i++) { MobileLedgerProfile p = prList.get(i); - if (p.equals(profile)) return i; + if (p.equals(profile)) + return i; } return -1; @@ -92,10 +94,13 @@ public final class Data { public static int getProfileIndex(String profileUUID) { try (LockHolder ignored = profilesLocker.lockForReading()) { List prList = profiles.getValue(); - if (prList == null) throw new AssertionError(); + if (prList == null) + throw new AssertionError(); for (int i = 0; i < prList.size(); i++) { MobileLedgerProfile p = prList.get(i); - if (p.getUuid().equals(profileUUID)) return i; + if (p.getUuid() + .equals(profileUUID)) + return i; } return -1; @@ -103,13 +108,15 @@ public final class Data { } public static int retrieveCurrentThemeIdFromDb() { String profileUUID = MLDB.getOption(MLDB.OPT_PROFILE_UUID, null); - if (profileUUID == null) return -1; + if (profileUUID == null) + return -1; SQLiteDatabase db = App.getDatabase(); - try (Cursor c = db - .rawQuery("SELECT theme from profiles where uuid=?", new String[]{profileUUID})) + try (Cursor c = db.rawQuery("SELECT theme from profiles where uuid=?", + new String[]{profileUUID})) { - if (c.moveToNext()) return c.getInt(0); + if (c.moveToNext()) + return c.getInt(0); } return -1; @@ -126,7 +133,8 @@ public final class Data { } else { int i = getProfileIndex(profileUUID); - if (i == -1) i = 0; + if (i == -1) + i = 0; profile = prList.get(i); } } @@ -138,7 +146,8 @@ public final class Data { return; } MobileLedgerProfile pr = profile.getValue(); - if (pr == null) throw new IllegalStateException("No current profile"); + if (pr == null) + throw new IllegalStateException("No current profile"); retrieveTransactionsTask = new RetrieveTransactionsTask(new WeakReference<>(activity), profile.getValue()); @@ -147,7 +156,8 @@ public final class Data { retrieveTransactionsTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); } public static synchronized void stopTransactionsRetrieval() { - if (retrieveTransactionsTask != null) retrieveTransactionsTask.cancel(false); + if (retrieveTransactionsTask != null) + retrieveTransactionsTask.cancel(false); } public static void transactionRetrievalDone() { retrieveTransactionsTask = null; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java index 6dd640f9..0198b869 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionModel.java @@ -298,7 +298,7 @@ public class NewTransactionModel extends ViewModel { getItem(position).setFocusedElement(element); } public void swapItems(int one, int two) { - Collections.swap(items, one-1, two-1); + Collections.swap(items, one - 1, two - 1); } public void toggleComment(int position) { final MutableLiveData commentVisible = getItem(position).commentVisible; diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java index d8e2c7b0..6961f977 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/transaction_list/TransactionListAdapter.java @@ -59,7 +59,8 @@ public class TransactionListAdapter extends RecyclerView.Adapter { @Override @@ -153,10 +160,13 @@ public class TransactionListAdapter extends RecyclerView.Adapter