Show color button even for a single habit

This commit is contained in:
2016-03-11 12:26:34 -05:00
parent 3b28c37c5e
commit 2b3b423fa3

View File

@@ -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);
}