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

Adds Android click sound to Touchables #17183

Closed
wants to merge 8 commits into from
Closed

Conversation

akriger
Copy link
Contributor

@akriger akriger commented Dec 13, 2017

Motivation

Android apps play a touch sound on press, as long as you have "Touch sounds" enabled in the settings. As and Android user, when building my app using React Native, one of the first things I noticed was that there were not any touch sounds. This is missing from React Native and there have been multiple PRs to have this implemented, but no success.

Related PRs

This PR iterates over #6825 and #11136

This PR keeps it simple by only implementing the enhancement for Android, as iOS apps typically do not use touch sounds, and follows the users' system settings for whether or not the sound is played.

Test Plan

I have manually tested this on multiple devices and emulators with zero problems

Release Notes

[ANDROID] [ENHANCEMENT] [UIManagerModule.java]- Adds Android click sound to touchables

[ANDROID] [ENHANCEMENT] [Touchable] - Adds Android click sound to touchables

@pull-bot
Copy link

pull-bot commented Dec 13, 2017

Warnings
⚠️

📋 Release Notes - This PR may have incorrectly formatted Release Notes.

@facebook-github-bot label Needs more information

Generated by 🚫 dangerJS

_playTouchSound: function() {
UIManager.playTouchSound();
},

Choose a reason for hiding this comment

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

no-trailing-spaces: Trailing spaces not allowed.

this.touchableHandlePress(e);
}
}

this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
this.touchableDelayTimeout = null;
},


Choose a reason for hiding this comment

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

no-trailing-spaces: Trailing spaces not allowed.

