[apps] AlternateEmptyNestedMenuController handles empty lists

This commit is contained in:
Léa Saviot
2020-04-14 18:00:17 +02:00
committed by Émilie Feral
parent b3d87c0e18
commit 3d64b8dc47
5 changed files with 52 additions and 24 deletions

View File

@@ -0,0 +1,18 @@
#include "alternate_empty_nested_menu_controller.h"
void AlternateEmptyNestedMenuController::viewDidDisappear() {
if (isDisplayingEmptyController()) {
pop();
}
NestedMenuController::viewDidDisappear();
}
bool AlternateEmptyNestedMenuController::displayEmptyController() {
assert(!isDisplayingEmptyController());
// If the content is empty, we push an empty controller.
if (numberOfRows() == 0) {
push(emptyViewController());
return true;
}
return false;
}