Show color button even for a single habit

pull/30/head
Alinson S. Xavier 10 years ago
parent 3b28c37c5e
commit 2b3b423fa3

@ -111,17 +111,13 @@ public class HabitSelectionCallback implements ActionMode.Callback
private void updateActions(Menu menu)
{
boolean showEdit = (selectedPositions.size() == 1);
boolean showColor = true;
boolean showArchive = true;
boolean showUnarchive = true;
if (showEdit) showColor = false;
for (int i : selectedPositions)
{
Habit h = loader.habitsList.get(i);
if (h.isArchived())
{
showColor = false;
showArchive = false;
}
else showUnarchive = false;
@ -132,8 +128,8 @@ public class HabitSelectionCallback implements ActionMode.Callback
MenuItem itemArchive = menu.findItem(R.id.action_archive_habit);
MenuItem itemUnarchive = menu.findItem(R.id.action_unarchive_habit);
itemColor.setVisible(true);
itemEdit.setVisible(showEdit);
itemColor.setVisible(showColor);
itemArchive.setVisible(showArchive);
itemUnarchive.setVisible(showUnarchive);
}

Loading…
Cancel
Save