]> git.ktnx.net Git - mobile-ledger.git/commitdiff
replace anonymous class with lambda
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 17 Nov 2019 17:27:40 +0000 (19:27 +0200)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Sun, 17 Nov 2019 17:27:40 +0000 (19:27 +0200)
app/src/main/java/net/ktnx/mobileledger/ui/activity/NewTransactionActivity.java

index c0c902eb1734a16f0415e0f9d966372f6a2e56b0..90ce60b174bc6c10a2cf70e8d9ca6178c9fa60df 100644 (file)
@@ -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<Boolean>() {
-                     @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();
                          }
                      }
                  });