GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Adds page indicator to music app by SteveAmor · Pull Request #1875 · InfiniTimeOrg/InfiniTime Conversation
Contributor
Fixes #1391
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
There was an error while loading. Please reload this page.
|
Build size and comparison to main:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I imagine it could look a little better with a little margin around the buttons. What do you think? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The page indicator is 2px wide. For comparison, here are the buttons moved 2px |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I like the first image where the bar is not touching the button. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
PR updated to move the buttons 3px. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I experimented with hiding or deleting the page indicator object when you switch pages. According to the simulator, hiding the object used more lvgl memory than deleting and creating. So I went with deleting. I guess it used more memory as you actually had more objects at any one time, with one of them hidden. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b3b9a27 to
72bc736
Compare
Just thinking, would it make more sense to have a |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
12637b1 to
90601f6
Compare
There was an error while loading. Please reload this page.
|
I remember now. Music.cpp doesn't have more than one page. It has a single page and hides/unhides buttons to make it look like two pages. This is the reason I went down this route. Perhaps the best thing to do (which is what I did originally) is to hide and unhide two page indicators? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I think that already exists: PageIndicator(uint8_t nCurrentScreen, uint8_t nScreens) But won't work for Music.cpp single page with hidden buttons for the "second page". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
What I'm suggesting is a new method for PageIndicator that tears down the existing one and redraws at a different position. This way you'd only have one page indicator as a member of the app and you could do |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mark9064 hopefully this implementation of SetCurrentScreen is what you had in mind? Please let me know :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Inside it, LVGL objects are created and dropped. Is that a good idea? Would it be better to create a function |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I'm certainly no expert but having looked at the pageindicator code, I can't see an easy way to update some of the properties. If not all of them. Any guidance would be much appreciated. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Well I think the current implementation is pretty fine But if you wanted to be more efficient, pull out const int16_t indicatorSize = LV_VER_RES / nScreens; const int16_t indicatorPos = indicatorSize * nCurrentScreen; pageIndicatorPoints[0].x = LV_HOR_RES - 1; pageIndicatorPoints[0].y = indicatorPos; pageIndicatorPoints[1].x = LV_HOR_RES - 1; pageIndicatorPoints[1].y = indicatorPos + indicatorSize; lv_line_set_points(pageIndicator, pageIndicatorPoints, 2); to a different method (eg This works as you can leave the background stripe, and only want to move the highlight (current position indicator) stripe. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
9cfe584 to
2ac8a00
Compare
2ac8a00 to
d7370ab
Compare
All done :-) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
If you move pageIndicator = lv_line_create(lv_scr_act(), nullptr); lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3); lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray); to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
My bad, I should have noticed that in your earlier message. This (hopefully final) commit is the most efficient in terms of additional program memory required and it certainly (looks to me) cleaner than previous commits. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@mark9064 could you please double check that I have declared everything that I need to, correctly, in PageIndicator.h |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
All LGTM :)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Would be superseded by #2337 if merged |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I would argue that we still merge this, because it's ready and easy to do. And then we discuss your version 2 on top of that. Do you agree, @mark9064? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Yep, sounds good to me. Once this has a second review I'm happy to merge :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Add Scroll Bar to the Music App
There was an error while loading. Please reload this page.