Skip to content
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

[GSoC] Implemented New notification preference UI #12635

Conversation

prateek-singh-3212
Copy link
Member

@prateek-singh-3212 prateek-singh-3212 commented Oct 13, 2022

Pull Request template

Purpose / Description

The user is not able to manage the notification preference easily and we have to provide an additional feature to the notification System and make notification system bug free.
GSoC Proposal: https://docs.google.com/document/d/1ezQsKJxXm_-q4d5Kpafb5WHKuy3hApcPo0RXO7BULIc/edit?usp=drivesdk

WhatsApp.Video.2022-10-13.at.9.22.32.AM.mp4

Fixes

Issue: #4944

Approach

I have implemented a new notification preference UI to manage all notification settings related to a single deck in one place

How Has This Been Tested?

Tested on Samsung M52

Note: Please ignore the first 2 commits as they are part of PR: #12234

Checklist

Please, go through these checks before submitting the PR.

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

prateek-singh-3212 and others added 3 commits September 27, 2022 13:48
Notification preference datastore is used to store all the data related to notification in the preference datastore.
NotificationPreferenceAdapter is used to display list of decks for notification preference.
@github-actions
Copy link
Contributor

Message to maintainers, this PR contains strings changes.

  1. Before merging this PR, it is best to run the "Sync Translations" GitHub action, then make and merge a PR from the i18n_sync branch to get translations cleaned out.
  2. Then merge this PR, and immediately do another translation PR so the huge change made by this PR's key changes are all by themselves.

Read more about updating strings on the wiki,

@david-allison
Copy link
Member

This doesn't build.

Could you please re-link the video or screenshots, they're mentioned in the PR header, but I don't see them

@BrayanDSO BrayanDSO added the Needs Author Reply Waiting for a reply from the original author label Oct 13, 2022
@prateek-singh-3212
Copy link
Member Author

This doesn't build.

The build is failing because of Timepicker 'currentHour' method is depricated above API 23. but I was unable to find the correct replacement for that...

@prateek-singh-3212 prateek-singh-3212 removed the Needs Author Reply Waiting for a reply from the original author label Oct 13, 2022
@david-allison
Copy link
Member

Screenshot 2022-10-13 at 20 13 26

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Oct 13, 2022
@david-allison
Copy link
Member

david-allison commented Oct 13, 2022

Move the property to our Compat infrastructure and handle it there

