From 62fd5c71d3eda795706f960c39d72f7006440ab0 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 11 Jan 2019 20:15:27 +0000 Subject: [PATCH] one more lambda --- .../AccountSummaryFragment.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java b/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java index 7f1c8f3a..66008e9c 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/account_summary/AccountSummaryFragment.java @@ -71,17 +71,14 @@ public class AccountSummaryFragment extends MobileLedgerListFragment { if (backgroundTaskCountObserver == null) { Log.d("acc", "creating background task count observer"); - Data.backgroundTaskCount.addObserver(backgroundTaskCountObserver = new Observer() { - @Override - public void update(Observable o, Object arg) { - if (mActivity == null) return; - if (swiper == null) return; - mActivity.runOnUiThread(() -> { - int cnt = Data.backgroundTaskCount.get(); - Log.d("acc", String.format("background task count changed to %d", cnt)); - swiper.setRefreshing(cnt > 0); - }); - } + Data.backgroundTaskCount.addObserver(backgroundTaskCountObserver = (o, arg) -> { + if (mActivity == null) return; + if (swiper == null) return; + mActivity.runOnUiThread(() -> { + int cnt = Data.backgroundTaskCount.get(); + Log.d("acc", String.format("background task count changed to %d", cnt)); + swiper.setRefreshing(cnt > 0); + }); }); } } -- 2.39.5