diff --git a/app/containers/AudioPlayer/PlayButton.tsx b/app/containers/AudioPlayer/PlayButton.tsx index 1f58c2352..2592db7be 100644 --- a/app/containers/AudioPlayer/PlayButton.tsx +++ b/app/containers/AudioPlayer/PlayButton.tsx @@ -5,6 +5,7 @@ import { CustomIcon } from '../CustomIcon'; import { useTheme } from '../../theme'; import styles from './styles'; import RCActivityIndicator from '../ActivityIndicator'; +import { AUDIO_BUTTON_HIT_SLOP } from './utils'; interface IButton { loading: boolean; @@ -14,8 +15,6 @@ interface IButton { isReadyToPlay: boolean; } -const BUTTON_HIT_SLOP = { top: 12, right: 12, bottom: 12, left: 12 }; - type TCustomIconName = 'arrow-down' | 'play-shape-filled' | 'pause-shape-filled'; const PlayButton = ({ loading, paused, onPress, disabled, isReadyToPlay }: IButton) => { @@ -30,7 +29,7 @@ const PlayButton = ({ loading, paused, onPress, disabled, isReadyToPlay }: IButt style={[styles.playPauseButton, { backgroundColor: colors.buttonBackgroundPrimaryDefault }]} disabled={disabled} onPress={onPress} - hitSlop={BUTTON_HIT_SLOP} + hitSlop={AUDIO_BUTTON_HIT_SLOP} background={Touchable.SelectableBackgroundBorderless()} > {loading ? ( diff --git a/app/containers/AudioPlayer/Seek.tsx b/app/containers/AudioPlayer/Seek.tsx index 30babadba..0926379d0 100644 --- a/app/containers/AudioPlayer/Seek.tsx +++ b/app/containers/AudioPlayer/Seek.tsx @@ -13,6 +13,7 @@ import Animated, { import styles from './styles'; import { useTheme } from '../../theme'; +import { AUDIO_BUTTON_HIT_SLOP } from './utils'; const AnimatedTextInput = Animated.createAnimatedComponent(TextInput); @@ -23,13 +24,6 @@ interface ISeek { onChangeTime: (time: number) => Promise; } -const BUTTON_HIT_SLOP = { - top: 8, - right: 8, - bottom: 8, - left: 8 -}; - const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) => { const { colors } = useTheme(); @@ -141,7 +135,10 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) => - + diff --git a/app/containers/AudioPlayer/utils.ts b/app/containers/AudioPlayer/utils.ts new file mode 100644 index 000000000..43a8b7fef --- /dev/null +++ b/app/containers/AudioPlayer/utils.ts @@ -0,0 +1,3 @@ +export const AVAILABLE_SPEEDS = [1, 1.5, 2, 0.5]; + +export const AUDIO_BUTTON_HIT_SLOP = { top: 8, right: 8, bottom: 8, left: 8 };