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

@@ -5,11 +5,11 @@
#include <string>
#include <vector>
#include "../Activity.h"
#include "../ActivityWithSubactivity.h"
#include "RecentBooksStore.h"
#include "util/ButtonNavigator.h"
class RecentBooksActivity final : public Activity {
class RecentBooksActivity final : public ActivityWithSubactivity {
private:
ButtonNavigator buttonNavigator;
@@ -29,7 +29,7 @@ class RecentBooksActivity final : public Activity {
explicit RecentBooksActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
const std::function<void()>& onGoHome,
const std::function<void(const std::string& path)>& onSelectBook)
: Activity("RecentBooks", renderer, mappedInput), onSelectBook(onSelectBook), onGoHome(onGoHome) {}
: ActivityWithSubactivity("RecentBooks", renderer, mappedInput), onSelectBook(onSelectBook), onGoHome(onGoHome) {}
void onEnter() override;
void onExit() override;
void loop() override;