@prateek-singh-3212 prateek-singh-3212 force-pushed the Deck_Notification_UI branch 2 times, most recently from 74b86bc to 254fca5 Compare October 17, 2022 04:51
New Notification Preference will show the list of decks as per my GSoC Proposal and dissucced on issue (ankidroid#4944)
@prateek-singh-3212
Copy link
Member Author

@ankidroid/gsoc-mentor I implemented the complete system. You can check this branch BRANCH

I am attaching the video of the same. The timezone change is also working (Please let me know If you want me to add a timezone change video too)

sa.mp4

NOTE: use this tag package:com.ichi2.anki notification to view logs

  1. Logs when I added the @r$ Biology ANIMAL KINGDOM for notification
2022-10-23 12:38:27.627 21659-21892 Notificati...tification com.ichi2.anki                       D  CreateScheduledDeckNotification-> did: 1659703391318 hour: 12 min: 40
2022-10-23 12:38:27.629 21659-21892 NotificationHelper      com.ichi2.anki                       D  Scheduled time is not yet passed.
2022-10-23 12:38:27.629 21659-21892 NotificationHelper      com.ichi2.anki                       D  Creating new time deck data 
2022-10-23 12:38:27.726 21659-22366 Notificati...tification com.ichi2.anki                       D  Next trigger time 1666509027628
2022-10-23 12:38:27.726 21659-22366 NotificationHelper      com.ichi2.anki                       D  Starting work manager with initial delay 119902 force: true
  1. Logs when I added the Biology for notification.
2022-10-23 12:38:40.570 21659-22366 Notificati...tification com.ichi2.anki                       D  CreateScheduledDeckNotification-> did: 1665512292295 hour: 12 min: 39
2022-10-23 12:38:40.586 21659-22366 NotificationHelper      com.ichi2.anki                       D  Scheduled time is not yet passed.
2022-10-23 12:38:40.586 21659-22366 NotificationHelper      com.ichi2.anki                       D  Scheduled time will come today only. And it will come before the current scheduled deck.
2022-10-23 12:38:40.591 21659-21892 Notificati...tification com.ichi2.anki                       D  Next trigger time 1666508980586
2022-10-23 12:38:40.591 21659-21892 NotificationHelper      com.ichi2.anki                       D  Starting work manager with initial delay 59995 force: true
  1. Logs when System is triggering the notification for Biology
2022-10-23 12:39:40.605 21659-22366 NotificationWorker      com.ichi2.anki                       D  NotificationManagerWorker: Worker status -> STARTED
2022-10-23 12:39:40.686 21659-22366 NotificationWorker      com.ichi2.anki                       D  Processing single deck notification...
2022-10-23 12:39:40.692 21659-22366 NotificationWorker      com.ichi2.anki                       D  top decks: [@r$     Biology          ANIMAL KINGDOM, 1659703391318, 0, 0, 20, [], Biology, 1665512292295, 0, 0, 20, [Biology::01: Characteristics and classification, 1665512292296, 0, 0, 18, [], Biology::02: Organisation of the organism, 1665512292299, 0, 0, 14, [], Biology::03: Movement in and out of cells, 1665512292302, 0, 0, 14, [], Biology::04: Biological molecules, 1665512292306, 0, 0, 19, [], Biology::05: Enzymes, 1665512292310, 0, 0, 9, [], Biology::06: Plant nutrition, 1665512292312, 0, 0, 15, [], Biology::07: Human nutrition, 1665512292316, 0, 0, 20, [], Biology::08: Transport in plants, 1665512292326, 0, 0, 16, [], Biology::09: Transport in animals, 1665512292331, 0, 0, 20, [], Biology::10: Diseases and immunity, 1665512292342, 0, 0, 18, [], Biology::11: Gas exchange in humans, 1665512292346, 0, 0, 20, [], Biology::12: Respiration, 1665512292352, 0, 0, 12, [], Biology::13: Excretion in humans, 1665512292355, 0, 0, 20, [], Biology::14: Coordination and response, 1665512292361, 0, 0, 20, [], Biology::15: Drugs, 1665512292375, 0, 0, 18, [], Biology::16: Reproduction, 1665512292379, 0, 0, 20, [], Biology::17: Inheritance, 1665512292392, 0, 0, 20, [], Biology::18: Variation and selection, 1665512292397, 0, 0, 19, [], Biology::19: Organisms and their environment, 1665512292401, 0, 0, 20, [], Biology::20: Biotechnology and genetic engineering, 1665512292409, 0, 0, 9, [], Biology::21: Human influences on ecosystems, 1665512292411, 0, 0, 20, []], Biology::01: Characteristics and classification, 1665512292296, 0, 0, 18, [], Biology::02: Organisation of the organism, 1665512292299, 0, 0, 14, [], Biology::03: Movement in and out of cells, 1665512292302, 0, 0, 14, [], Biology::04: Biological molecules, 1665512292306, 0, 0, 19, [], Biology::05: Enzymes, 1665512292310, 0, 0, 9, [], Biology::06: Plant nutrition, 1665512292312, 0, 0, 15, [], Biology::07: Human nutrition, 1665512292316, 0, 0, 20, [], Biology::08: Transport in plants, 1665512292326, 0, 0, 16, [], Biology::09: Transport in animals, 1665512292331, 0, 0, 20, [], Biology::10: Diseases and immunity, 1665512292342, 0, 0, 18, [], Biology::11: Gas exchange in humans, 1665512292346, 0, 0, 20, [], Biology::12: Respiration, 1665512292352, 0, 0, 12, [], Biology::13: Excretion in humans, 1665512292355, 0, 0, 20, [], Biology::14: Coordination and response, 1665512292361, 0, 0, 20, [], Biology::15: Drugs, 1665512292375, 0, 0, 18, [], Biology::16: Reproduction, 1665512292379, 0, 0, 20, [], Biology::17: Inheritance, 1665512292392, 0, 0, 20, [], Biology::18: Variation and selection, 1665512292397, 0, 0, 19, [], Biology::19: Organisms and their environment, 1665512292401, 0, 0, 20, [], Biology::20: Biotechnology and genetic engineering, 1665512292409, 0, 0, 9, [], Biology::21: Human influences on ecosystems, 1665512292411, 0, 0, 20, [], Default, 1, 0, 0, 0, [], Kieler Basisdeck Medizin, 1664979398946, 0, 3, 20, [], Math, 1664979441850, 4, 1, 20, [Math::Derivative, 1664979441866, 0, 0, 18, [], Math::Integration, 1664979441851, 4, 0, 20, [Math::Integration::StandartIntegration, 1664979441852, 0, 0, 15, [], Math::Integration::Trig-1, 1664979441858, 4, 0, 0, [], Math::Integration::Trig-2, 1664979441862, 0, 0, 10, []], Math::Trigonometry, 1664979441873, 0, 1, 20, [Math::Trigonometry::AngleTransf., 1664979441874, 0, 1, 7, [], Math::Trigonometry::General, 1664979441878, 0, 0, 8, [], Math::Trigonometry::HalfDoubleAngles, 1664979441881, 0, 0, 8, [], Math::Trigonometry::Product, 1664979441885, 0, 0, 6, [], Math::Trigonometry::Sum-1, 1664979441888, 0, 0, 8, [], Math::Trigonometry::Sum-2, 1664979441891, 0, 0, 8, []]], Math::Derivative, 1664979441866, 0, 0, 18, [], Math::Integration, 1664979441851, 4, 0, 20, [Math::Integration::StandartIntegration, 1664979441852, 0, 0, 15, [], Math::Integration::Trig-1, 1664979441858, 4, 0, 0, [], Math::Integration::Trig-2, 1664979441862, 0, 0, 10, []], Math::Integration::StandartIntegration, 1664979441852, 0, 0, 15, [], Math::Integration::Trig-1, 1664979441858, 4, 
2022-10-23 12:39:40.693 21659-22366 NotificationWorker      com.ichi2.anki                       D  0, 0, [], Math::Integration::Trig-2, 1664979441862, 0, 0, 10, [], Math::Trigonometry, 1664979441873, 0, 1, 20, [Math::Trigonometry::AngleTransf., 1664979441874, 0, 1, 7, [], Math::Trigonometry::General, 1664979441878, 0, 0, 8, [], Math::Trigonometry::HalfDoubleAngles, 1664979441881, 0, 0, 8, [], Math::Trigonometry::Product, 1664979441885, 0, 0, 6, [], Math::Trigonometry::Sum-1, 1664979441888, 0, 0, 8, [], Math::Trigonometry::Sum-2, 1664979441891, 0, 0, 8, []], Math::Trigonometry::AngleTransf., 1664979441874, 0, 1, 7, [], Math::Trigonometry::General, 1664979441878, 0, 0, 8, [], Math::Trigonometry::HalfDoubleAngles, 1664979441881, 0, 0, 8, [], Math::Trigonometry::Product, 1664979441885, 0, 0, 6, [], Math::Trigonometry::Sum-1, 1664979441888, 0, 0, 8, [], Math::Trigonometry::Sum-2, 1664979441891, 0, 0, 8, []] 
2022-10-23 12:39:40.693 21659-22366 NotificationWorker      com.ichi2.anki                       D   deckIds: [1665512292295] 
2022-10-23 12:39:40.693 21659-22366 NotificationWorker      com.ichi2.anki                       D   deckNotification: [Biology, 1665512292295, 0, 0, 20, [Biology::01: Characteristics and classification, 1665512292296, 0, 0, 18, [], Biology::02: Organisation of the organism, 1665512292299, 0, 0, 14, [], Biology::03: Movement in and out of cells, 1665512292302, 0, 0, 14, [], Biology::04: Biological molecules, 1665512292306, 0, 0, 19, [], Biology::05: Enzymes, 1665512292310, 0, 0, 9, [], Biology::06: Plant nutrition, 1665512292312, 0, 0, 15, [], Biology::07: Human nutrition, 1665512292316, 0, 0, 20, [], Biology::08: Transport in plants, 1665512292326, 0, 0, 16, [], Biology::09: Transport in animals, 1665512292331, 0, 0, 20, [], Biology::10: Diseases and immunity, 1665512292342, 0, 0, 18, [], Biology::11: Gas exchange in humans, 1665512292346, 0, 0, 20, [], Biology::12: Respiration, 1665512292352, 0, 0, 12, [], Biology::13: Excretion in humans, 1665512292355, 0, 0, 20, [], Biology::14: Coordination and response, 1665512292361, 0, 0, 20, [], Biology::15: Drugs, 1665512292375, 0, 0, 18, [], Biology::16: Reproduction, 1665512292379, 0, 0, 20, [], Biology::17: Inheritance, 1665512292392, 0, 0, 20, [], Biology::18: Variation and selection, 1665512292397, 0, 0, 19, [], Biology::19: Organisms and their environment, 1665512292401, 0, 0, 20, [], Biology::20: Biotechnology and genetic engineering, 1665512292409, 0, 0, 9, [], Biology::21: Human influences on ecosystems, 1665512292411, 0, 0, 20, []]]
2022-10-23 12:39:40.693 21659-22366 NotificationWorker      com.ichi2.anki                       D  Firing deck notification for did -> 1665512292295
2022-10-23 12:39:40.707 21659-22366 NotificationWorker      com.ichi2.anki                       D  Firing all deck notification.
2022-10-23 12:39:40.710 21659-22366 NotificationWorker      com.ichi2.anki                       D  NotificationManagerWorker: Worker status -> FINISHED
2022-10-23 12:39:40.710 21659-22366 NotificationWorker      com.ichi2.anki                       D  Task Completed. Rescheduling...
2022-10-23 12:39:40.711 21659-22366 NotificationWorker      com.ichi2.anki                       D  Next trigger time 1666509027628 Initial Difference 46917
2022-10-23 12:39:40.711 21659-22366 NotificationHelper      com.ichi2.anki                       D  Starting work manager with initial delay 46917 force: true

4 Logs when System is triggering the notification for @r$ Biology ANIMAL KINGDOM

2022-10-23 12:40:27.654 21659-22366 NotificationWorker      com.ichi2.anki                       D  NotificationManagerWorker: Worker status -> STARTED
2022-10-23 12:40:27.726 21659-22366 NotificationWorker      com.ichi2.anki                       D  Processing single deck notification...
2022-10-23 12:40:27.731 21659-22366 NotificationWorker      com.ichi2.anki                       D  top decks: [@r$     Biology          ANIMAL KINGDOM, 1659703391318, 0, 0, 20, [], Biology, 1665512292295, 0, 0, 20, [Biology::01: Characteristics and classification, 1665512292296, 0, 0, 18, [], Biology::02: Organisation of the organism, 1665512292299, 0, 0, 14, [], Biology::03: Movement in and out of cells, 1665512292302, 0, 0, 14, [], Biology::04: Biological molecules, 1665512292306, 0, 0, 19, [], Biology::05: Enzymes, 1665512292310, 0, 0, 9, [], Biology::06: Plant nutrition, 1665512292312, 0, 0, 15, [], Biology::07: Human nutrition, 1665512292316, 0, 0, 20, [], Biology::08: Transport in plants, 1665512292326, 0, 0, 16, [], Biology::09: Transport in animals, 1665512292331, 0, 0, 20, [], Biology::10: Diseases and immunity, 1665512292342, 0, 0, 18, [], Biology::11: Gas exchange in humans, 1665512292346, 0, 0, 20, [], Biology::12: Respiration, 1665512292352, 0, 0, 12, [], Biology::13: Excretion in humans, 1665512292355, 0, 0, 20, [], Biology::14: Coordination and response, 1665512292361, 0, 0, 20, [], Biology::15: Drugs, 1665512292375, 0, 0, 18, [], Biology::16: Reproduction, 1665512292379, 0, 0, 20, [], Biology::17: Inheritance, 1665512292392, 0, 0, 20, [], Biology::18: Variation and selection, 1665512292397, 0, 0, 19, [], Biology::19: Organisms and their environment, 1665512292401, 0, 0, 20, [], Biology::20: Biotechnology and genetic engineering, 1665512292409, 0, 0, 9, [], Biology::21: Human influences on ecosystems, 1665512292411, 0, 0, 20, []], Biology::01: Characteristics and classification, 1665512292296, 0, 0, 18, [], Biology::02: Organisation of the organism, 1665512292299, 0, 0, 14, [], Biology::03: Movement in and out of cells, 1665512292302, 0, 0, 14, [], Biology::04: Biological molecules, 1665512292306, 0, 0, 19, [], Biology::05: Enzymes, 1665512292310, 0, 0, 9, [], Biology::06: Plant nutrition, 1665512292312, 0, 0, 15, [], Biology::07: Human nutrition, 1665512292316, 0, 0, 20, [], Biology::08: Transport in plants, 1665512292326, 0, 0, 16, [], Biology::09: Transport in animals, 1665512292331, 0, 0, 20, [], Biology::10: Diseases and immunity, 1665512292342, 0, 0, 18, [], Biology::11: Gas exchange in humans, 1665512292346, 0, 0, 20, [], Biology::12: Respiration, 1665512292352, 0, 0, 12, [], Biology::13: Excretion in humans, 1665512292355, 0, 0, 20, [], Biology::14: Coordination and response, 1665512292361, 0, 0, 20, [], Biology::15: Drugs, 1665512292375, 0, 0, 18, [], Biology::16: Reproduction, 1665512292379, 0, 0, 20, [], Biology::17: Inheritance, 1665512292392, 0, 0, 20, [], Biology::18: Variation and selection, 1665512292397, 0, 0, 19, [], Biology::19: Organisms and their environment, 1665512292401, 0, 0, 20, [], Biology::20: Biotechnology and genetic engineering, 1665512292409, 0, 0, 9, [], Biology::21: Human influences on ecosystems, 1665512292411, 0, 0, 20, [], Default, 1, 0, 0, 0, [], Kieler Basisdeck Medizin, 1664979398946, 0, 3, 20, [], Math, 1664979441850, 4, 1, 20, [Math::Derivative, 1664979441866, 0, 0, 18, [], Math::Integration, 1664979441851, 4, 0, 20, [Math::Integration::StandartIntegration, 1664979441852, 0, 0, 15, [], Math::Integration::Trig-1, 1664979441858, 4, 0, 0, [], Math::Integration::Trig-2, 1664979441862, 0, 0, 10, []], Math::Trigonometry, 1664979441873, 0, 1, 20, [Math::Trigonometry::AngleTransf., 1664979441874, 0, 1, 7, [], Math::Trigonometry::General, 1664979441878, 0, 0, 8, [], Math::Trigonometry::HalfDoubleAngles, 1664979441881, 0, 0, 8, [], Math::Trigonometry::Product, 1664979441885, 0, 0, 6, [], Math::Trigonometry::Sum-1, 1664979441888, 0, 0, 8, [], Math::Trigonometry::Sum-2, 1664979441891, 0, 0, 8, []]], Math::Derivative, 1664979441866, 0, 0, 18, [], Math::Integration, 1664979441851, 4, 0, 20, [Math::Integration::StandartIntegration, 1664979441852, 0, 0, 15, [], Math::Integration::Trig-1, 1664979441858, 4, 0, 0, [], Math::Integration::Trig-2, 1664979441862, 0, 0, 10, []], Math::Integration::StandartIntegration, 1664979441852, 0, 0, 15, [], Math::Integration::Trig-1, 1664979441858, 4, 
2022-10-23 12:40:27.731 21659-22366 NotificationWorker      com.ichi2.anki                       D  0, 0, [], Math::Integration::Trig-2, 1664979441862, 0, 0, 10, [], Math::Trigonometry, 1664979441873, 0, 1, 20, [Math::Trigonometry::AngleTransf., 1664979441874, 0, 1, 7, [], Math::Trigonometry::General, 1664979441878, 0, 0, 8, [], Math::Trigonometry::HalfDoubleAngles, 1664979441881, 0, 0, 8, [], Math::Trigonometry::Product, 1664979441885, 0, 0, 6, [], Math::Trigonometry::Sum-1, 1664979441888, 0, 0, 8, [], Math::Trigonometry::Sum-2, 1664979441891, 0, 0, 8, []], Math::Trigonometry::AngleTransf., 1664979441874, 0, 1, 7, [], Math::Trigonometry::General, 1664979441878, 0, 0, 8, [], Math::Trigonometry::HalfDoubleAngles, 1664979441881, 0, 0, 8, [], Math::Trigonometry::Product, 1664979441885, 0, 0, 6, [], Math::Trigonometry::Sum-1, 1664979441888, 0, 0, 8, [], Math::Trigonometry::Sum-2, 1664979441891, 0, 0, 8, []] 
2022-10-23 12:40:27.731 21659-22366 NotificationWorker      com.ichi2.anki                       D   deckIds: [1659703391318] 
2022-10-23 12:40:27.731 21659-22366 NotificationWorker      com.ichi2.anki                       D   deckNotification: [@r$     Biology          ANIMAL KINGDOM, 1659703391318, 0, 0, 20, []]
2022-10-23 12:40:27.731 21659-22366 NotificationWorker      com.ichi2.anki                       D  Firing deck notification for did -> 1659703391318
2022-10-23 12:40:27.744 21659-22367 NotificationWorker      com.ichi2.anki                       D  Firing all deck notification.
2022-10-23 12:40:27.756 21659-22367 NotificationWorker      com.ichi2.anki                       D  NotificationManagerWorker: Worker status -> FINISHED
2022-10-23 12:40:27.756 21659-22367 NotificationWorker      com.ichi2.anki                       D  Task Completed. Rescheduling...
2022-10-23 12:40:27.758 21659-22367 NotificationWorker      com.ichi2.anki                       D  Next trigger time 1666512627758 Initial Difference 3600000
2022-10-23 12:40:27.758 21659-22367 NotificationHelper      com.ichi2.anki                       D  Starting work manager with initial delay 3600000 force: true

This is the system which is built so far. Please let me know the additional thinks which should be added in the basic notification system i.e things required in the first relase.

Copy link
Contributor

@oakkitten oakkitten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had a chance to run the code yet, so I'm not commenting on the behavior or design here. The code has some major issues, and I think parts of this PR are overengineered (too complicated when a simpler solution is possible). I suggest not serializing, and also removing most of async stuff or at least limiting it a few isolated spaced.

import com.ichi2.libanki.Decks

/**
* Notification details of particular deck.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment isn't very helpful

/**
* Notification details of particular deck.
* */
data class DeckNotification(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer the name to reflect that this is about reminding to study. It's hard to give this an exact name but maybe something like RemindToStudy. Also I'd ditch enabled and rely on presence or absence of instances of this class.

Also, a matter of personal preference, I'd say deckId. In my opinion, did is a mistake not worth following.

) {

// Empty constructor. Required for jackson to serialize.
constructor() : this(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is way too simple to serialize.

Serialization is fine for possibly complex objects such as encryption keys, or for objects that aren't supposed to be long-lived. Serialization is nice until you need to change how you store your data, or until some weird thing changes and you can't deserialize. For preferences, especially in such simple cases like this, I'd strongly prefer something more manual. E.g. just encode all of enabled decks and their times in a string.

Also, why jackson istead of kotlinx.serialization?

* @param started Day on which deck started.
* @param completed Deck is done for the day or not.
* */
data class UserNotificationPreference(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea what this entire class is about.

/*
* We use TimeOfNotification as key of json object. So it must be string.
*/
typealias TimeOfNotification = String
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need a new type? Epoch milliseconds should be simply a Long, or EpochMillis if you wish.

Also, surely jackson can deal with non-string keys? kotlinx does it via storing maps as lists.

Also, when I hear “time of notification” I think of stuff like "HH:MM". This is clearly not it.

}

// Save Deck Notification
private fun saveDeckNotification(notification: DeckNotification) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename this method after renaming DeckNotification

P.S. Another useful comment right here ↑

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @oakkitten.

First, thanks for the review. Generally a lot of good point. And especially when creating a new system, it's clearly a good idea to have it right on first try. Or maybe second try, given that we are replacing the legacy notification system that does not work properly.

However, I would require you to please abstain from this kind of derisory comments (here and above). I double-checked with other reviewer, and we agree it's not the kind of tone we would want in review.
I agree that the comment here is not useful, and that it's repeating the function name. No problem at all with a request to remove it (or at least improve it), and potentially an explanation of why you want this change. But we would like to really keep being welcoming and helping contributors grow as developer, and I feel like this PS is not going in the right direction. Admittedly, the limit of what is welcoming is hard to know, since, for example, the cat picture could also be a nice joke when it is sent to someone you already know well and appreciate this kind of teasing. However, I'd just state that in doubt, I'd prefer in this repo that we keep on constructive comments.

(And I'm explicitly trying here an example of what I request. Still trying to be welcoming by acknowledging the work, the good intentation, the point I agree with, and explaining - or at least trying to - the request I'm making)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant absolutely no derision. I see how, if reading it in isolation, there could be a chance that it could be taken as such, but do you really think that that I wanted to ridicule anyone given the overall tone of my comments?...

} else {
UIUtils.showThemedToast(
context,
"Unable to save, Please Retry",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what circumstances should this fail? If it's disk space, does AnkiDroid survive full disk in the first place? If not, I suggest just crashing

fun onDialogueDismiss(position: Int)
}

// Delete Deck Notification
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello stray comment, are you lost?

@@ -436,4 +436,8 @@
<string name="toggle_browser_mode_help">Toggle Showing cards or notes in the browser</string>
<string name="truncate_content_help">Truncate the height of each row of the Browser to show only first 3 lines of content</string>
<string name="browser_options_dialog_heading">Browser Options</string>

<string name="notification_sheet_subdeck">Include Sub Deck</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a user, I'm not sure what exactly this means.

Also, I Suggest Using Sentence Capitalization Because This Is Not A Song Title.

@@ -436,4 +436,8 @@
<string name="toggle_browser_mode_help">Toggle Showing cards or notes in the browser</string>
<string name="truncate_content_help">Truncate the height of each row of the Browser to show only first 3 lines of content</string>
<string name="browser_options_dialog_heading">Browser Options</string>

<string name="notification_sheet_subdeck">Include Sub Deck</string>
<string name="notification_sheet_sticky">Sticky Notification</string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a user, I don't know what's a sticky notification. As a dev, I'm not sure if this complexity is worth it.

@prateek-singh-3212
Copy link
Member Author

Thanks, @oakkitten for reviewing this PR. I will do these UI changes shortly. Actually, the feature that we want to provide to the user is not yet decided completely. I will do all the implementation changes that you requested and once the feature is decided then I will write this as production ready.
I created this PR now because I want maintainers to review my approach on which UI is built. Thanks for suggesting it I will do the changes. And feel free to tell me the other approaches (if there is any)

@oakkitten oakkitten mentioned this pull request Oct 31, 2022
5 tasks
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2023

Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Jan 2, 2023
@github-actions github-actions bot closed this Jan 9, 2023
@prateek-singh-3212 prateek-singh-3212 marked this pull request as draft April 15, 2023 15:13
@github-actions github-actions bot removed the Stale label Apr 15, 2023
@github-actions
Copy link
Contributor

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@BrayanDSO
Copy link
Member

Codebase changed a lot since this PR was opened, and looks abandoned. It's best to create another one if work is restarted

@BrayanDSO BrayanDSO closed this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Author Reply Waiting for a reply from the original author Needs Review Review High Priority Request for high priority review Strings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants