refactor: change browse activities to ActivityWithSubactivity
Change HomeActivity, MyLibraryActivity, and RecentBooksActivity base class from Activity to ActivityWithSubactivity. Adds subActivity guard at top of each loop(). No new behavior, just enabling sub-activity hosting for the upcoming BookManageMenuActivity integration. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -103,7 +103,7 @@ void MyLibraryActivity::loadFiles() {
|
||||
}
|
||||
|
||||
void MyLibraryActivity::onEnter() {
|
||||
Activity::onEnter();
|
||||
ActivityWithSubactivity::onEnter();
|
||||
|
||||
loadFiles();
|
||||
selectorIndex = 0;
|
||||
@@ -112,11 +112,16 @@ void MyLibraryActivity::onEnter() {
|
||||
}
|
||||
|
||||
void MyLibraryActivity::onExit() {
|
||||
Activity::onExit();
|
||||
ActivityWithSubactivity::onExit();
|
||||
files.clear();
|
||||
}
|
||||
|
||||
void MyLibraryActivity::loop() {
|
||||
if (subActivity) {
|
||||
subActivity->loop();
|
||||
return;
|
||||
}
|
||||
|
||||
// Long press BACK (1s+) goes to root folder
|
||||
if (mappedInput.isPressed(MappedInputManager::Button::Back) && mappedInput.getHeldTime() >= GO_HOME_MS &&
|
||||
basepath != "/") {
|
||||
|
||||
Reference in New Issue
Block a user