-
-
Notifications
You must be signed in to change notification settings - Fork 952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Up to date calendar app #1958
base: main
Are you sure you want to change the base?
Up to date calendar app #1958
Conversation
Build size and comparison to main:
|
I just saw the line: 'PRs are either rebase or squash merged' in https://github.com/InfiniTimeOrg/InfiniTime/blob/ecf2f564f7a0884b6acdfdf5530abe2b98cb9aa9/doc/maintainer-guide.md#reviewing-prs. I don't squash merges or rebase often so I'm not great at it, but I can try if this is required, just let me know! |
@JustScott the easiest way is to run In there it will give you instructions on how to use it:
Note: You might have issues doing the above, since I think the branch you sourced this from has the actual calendar implementation buried deep in the git history. I would start over with a clean branch off of |
@vkareh Okay I reset this PRs (local) branch to the latest upstream commit, then cherry picked code from @thnikk's & @Boteium's branches onto my branch (which helped me avoid some of the uneeded 'legacy' code, thanks for the suggestion!). Since I didn't bring along any of the prior commits from the other branches, and can just put all of my changes under a single commit now, doesn't that mean I don't need to do any squashing? |
a750e7a
to
c5d47d6
Compare
That's correct. The point of squashing is to merge multiple commits, which is no longer necessary in your case. I also agree with @FintasticMan about adding attribution. You can change the commit message using the same |
src/displayapp/screens/Calendar.cpp
Outdated
lv_calendar_set_showed_date(calendar, &today); | ||
|
||
// Use today's date as a reference for which month to show if moved | ||
current = today; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need different current
and today
variables? The app always opens with the current date in view, and the lv_calendar_set_today_date
never gets overridden (and also there's no refresh call). I think it would work the same if you used a single lv_calendar_date_t
variable.
src/displayapp/screens/Calendar.h
Outdated
private: | ||
bool OnTouchEvent(TouchEvents event); | ||
Controllers::DateTime& dateTimeController; | ||
lv_obj_t* label_time; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This label is not used anywhere
c5d47d6
to
ddb84dc
Compare
@vkareh I believe I addressed all the concerns above with this last commit. I also tested this on my pinetime and everything is working as expected. I'm also wondering what the thoughts on the ability to swipe up and down to increase and decrease the current year of the calendar are? I personally don't like this as it interferes with the user's ability swipe down to exit the app, but I'll leave it in if others want this capability. |
Awesome! You can still squash the new commit you made if you want to clean things up further. Not sure if it's necessary though.
I saw that and thought the same thing. It would certainly be useful, but interfering with the global swipe mechanics feels wrong. You would need to use the button to exit, so it's a tradeoff between fuctionality and consistency. I would leave it up to the repo maintainers to determine that. |
@vkareh I figured I'd wait until this was ready to be merged to the main branch to squash the commits so the maintainers can more clearly see what's changed. Also, I appreciate all the help you've given me with rebase commands above! |
94d384e
to
df96d81
Compare
src/displayapp/screens/Calendar.cpp
Outdated
lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); | ||
|
||
// Set style of inactive month's days | ||
lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a color from the InfiniTime theme here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can replace the red with Colors::deepOrange
, but Colors::lightGray
doesn't look quite right. Would it be alright if I added something like static constexpr lv_color_t gray = LV_COLOR_MAKE(0x50, 0x50, 0x50);
to the Colors
namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me
820d6bb
to
791952f
Compare
791952f
to
590e6f6
Compare
Very nice app, I am personally a fan of the original implementation from #923 in which the calendar was placed to the right of the clock. I have found as I add more applications to infinitime its really nice to be able to access the calendar so simply. I'd personally like it as a default, however it might be a better option for a future pull request to customize the location of the launcher, setting and notification gestures too. swipecal_webm.mp4I find it also feels a bit more natural for the vertical swiping with this setup as its closer to a traditional calendar. |
590e6f6
to
67de7dc
Compare
67de7dc
to
577dfd5
Compare
577dfd5
to
1f5c0b6
Compare
A basic calendar app that shows all the days dates in the current month along with the correlating week days, highlights the current day, and allows swiping left and right to increase and decrease the current month by one. Co-authored-by: thnikk <[email protected]> Co-authored-by: Boteium <[email protected]>
1f5c0b6
to
e374a77
Compare
This calendar app was originally created by @thnikk in pull request #923, then was updated in June of 2023 by @Boteium to work with the most recent Infinitime version at that time. In the most recent version of Infinitime, 1.14 in January of 2024 (now), the way apps are handled has changed, so in this PR I've updated the code to work with those changes and to be able to be merged into version 1.14 of Infinitime. I've tested the pinetime-mcboot-app version on my sealed Pinetime and have yet to find and issue with it.
Also, I commented out the swipe up and down to increase and decrease the current calendar year feature as that interfered with the swipe down to exit ability users have come to expect when navigating apps... feel free to uncomment the code if you'd like that feature to stay.