## Summary * **What is the goal of this PR?** Small UX improvement to the Home screen by preserving the last selected cursor position when returning to it. It supersedes #985 and #1103, which are both significantly outdated and hundreds of commits behind master. --- ### AI Usage Did you use AI tools to help write this code? _**< YES >**_
25 lines
935 B
C++
25 lines
935 B
C++
#include "Activity.h"
|
|
|
|
#include "ActivityManager.h"
|
|
|
|
void Activity::onEnter() { LOG_DBG("ACT", "Entering activity: %s", name.c_str()); }
|
|
|
|
void Activity::onExit() { LOG_DBG("ACT", "Exiting activity: %s", name.c_str()); }
|
|
|
|
void Activity::requestUpdate(bool immediate) { activityManager.requestUpdate(immediate); }
|
|
|
|
void Activity::requestUpdateAndWait() { activityManager.requestUpdateAndWait(); }
|
|
|
|
void Activity::onGoHome(HomeMenuItem item) { activityManager.goHome(item); }
|
|
|
|
void Activity::onSelectBook(const std::string& path) { activityManager.goToReader(path); }
|
|
|
|
void Activity::startActivityForResult(std::unique_ptr<Activity>&& activity, ActivityResultHandler resultHandler) {
|
|
this->resultHandler = std::move(resultHandler);
|
|
activityManager.pushActivity(std::move(activity));
|
|
}
|
|
|
|
void Activity::setResult(ActivityResult&& result) { this->result = std::move(result); }
|
|
|
|
void Activity::finish() { activityManager.popActivity(); }
|