BLeeEZ / amperfy

Amperfy is an iOS/iPadOS/macOS app to play songs from an Ampache or Subsonic server
GNU General Public License v3.0
458 stars 37 forks source link

HapticFeedback: can be disabled in settings #271

Closed danielepintore closed 3 months ago

danielepintore commented 3 months ago

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() Where FEEDBACK_TYPE is the type of feedback we want

I couldn't test this in a real device so please if you can give it a check

BLeeEZ commented 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.

danielepintore commented 3 months ago

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.

BLeeEZ commented 3 months ago

OK, this makes sense. If you adjust the two code comments, it is ready for merge.

danielepintore commented 3 months ago

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.

BLeeEZ commented 3 months ago

I renamed "Display" to "Display & Interaction" and moved the haptic feedback into this new section. I added a description too.