feat: Integrate bookmark support into reader activities

Adds bookmark add/remove functionality to EpubReaderActivity and base
ReaderActivity, with visual indicator for bookmarked pages.
This commit is contained in:
cottongin
2026-01-28 02:20:29 -05:00
parent e991fb10a6
commit 245d5a7dd8
5 changed files with 192 additions and 7 deletions

View File

@@ -18,6 +18,8 @@ class EpubReaderActivity final : public ActivityWithSubactivity {
bool updateRequired = false;
const std::function<void()> onGoBack;
const std::function<void()> onGoHome;
const std::function<void()> onGoToClearCache;
const std::function<void()> onGoToSettings;
// End-of-book prompt state
bool showingEndOfBookPrompt = false;
@@ -38,11 +40,15 @@ class EpubReaderActivity final : public ActivityWithSubactivity {
public:
explicit EpubReaderActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::unique_ptr<Epub> epub,
const std::function<void()>& onGoBack, const std::function<void()>& onGoHome)
const std::function<void()>& onGoBack, const std::function<void()>& onGoHome,
const std::function<void()>& onGoToClearCache = nullptr,
const std::function<void()>& onGoToSettings = nullptr)
: ActivityWithSubactivity("EpubReader", renderer, mappedInput),
epub(std::move(epub)),
onGoBack(onGoBack),
onGoHome(onGoHome) {}
onGoHome(onGoHome),
onGoToClearCache(onGoToClearCache),
onGoToSettings(onGoToSettings) {}
void onEnter() override;
void onExit() override;
void loop() override;