-
-
Notifications
You must be signed in to change notification settings - Fork 955
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
Notification age (x minutes ago) on notifcation screen #835
Closed
clemensvonmolo
wants to merge
4
commits into
InfiniTimeOrg:main
from
clemensvonmolo:notification-time
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8466196
first try at adding notification age
clemensvonmolo 1de1d44
minor changes to notification age logic
clemensvonmolo a7e8139
Merge branch 'develop' into notification-time
clemensvonmolo afe96d5
fix outdated constructor call for NotificationItem
clemensvonmolo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,6 +4,8 @@ | |||||
#include <atomic> | ||||||
#include <cstddef> | ||||||
#include <cstdint> | ||||||
#include <chrono> | ||||||
#include "components/datetime/DateTimeController.h" | ||||||
|
||||||
namespace Pinetime { | ||||||
namespace Controllers { | ||||||
|
@@ -30,6 +32,7 @@ namespace Pinetime { | |||||
bool valid = false; | ||||||
uint8_t index; | ||||||
uint8_t size; | ||||||
std::time_t timeArrived; | ||||||
std::array<char, MessageSize + 1> message; | ||||||
Categories category = Categories::Unknown; | ||||||
|
||||||
|
@@ -38,6 +41,8 @@ namespace Pinetime { | |||||
}; | ||||||
Notification::Id nextId {0}; | ||||||
|
||||||
NotificationManager(Controllers::DateTime& dateTimeController) : dateTimeController {dateTimeController} { | ||||||
} | ||||||
void Push(Notification&& notif); | ||||||
Notification GetLastNotification(); | ||||||
Notification GetNext(Notification::Id id); | ||||||
|
@@ -51,6 +56,7 @@ namespace Pinetime { | |||||
size_t NbNotifications() const; | ||||||
|
||||||
private: | ||||||
Controllers::DateTime& dateTimeController; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can even store a
Suggested change
|
||||||
Notification::Id GetNextId(); | ||||||
static constexpr uint8_t TotalNbNotifications = 5; | ||||||
std::array<Notification, TotalNbNotifications> notifications; | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
we can even store a
const
reference, to make it explicit, that a notification can't change the date-time, just get the current date and timeThere 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.
At present it is not possible since DateTime controller updates it member variables during time retrieving.
InfiniTime/src/components/datetime/DateTimeController.cpp
Lines 72 to 102 in d69cfcf
It can be overcomed with
mutable
but I am not sure whether this is a good idea.