Closed danielepintore closed 3 months ago
Hi, first of all thank you for your contribution. Can you explain to me the use case. Is this an accessibility feature? One remark regarding your code. I usually try avoid the use of singletons. I would prefer that the user preference must be provided as input to the vibrate method.
No i didn't think that as an accessibility feature, while i was using the app i thought if i could disable the haptic feedback because i didn't like. Just a mere preference. For example when you are "zapping" some songs in the library it's not handy to me have the phone vibrate each time, it become kinda awkward. Instead for the singletons, if you like the idea of adding this feature i can fix that, just let me know.
OK, this makes sense. If you adjust the two code comments, it is ready for merge.
Ok, I've made the changes. I've also refactored the Haptics file because i noticed that was double indented, now everything should be fine.
I renamed "Display" to "Display & Interaction" and moved the haptic feedback into this new section. I added a description too.
Hi, I've added an toggle in the settings to disable haptic feedback in the app. Now the haptic feedback is managed via the
Haptic
enum, this allows to check for the user preference so we don't need to check every time.The usage of the Haptic enum is pretty simple, for example:
Haptics.FEEDBACK_TYPE.vibrate()
WhereFEEDBACK_TYPE
is the type of feedback we wantI couldn't test this in a real device so please if you can give it a check