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

@@ -2,14 +2,14 @@
#include <functional>
#include <vector>
#include "../Activity.h"
#include "../ActivityWithSubactivity.h"
#include "./MyLibraryActivity.h"
#include "util/ButtonNavigator.h"
struct RecentBook;
struct Rect;
class HomeActivity final : public Activity {
class HomeActivity final : public ActivityWithSubactivity {
ButtonNavigator buttonNavigator;
int selectorIndex = 0;
bool recentsLoading = false;
@@ -40,7 +40,7 @@ class HomeActivity final : public Activity {
const std::function<void()>& onMyLibraryOpen, const std::function<void()>& onRecentsOpen,
const std::function<void()>& onSettingsOpen, const std::function<void()>& onFileTransferOpen,
const std::function<void()>& onOpdsBrowserOpen)
: Activity("Home", renderer, mappedInput),
: ActivityWithSubactivity("Home", renderer, mappedInput),
onSelectBook(onSelectBook),
onMyLibraryOpen(onMyLibraryOpen),
onRecentsOpen(onRecentsOpen),