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;
}).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();
}
}
});