|
TinyMaterialDesign
|
Connects Pages with a NavigationBar: one destination per page, only the selected page is visible. All pages share the same bounds, so the screen itself never scrolls; each page scrolls on its own. More...
#include <Page.h>
Public Member Functions | |
| PageNavigator (Screen< RGB_T > &screen, NavigationBar< RGB_T > &nav) | |
| void | addPage (Page< RGB_T > &page) |
| Adds a page (before begin()). | |
| void | begin (Bounds pageBounds) |
| Adds the navigation bar (fixed) and the pages (with the indicated bounds) to the screen, builds the pages and shows the first one. | |
| void | show (int index) |
| Shows the page with the index. | |
| bool | tick (uint32_t nowMs) |
| Calls tick() of the visible page: true if it must be redrawn. | |
| int | current () const |
| int | count () const |
| Page< RGB_T > & | page (int index) |
| Page< RGB_T > & | currentPage () |
Public Attributes | |
| std::function< void(int index)> | onPageChanged |
| Called after the page was changed (by the user or show()). | |
Connects Pages with a NavigationBar: one destination per page, only the selected page is visible. All pages share the same bounds, so the screen itself never scrolls; each page scrolls on its own.
NavigationBar<RGB565> nav(Bounds(0, 264, 240, 56)); PageNavigator<RGB565> pages(app.screen(), nav); pages.addPage(clockPage); pages.addPage(settingsPage); pages.begin(Bounds(0, 40, 240, 224)); // adds nav + pages, builds them // loop(): if (pages.tick(millis())) app.screen().invalidate();
|
inline |
|
inline |
Adds the navigation bar (fixed) and the pages (with the indicated bounds) to the screen, builds the pages and shows the first one.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Shows the page with the index.
|
inline |
Calls tick() of the visible page: true if it must be redrawn.
| std::function<void(int index)> onPageChanged |
Called after the page was changed (by the user or show()).