Skip to content

Commit

Permalink
Use SoundManager in Pressability and Touchable
Browse files Browse the repository at this point in the history
Summary:
This diff replaces the usage of UIManagerModule.playTouchSound() in Pressability and Touchable for the SoundManager.playTouchSound()
Previously landed and unladed: D16543433

Changelog: This diff replaces the usage of UIManagerModule.playTouchSound() in Pressability and Touchable for the SoundManager.playTouchSound()

Reviewed By: makovkastar

Differential Revision: D17926309

fbshipit-source-id: ff7e318a4d720e489cbfe60e8d72ebb749c11c18
  • Loading branch information
mdvacca authored and facebook-github-bot committed Oct 16, 2019
1 parent 87b94e6 commit ff03698
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Libraries/Components/Touchable/Touchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const StyleSheet = require('../../StyleSheet/StyleSheet');
const TVEventHandler = require('../AppleTV/TVEventHandler');
const UIManager = require('../../ReactNative/UIManager');
const View = require('../View/View');
const SoundManager = require('../Sound/SoundManager');

const keyMirror = require('fbjs/lib/keyMirror');
const normalizeColor = require('../../Color/normalizeColor');
Expand Down Expand Up @@ -866,7 +867,7 @@ const TouchableMixin = {
this._endHighlight(e);
}
if (Platform.OS === 'android' && !this.props.touchSoundDisabled) {
this._playTouchSound();
SoundManager.playTouchSound();
}
this.touchableHandlePress(e);
}
Expand All @@ -876,10 +877,6 @@ const TouchableMixin = {
this.touchableDelayTimeout = null;
},

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

_startHighlight: function(e: PressEvent) {
this._savePressInLocation(e);
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
Expand Down

0 comments on commit ff03698

Please sign in to comment.