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

@@ -3,11 +3,11 @@
#include <string>
#include <vector>
#include "../Activity.h"
#include "../ActivityWithSubactivity.h"
#include "RecentBooksStore.h"
#include "util/ButtonNavigator.h"
class MyLibraryActivity final : public Activity {
class MyLibraryActivity final : public ActivityWithSubactivity {
private:
ButtonNavigator buttonNavigator;
@@ -30,7 +30,7 @@ class MyLibraryActivity final : public Activity {
const std::function<void()>& onGoHome,
const std::function<void(const std::string& path)>& onSelectBook,
std::string initialPath = "/")
: Activity("MyLibrary", renderer, mappedInput),
: ActivityWithSubactivity("MyLibrary", renderer, mappedInput),
basepath(initialPath.empty() ? "/" : std::move(initialPath)),
onSelectBook(onSelectBook),
onGoHome(onGoHome) {}