Skip to content

Commit e51d4e0

Browse files
committed
refactor: reorganize timer management methods in PageBase
- Move PauseAllTimers, ResumeAllTimers, DoEnter, and DoLeave to private section - Maintain existing functionality while improving code organization
1 parent 8fa4f32 commit e51d4e0

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
dependencies:
44
lvgl/lvgl: ">=9.0"
55

6-
version: "1.2.0"
6+
version: "1.2.1"
77
description: "LVGL page navigation for ESP-IDF: lifecycle, gestures, transitions, theme"
88
repository: "https://github.com/txp666/lvgl-nav-kit"
99
license: "MIT"

include/lvgl_nav_kit/page_base.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,10 @@ class PageBase {
3030
protected:
3131
lv_timer_t *CreateTimer(lv_timer_cb_t cb, uint32_t period, void *user_data = nullptr);
3232
void DeleteAllTimers();
33-
private:
34-
void PauseAllTimers();
35-
void ResumeAllTimers();
36-
void DoEnter();
37-
void DoLeave();
3833
void AddEventHandler(lv_obj_t *obj, lv_event_cb_t cb, lv_event_code_t code, void *user_data = nullptr);
3934
static bool IsLargeScreen() { return LV_HOR_RES >= 720; }
4035
static int ScreenWidth() { return LV_HOR_RES; }
4136
static int ScreenHeight() { return LV_VER_RES; }
42-
/** Content area top offset from theme status_bar_height (0 = no bar). */
4337
int GetStatusBarHeight() const;
4438
lv_obj_t *CreateLabel(lv_obj_t *parent, const char *text);
4539
lv_obj_t *CreateButton(lv_obj_t *parent, const char *text, lv_event_cb_t cb, void *user_data = nullptr);
@@ -58,12 +52,15 @@ class PageBase {
5852
void ShowLoading(const char *text = "Loading...");
5953
void HideLoading();
6054
bool IsLoading() const { return loading_overlay_ != nullptr; }
61-
protected:
6255
lv_obj_t *container_ = nullptr;
6356
std::string id_;
6457
PageState state_ = PageState::Registered;
6558
lv_obj_t *loading_overlay_ = nullptr;
6659
private:
60+
void PauseAllTimers();
61+
void ResumeAllTimers();
62+
void DoEnter();
63+
void DoLeave();
6764
void DoCreate(lv_obj_t *parent, const ui_theme_t *theme);
6865
void DoDestroy();
6966
const ui_theme_t *theme_ = nullptr;

0 commit comments

Comments
 (0)