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

Add viberation variations to iOS #1905

Closed
wants to merge 1 commit into from
Closed

Conversation

ParticleG
Copy link

This pull request is for #1904

@ParticleG ParticleG marked this pull request as draft February 22, 2023 02:41
@ParticleG ParticleG marked this pull request as ready for review February 22, 2023 09:57
@slime73
Copy link
Member

slime73 commented Feb 26, 2023

Android does expose some haptic feedback preset types, but I'm not sure they really have the exact same meanings as iOS, in which case I suppose iOS and Android are sort of incompatible with each other in terms of the types of haptic feedback they expose...

I'm not sure how I feel about having a function which does radically different things (and effectively accepts different parameters) depending on the platform. I guess it was like that a little bit already, but this makes the difference even bigger.

*/
virtual void vibrate(double seconds) const;
virtual void vibrate(double seconds, const std::string &mode) const;
Copy link
Member

Choose a reason for hiding this comment

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

I think this should use an enum here (like the PowerState enum in this file, if you need an example to work from) instead of passing the string all the way down to the platform implementation.

{
@autoreleasepool
{
if (mode != "default" && @available(iOS 10.0, *)) {
Copy link
Member

Choose a reason for hiding this comment

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

love's code style has braces on a separate line from if-statements. Also for single lines inside a conditional (like below), the braces can be removed.

@ParticleG
Copy link
Author

Android does expose some haptic feedback preset types, but I'm not sure they really have the exact same meanings as iOS, in which case I suppose iOS and Android are sort of incompatible with each other in terms of the types of haptic feedback they expose...

I'm not sure how I feel about having a function which does radically different things (and effectively accepts different parameters) depending on the platform. I guess it was like that a little bit already, but this makes the difference even bigger.

Well, currently Android would switch between haptic vibration and normal long vibration depends on how long the vibration is, while iOS could only provide a constant 500ms vibration, and that's a big difference. Different platforms accept different params do sounds bad, so I'm considering tweaking iOS's vibration only with the seconds param, as I mentioned in the #1904 . Maybe test it on 4 ~ 5 iphone/android phone I think.

@26F-Studio 26F-Studio closed this by deleting the head repository Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants