]> git.ktnx.net Git - mobile-ledger.git/commitdiff
two more lambdas
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 11 Jan 2019 20:16:12 +0000 (20:16 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Fri, 11 Jan 2019 20:16:12 +0000 (20:16 +0000)
app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java

index 66008e9c21221f0f98f1e07ade2614f553b4049b..0944d1fa5dba521fd9f2c3675b14018ae2a503ae 100644 (file)
@@ -43,7 +43,6 @@ import net.ktnx.mobileledger.ui.RecyclerItemListener;
 import net.ktnx.mobileledger.ui.activity.MainActivity;
 
 import java.util.List;
-import java.util.Observable;
 import java.util.Observer;
 
 import static net.ktnx.mobileledger.ui.activity.SettingsActivity.PREF_KEY_SHOW_ONLY_STARRED_ACCOUNTS;
@@ -162,18 +161,10 @@ public class AccountSummaryFragment extends MobileLedgerListFragment {
             mActivity.scheduleTransactionListRetrieval();
         });
 
-        Data.accounts.addObserver(new Observer() {
-            @Override
-            public void update(Observable o, Object arg) {
-                mActivity.runOnUiThread(() -> modelAdapter.notifyDataSetChanged());
-            }
-        });
-        Data.profile.addObserver(new Observer() {
-            @Override
-            public void update(Observable o, Object arg) {
-                mActivity.runOnUiThread(() -> model.scheduleAccountListReload());
-            }
-        });
+        Data.accounts.addObserver(
+                (o, arg) -> mActivity.runOnUiThread(() -> modelAdapter.notifyDataSetChanged()));
+        Data.profile.addObserver(
+                (o, arg) -> mActivity.runOnUiThread(() -> model.scheduleAccountListReload()));
         update_account_table();
     }
     private void update_account_table() {