From f32b711be2b9acec39988b5b28b7316760e97f65 Mon Sep 17 00:00:00 2001 From: Shinokuni Date: Thu, 25 Apr 2019 21:09:39 +0200 Subject: [PATCH] Select all option, use the global boolean --- .../java/com/readrops/app/activities/MainActivity.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/readrops/app/activities/MainActivity.java b/app/src/main/java/com/readrops/app/activities/MainActivity.java index 01c619cf..a6104f06 100644 --- a/app/src/main/java/com/readrops/app/activities/MainActivity.java +++ b/app/src/main/java/com/readrops/app/activities/MainActivity.java @@ -248,10 +248,10 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) { switch (menuItem.getItemId()) { case R.id.item_mark_read: - setReadState(true, allItemsSelected); + setReadState(true); break; case R.id.item_mark_unread: - setReadState(false, allItemsSelected); + setReadState(false); break; case R.id.item_select_all: adapter.selectAll(); @@ -355,8 +355,8 @@ public class MainActivity extends AppCompatActivity implements SwipeRefreshLayou }); } - private void setReadState(boolean read, boolean allItems) { - if (allItems) { + private void setReadState(boolean read) { + if (allItemsSelected) { viewModel.setAllItemsReadState(read) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread())