Skip to content

Update Calendar based on timer#12

Merged
SCratORS merged 1 commit intoSCratORS:mainfrom
Doctoror:calendar-update
Feb 5, 2024
Merged

Update Calendar based on timer#12
SCratORS merged 1 commit intoSCratORS:mainfrom
Doctoror:calendar-update

Conversation

@Doctoror
Copy link
Copy Markdown
Contributor

@Doctoror Doctoror commented Feb 5, 2024

Counting frames to update Calendar is not reliable in case the display is turned off. When you turn off display at night and turn on in the morning, Calendar will be outdated until 800 frames since last update finish.

Instead, use time-based approach. Querying SystemClock.uptimeMillis is much cheaper than recalculating Calendar fields on every frame.

Counting frames to update Calendar is not reliable in case the display
is turned off. When you turn off display at night and turn on in the
morning, Calendar will be outdated until 800 frames since last update
finish.

Instead, use time-based approach. Querying SystemClock.uptimeMillis is
much cheaper than recalculating Calendar fields on every frame.
@SCratORS SCratORS merged commit 712a0a4 into SCratORS:main Feb 5, 2024
@SCratORS
Copy link
Copy Markdown
Owner

SCratORS commented Feb 5, 2024

I also added a forced calendar update on onResume earlier here

@Doctoror Doctoror deleted the calendar-update branch February 5, 2024 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants