From 3a371d308aa8e164622cd71ffb09f2222972e1f1 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 17 Nov 2019 19:27:40 +0200 Subject: [PATCH] replace anonymous class with lambda --- .../ui/activity/NewTransactionActivity.java | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java index c0c902eb..90ce60b1 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java @@ -27,7 +27,6 @@ import android.widget.ProgressBar; import androidx.annotation.NonNull; import androidx.appcompat.widget.Toolbar; -import androidx.lifecycle.Observer; import androidx.lifecycle.ViewModelProviders; import androidx.recyclerview.widget.ItemTouchHelper; import androidx.recyclerview.widget.LinearLayoutManager; @@ -127,19 +126,16 @@ public class NewTransactionActivity extends ProfileThemedActivity implements Tas }).attachToRecyclerView(list); viewModel.isSubmittable() - .observe(this, new Observer() { - @Override - public void onChanged(Boolean isSubmittable) { - if (isSubmittable) { - if (fab != null) { - fab.show(); - fab.setEnabled(true); - } + .observe(this, isSubmittable -> { + if (isSubmittable) { + if (fab != null) { + fab.show(); + fab.setEnabled(true); } - else { - if (fab != null) { - fab.hide(); - } + } + else { + if (fab != null) { + fab.hide(); } } }); -- 2.39.5