Ios: complete iOS vibration pattern supports (js) #9233
Closed
zxcpoiu wants to merge 2 commits into
Closed
Conversation
|
By analyzing the blame information on this pull request, we identified @skv-headless and @javache to be potential reviewers. |
dcd4955 to
0bd1ace
Compare
|
@zxcpoiu updated the pull request. |
0bd1ace to
a8cb818
Compare
|
@zxcpoiu updated the pull request. |
1 similar comment
|
@zxcpoiu updated the pull request. |
a8cb818 to
d0d460d
Compare
|
@zxcpoiu updated the pull request. |
1 similar comment
|
@zxcpoiu updated the pull request. |
d0d460d to
6fb623b
Compare
|
@zxcpoiu updated the pull request. |
Contributor
Author
|
Fixed ci |
Contributor
|
@facebook-github-bot shipit |
|
Thanks for importing.If you are an FB employee go to Phabricator to review internal test results. |
rozele
pushed a commit
to microsoft/react-native-windows
that referenced
this pull request
Sep 14, 2016
Summary: This is a revised follow up version from #8574 ( originally implemented in `objc` ) This PR change the implementation in JS suggested by javache **motivation** To supports vibration pattern like android. The [iOS vibration implementation link](http://stackoverflow.com/questions/12966467/are-there-apis-for-custom-vibrations-in-ios/13047464#13047464) mentioned by skv-headless at react/react-native#6061 (comment), which will not be accepted by apple since that implementation uses a private API. Thus, I use pure public API `NSTimer` to implement it. **Note** Since vibration time on iOS is not configurable, there are slightly differences with android. for example: **Android Usage:** `Vibration.vibrate([0, 500, 200, 500])` ==> V(0.5s) --wait(0.2s)--> V(0.5s) `Vibration.vibrate([300, 500, 200, 500])` ==> --wait(0.3s)--> V(0.5s) --wait(0.2s)--> V(0.5s) **iOS Usage:** if first argument is 0, it will not be included in pattern array. ( vibration Closes react/react-native#9233 Differential Revision: D3775085 Pulled By: javache fbshipit-source-id: 370495857d5581399de32d2bed1ea1bcce193e9d
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a revised follow up version from #8574 ( originally implemented in
objc)This PR change the implementation in JS suggested by @javache
motivation
To supports vibration pattern like android.
The iOS vibration implementation link mentioned by @skv-headless at #6061 (comment), which will not be accepted by apple since that implementation uses a private API. Thus, I use pure public API
NSTimerto implement it.Note
Since vibration time on iOS is not configurable, there are slightly differences with android.
for example:
Android Usage:
Vibration.vibrate([0, 500, 200, 500])==> V(0.5s) --wait(0.2s)--> V(0.5s)
Vibration.vibrate([300, 500, 200, 500])==> --wait(0.3s)--> V(0.5s) --wait(0.2s)--> V(0.5s)
iOS Usage:
if first argument is 0, it will not be included in pattern array.
( vibration length on iOS is about 500ms )
Vibration.vibrate([0, 1000, 2000, 3000])==> V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed)
Vibration.vibrate([0, 1000, 2000, 3000], true)==> V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(3s)--> V(fixed)
Vibration.vibrate([1000, 2000], true)==> --wait(1s)--> V(fixed) --wait(2s)--> V(fixed) --wait(1s)--> V(fixed) --wait(2s)--> V(fixed)
Vibration.vibrate([0, 1000], true)==> V(fixed) --wait(1s)--> V(fixed) --wait(1s)--> V(fixed)
Test plan (required)
I also added examples in
UIExplorer.Open
UIExploreron iOS, and plays it around.