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

@@ -13,6 +13,8 @@ class ReaderActivity final : public ActivityWithSubactivity {
MyLibraryActivity::Tab libraryTab; // Track which tab to return to
const std::function<void()> onGoBack;
const std::function<void(const std::string&, MyLibraryActivity::Tab)> onGoToLibrary;
const std::function<void()> onGoToClearCache;
const std::function<void()> onGoToSettings;
static std::unique_ptr<Epub> loadEpub(const std::string& path);
static std::unique_ptr<Txt> loadTxt(const std::string& path);
static bool isTxtFile(const std::string& path);
@@ -25,11 +27,15 @@ class ReaderActivity final : public ActivityWithSubactivity {
public:
explicit ReaderActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, std::string initialBookPath,
MyLibraryActivity::Tab libraryTab, const std::function<void()>& onGoBack,
const std::function<void(const std::string&, MyLibraryActivity::Tab)>& onGoToLibrary)
const std::function<void(const std::string&, MyLibraryActivity::Tab)>& onGoToLibrary,
const std::function<void()>& onGoToClearCache = nullptr,
const std::function<void()>& onGoToSettings = nullptr)
: ActivityWithSubactivity("Reader", renderer, mappedInput),
initialBookPath(std::move(initialBookPath)),
libraryTab(libraryTab),
onGoBack(onGoBack),
onGoToLibrary(onGoToLibrary) {}
onGoToLibrary(onGoToLibrary),
onGoToClearCache(onGoToClearCache),
onGoToSettings(onGoToSettings) {}
void onEnter() override;
};