From: Damyan Ivanov Date: Sun, 17 Nov 2019 17:27:40 +0000 (+0200) Subject: replace anonymous class with lambda X-Git-Tag: v0.11.0~51 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=3a371d308aa8e164622cd71ffb09f2222972e1f1;p=mobile-ledger.git replace anonymous class with lambda --- 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(); } } });