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:
cottongin
2026-02-21 02:55:29 -05:00
parent c44ac0272a
commit 49471e36f1
6 changed files with 30 additions and 15 deletions

View File

@@ -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 != "/") {