mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-28 18:20:14 +01:00
[escher] Add methods viewWillAppear/Disappear in view controller instead
of keeping track of dataHasChanged in the selectable table view Change-Id: Id2626f527f44714e29b9bd66e2c843193e1b57b5
This commit is contained in:
@@ -94,12 +94,17 @@ bool TabViewController::handleEvent(Ion::Events::Event event) {
|
||||
void TabViewController::setActiveTab(int8_t i) {
|
||||
ViewController * activeVC = m_children[i];
|
||||
if (i != m_activeChildIndex) {
|
||||
//TODO assert(i <= m_numberOfchildren);
|
||||
assert(i <= m_numberOfChildren);
|
||||
m_view.setActiveView(activeVC->view());
|
||||
m_view.m_tabView.setActiveIndex(i);
|
||||
if (m_activeChildIndex >= 0) {
|
||||
m_children[m_activeChildIndex]->viewWillDisappear();
|
||||
}
|
||||
m_activeChildIndex = i;
|
||||
}
|
||||
|
||||
if (i >= 0) {
|
||||
m_children[i]->viewWillAppear();
|
||||
}
|
||||
} else {}
|
||||
app()->setFirstResponder(activeVC);
|
||||
}
|
||||
|
||||
@@ -141,3 +146,13 @@ uint8_t TabViewController::numberOfTabs() {
|
||||
const char * TabViewController::tabName(uint8_t index) {
|
||||
return m_children[index]->title();
|
||||
}
|
||||
|
||||
void TabViewController::viewWillAppear() {
|
||||
ViewController * activeVC = m_children[m_activeChildIndex];
|
||||
activeVC->viewWillAppear();
|
||||
}
|
||||
|
||||
void TabViewController::viewWillDisappear() {
|
||||
ViewController * activeVC = m_children[m_activeChildIndex];
|
||||
activeVC->viewWillDisappear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user