@@ -743,14 +743,21 @@ var TouchableMixin = {
this._startHighlight(e);
this._endHighlight(e);
}
if(Platform.OS === 'android') {

Choose a reason for hiding this comment

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

keyword-spacing: Expected space(s) after "if".

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 14, 2017
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@pull-bot
Copy link

pull-bot commented Dec 28, 2017

@facebook-github-bot label Android

Generated by 🚫 dangerJS

@facebook-github-bot
Copy link
Contributor

@akriger I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project.

Update to latest React Native Version
@hramos hramos added the Android label Mar 13, 2018
@react-native-bot react-native-bot added Feature Request 🌟 Ran Commands One of our bots successfully processed a command. labels Mar 16, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@hramos hramos added Type: Enhancement A new feature or enhancement of an existing feature. and removed 🌟Feature Request labels Mar 19, 2018
@akriger
Copy link
Contributor Author

akriger commented Apr 5, 2018

@hramos @janicduplessis is there anything else I need to do for this PR? I see one of the checks failed but, not sure if that has anything to do with my PR.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Apr 9, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

campsafari pushed a commit to exozet/react-native that referenced this pull request Apr 11, 2018
Summary:
Android apps play a touch sound on press, as long as you have "Touch sounds" enabled in the settings. As and Android user, when building my app using React Native, one of the first things I noticed was that there were not any touch sounds. This is missing from React Native and there have been multiple PRs to have this implemented, but no success.

This PR iterates over [facebook#6825](facebook#6825) and [facebook#11136](facebook#11136)

This PR keeps it simple by only implementing the enhancement for Android, as iOS apps typically do not use touch sounds, and follows the users' system settings for whether or not the sound is played.

I have manually tested this on multiple devices and emulators with zero problems

[ANDROID] [ENHANCEMENT] [UIManagerModule.java]- Adds Android click sound to touchables

[ANDROID] [ENHANCEMENT] [Touchable] - Adds Android click sound to touchables
Closes facebook#17183

Differential Revision: D7560327

Pulled By: hramos

fbshipit-source-id: ce1094c437541bc677c7d64b0dba343dd9574422
LukeDurrant pushed a commit to LukeDurrant/react-native that referenced this pull request Apr 11, 2018
Summary:
Android apps play a touch sound on press, as long as you have "Touch sounds" enabled in the settings. As and Android user, when building my app using React Native, one of the first things I noticed was that there were not any touch sounds. This is missing from React Native and there have been multiple PRs to have this implemented, but no success.

This PR iterates over [facebook#6825](facebook#6825) and [facebook#11136](facebook#11136)

This PR keeps it simple by only implementing the enhancement for Android, as iOS apps typically do not use touch sounds, and follows the users' system settings for whether or not the sound is played.

I have manually tested this on multiple devices and emulators with zero problems

[ANDROID] [ENHANCEMENT] [UIManagerModule.java]- Adds Android click sound to touchables

[ANDROID] [ENHANCEMENT] [Touchable] - Adds Android click sound to touchables
Closes facebook#17183

Differential Revision: D7560327

Pulled By: hramos

fbshipit-source-id: ce1094c437541bc677c7d64b0dba343dd9574422
LukeDurrant pushed a commit to LukeDurrant/react-native that referenced this pull request Apr 11, 2018
Summary:
Android apps play a touch sound on press, as long as you have "Touch sounds" enabled in the settings. As and Android user, when building my app using React Native, one of the first things I noticed was that there were not any touch sounds. This is missing from React Native and there have been multiple PRs to have this implemented, but no success.

This PR iterates over [facebook#6825](facebook#6825) and [facebook#11136](facebook#11136)

This PR keeps it simple by only implementing the enhancement for Android, as iOS apps typically do not use touch sounds, and follows the users' system settings for whether or not the sound is played.

I have manually tested this on multiple devices and emulators with zero problems

[ANDROID] [ENHANCEMENT] [UIManagerModule.java]- Adds Android click sound to touchables

[ANDROID] [ENHANCEMENT] [Touchable] - Adds Android click sound to touchables
Closes facebook#17183

Differential Revision: D7560327

Pulled By: hramos

fbshipit-source-id: ce1094c437541bc677c7d64b0dba343dd9574422
bunnyc1986 pushed a commit to bunnyc1986/react-native that referenced this pull request May 11, 2018
Summary:
Android apps play a touch sound on press, as long as you have "Touch sounds" enabled in the settings. As and Android user, when building my app using React Native, one of the first things I noticed was that there were not any touch sounds. This is missing from React Native and there have been multiple PRs to have this implemented, but no success.

This PR iterates over [facebook#6825](facebook#6825) and [facebook#11136](facebook#11136)

This PR keeps it simple by only implementing the enhancement for Android, as iOS apps typically do not use touch sounds, and follows the users' system settings for whether or not the sound is played.

I have manually tested this on multiple devices and emulators with zero problems

[ANDROID] [ENHANCEMENT] [UIManagerModule.java]- Adds Android click sound to touchables

[ANDROID] [ENHANCEMENT] [Touchable] - Adds Android click sound to touchables
Closes facebook#17183

Differential Revision: D7560327

Pulled By: hramos

fbshipit-source-id: ce1094c437541bc677c7d64b0dba343dd9574422
macdoum1 pushed a commit to macdoum1/react-native that referenced this pull request Jun 28, 2018
Summary:
Android apps play a touch sound on press, as long as you have "Touch sounds" enabled in the settings. As and Android user, when building my app using React Native, one of the first things I noticed was that there were not any touch sounds. This is missing from React Native and there have been multiple PRs to have this implemented, but no success.

This PR iterates over [facebook#6825](facebook#6825) and [facebook#11136](facebook#11136)

This PR keeps it simple by only implementing the enhancement for Android, as iOS apps typically do not use touch sounds, and follows the users' system settings for whether or not the sound is played.

I have manually tested this on multiple devices and emulators with zero problems

[ANDROID] [ENHANCEMENT] [UIManagerModule.java]- Adds Android click sound to touchables

[ANDROID] [ENHANCEMENT] [Touchable] - Adds Android click sound to touchables
Closes facebook#17183

Differential Revision: D7560327

Pulled By: hramos

fbshipit-source-id: ce1094c437541bc677c7d64b0dba343dd9574422
facebook-github-bot pushed a commit that referenced this pull request May 1, 2019
Summary:
Currently, every time a touchable is pressed on Android, a system sound is played. It was added in the PR #17183. There is no way to disable it, except disabling touch on sound on the system level. I am pretty sure there are cases when touches should be silent and there should be an option to disable it.

Related PRs - #17183, #11136

[Android][added] - Added a touchSoundDisabled prop to Touchable. If true, doesn't system sound on touch.
Pull Request resolved: #24666

Differential Revision: D15166582

Pulled By: cpojer

fbshipit-source-id: 48bfe88f03f791e3b9c7cbd0e2eed80a2cfba8ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Import Started This pull request has been imported. This does not imply the PR has been approved. Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants