]> git.ktnx.net Git - mobile-ledger.git/commitdiff
drop unneeded profile parameter
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 16 Aug 2020 13:53:21 +0000 (16:53 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 16 Aug 2020 13:53:21 +0000 (16:53 +0300)
app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryAdapter.java
app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java

index fbbc47d7ff5080647b7a7f4e6994dcc48283fa56..5ffc62f544389cee71151b65aeb1dbf7a3e65c57 100644 (file)
@@ -49,7 +49,6 @@ import static net.ktnx.mobileledger.utils.Logger.debug;
 public class AccountSummaryAdapter
         extends RecyclerView.Adapter<AccountSummaryAdapter.LedgerRowHolder> {
     public static final int AMOUNT_LIMIT = 3;
-    private MobileLedgerProfile profile;
     private AsyncListDiffer<LedgerAccount> listDiffer;
     AccountSummaryAdapter() {
         listDiffer = new AsyncListDiffer<>(this, new DiffUtil.ItemCallback<LedgerAccount>() {
@@ -84,8 +83,7 @@ public class AccountSummaryAdapter
         return listDiffer.getCurrentList()
                          .size();
     }
-    public void setAccounts(MobileLedgerProfile profile, List<LedgerAccount> newList) {
-        this.profile = profile;
+    public void setAccounts(List<LedgerAccount> newList) {
         listDiffer.submitList(newList);
     }
     static class LedgerRowHolder extends RecyclerView.ViewHolder {
index fdeb54804e26471bbb2117c1736c29f7b7018fd7..174a4b2c775f0ed43fd25c3ac85bfbcfc0061800 100644 (file)
@@ -98,13 +98,12 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
 
         MobileLedgerProfile profile = Data.getProfile();
         profile.getDisplayedAccounts()
-               .observe(getViewLifecycleOwner(),
-                       (accounts) -> onAccountsChanged(profile, accounts));
+               .observe(getViewLifecycleOwner(), this::onAccountsChanged);
     }
-    private void onAccountsChanged(MobileLedgerProfile profile, List<LedgerAccount> accounts) {
+    private void onAccountsChanged(List<LedgerAccount> accounts) {
         Logger.debug("async-acc",
                 String.format(Locale.US, "fragment: got new account list (%d items)",
                         accounts.size()));
-        modelAdapter.setAccounts(profile, accounts);
+        modelAdapter.setAccounts(accounts);
     }
 }