Commit graph

13 commits

Author SHA1 Message Date
Simon Willshire 2c75e7aad8 Dismiss notifications by swiping right
Add a new interface `NotificationManager::Dismiss(id)` to delete a
notification with the specified `id`.

The animate the notification dismiss the `RightAnim` transition to a
black screen is used. After the dismiss the new message is swiped in
from below or above.

If we dismiss the oldest message (when we are at 5/5, or 3/3), then the
new message after a dismiss should appear to come from below.

Otherwise (when we are at 2/3) the new message after a dismiss should
appear to come from above.

Rework the index code to show the index of the currently viewed
notification. Instead of calculating the index relative to the oldest
`id` introduce a new interface `NotificationManager::IndexOf(id)`. This
is done because the `id` of the notifications in the buffer aren't
continuous anymore (as some messages could have been dismissed).

Rework notification ring buffer to have a beginIdx and a size
internally to make the dismissal of notifications easier.

Fixes: https://github.com/InfiniTimeOrg/InfiniTime/issues/176

Co-authored-by: Simon Willshire <me@simonwillshire.com>
Co-authored-by: Reinhold Gschweicher <pyro4hell@gmail.com>
2022-06-28 18:50:10 +02:00
Reinhold Gschweicher ac7b2da611 Update includes to to be relative to src directory
Don't use relative imports like `../foo.h` as those depend on the
relative position of both files. Rather than that use imports relative
to the `src` directory, which explicitly is part of the include
directories.
2021-11-15 22:02:49 +01:00
Riku Isokoski 3ee4876214 Toggle notifications only, keep vibrations. 2021-09-12 11:08:25 +03:00
Avamander 40d45d923b Reformatted all the files according to clang-format style 2021-04-24 11:39:53 +03:00
Jean-François Milants 03de1c6739 Add support for notification title. The notification buffer must contain the title and the message separated by a '\0' character.
If the buffer does not contain any \0, the whole buffer is considered to be the message of the notification. A default title will be displayed in the notification app.
2021-04-04 12:10:47 +02:00
Jean-François Milants 5fdfb2112e Fix merge conflict. 2021-02-14 14:19:30 +01:00
petter 1e2cc3ce91 add vibration toggle 2021-02-07 13:31:02 +01:00
okaestne 1516573df4
Include cleanup: components 2020-11-16 01:35:45 +01:00
JF 07b6812f61 Notifications : Fix copy when the messages is spread across multiple os_mbuf. 2020-10-22 10:43:42 +02:00
JF cabf1168d4 Notifications : Fix display of notification index/number. 2020-10-21 22:15:02 +02:00
JF 440ae412b9 Increase max size of notification message to 100 char.
Fix bug in message handling that would ignore the last character of the notification.
2020-10-21 17:31:56 +02:00
JF ef5670c7e0 Integrate new notification UI with notifications coming from BLE 2020-10-20 20:57:39 +02:00
Avamander 6c86d1d9d7 Fixed all the includes that were broken due to the renames 2020-10-02 22:16:48 +03:00
Renamed from src/components/Ble/NotificationManager.cpp (Browse further)