{"id":19821663,"url":"https://github.com/lanfly/lvgl-pm","last_synced_at":"2025-05-01T12:31:15.233Z","repository":{"id":49379191,"uuid":"517531061","full_name":"LanFly/lvgl-pm","owner":"LanFly","description":"A simple page manager for LVGL.","archived":false,"fork":false,"pushed_at":"2022-10-28T09:19:44.000Z","size":24,"stargazers_count":41,"open_issues_count":2,"forks_count":9,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-19T04:01:06.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LanFly.png","metadata":{"files":{"readme":"README-en.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-25T05:35:11.000Z","updated_at":"2024-03-12T08:49:53.000Z","dependencies_parsed_at":"2023-01-20T09:22:35.080Z","dependency_job_id":null,"html_url":"https://github.com/LanFly/lvgl-pm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Flvgl-pm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Flvgl-pm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Flvgl-pm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LanFly%2Flvgl-pm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LanFly","download_url":"https://codeload.github.com/LanFly/lvgl-pm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224256983,"owners_count":17281635,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T10:29:51.931Z","updated_at":"2024-11-12T10:29:52.400Z","avatar_url":"https://github.com/LanFly.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LVGL-PM\n\n![version v0.1.1](https://img.shields.io/badge/version-v0.1.1-brightgreen)\n![license MIT](https://img.shields.io/badge/license-MIT-green)\n\n**[【中文文档】](./README.md)**\n\nA simple page manager for LVGL.\n\n## Features\n\nsimple and easy to use.\n\n- Page lifecycle management\n- Support transition animation\n\n## Example\n\n```c\n#include \"pm.h\"\n\nvoid main()\n{\n  lv_pm_init();\n\n  lv_pm_page_t *home = lv_pm_create_page(0);\n  page-\u003eonLoad = page_home_onLoad; // you should implement this function\n  page-\u003eunLoad = page_home_unLoad; // you should implement this function\n\n  lv_pm_open_page(0, NULL);\n}\n```\n\n## Write a page\n\n```c\n// home.c\n\n#include \"home.h\"\n\nvoid page_home_onLoad(lv_obj_t *page)\n{\n  lv_obj_t *label = lv_label_create(page);\n  lv_label_set_text(label, \"hello home page\");\n}\n\nvoid page_home_unLoad(lv_obj_t *page)\n{\n  // all children of page will be deleted automatically.\n}\n```\n\n## API\n\n**uint8_t lv_pm_init()**\n\nThis function muse be called before using LVGL-PM.\n\nreturn 0 is OK.\n\n**lv_pm_page_t \\*lv_pm_create_page(uint8_t id)**\n\nCreate a page and specify an ID. The ID is used for lv_pm_open_page API.\n\nThere are 2 lifecycle that must be registered:\n \n 1. onLoad\n 2. unLoad\n\n**uint8_t lv_pm_open_page(uint8_t id, lv_pm_open_options_t \\*behavior)**\n\nOpen the page according to the specified ID.\n\n\u003e Warning: A specified page ID can only be opened once at time. In the future version, we will support multi page instances.\n\n**uint8_t lv_pm_back()**\n\nClose the current page and display the previous page. Do nothing if there is only one page or nothing.\n\n## Lifecycle\n\n1. onLoad\n2. willAppear\n3. didAppear\n4. willDisappear\n5. didDisappear\n6. unLoad\n\n## buildin animation\n\n- LV_PM_ANIMA_NONE (support)\n- LV_PM_ANIMA_SLIDE (support)\n- LV_PM_ANIMA_SLIDE_SCALE (not yet)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanfly%2Flvgl-pm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanfly%2Flvgl-pm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanfly%2Flvgl-pm/lists"}