From ff03698f20a123ebac8584891579a21443285b35 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 15 Oct 2019 20:01:41 -0700 Subject: [PATCH] Use SoundManager in Pressability and Touchable 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 --- Libraries/Components/Touchable/Touchable.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Libraries/Components/Touchable/Touchable.js b/Libraries/Components/Touchable/Touchable.js index e589b6adde..2aeb51ca53 100644 --- a/Libraries/Components/Touchable/Touchable.js +++ b/Libraries/Components/Touchable/Touchable.js @@ -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'); @@ -866,7 +867,7 @@ const TouchableMixin = { this._endHighlight(e); } if (Platform.OS === 'android' && !this.props.touchSoundDisabled) { - this._playTouchSound(); + SoundManager.playTouchSound(); } this.touchableHandlePress(e); } @@ -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);