From 9b3986f22c9ad23754e0ef85b7e19b3fde684b25 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Tue, 24 Oct 2023 12:05:53 -0300 Subject: [PATCH] thumb seek size --- app/containers/AudioPlayer/Seek.tsx | 4 ++-- app/containers/AudioPlayer/styles.ts | 7 ++++--- app/containers/AudioPlayer/utils.ts | 2 ++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/containers/AudioPlayer/Seek.tsx b/app/containers/AudioPlayer/Seek.tsx index 3dd7d915d..cd02f2429 100644 --- a/app/containers/AudioPlayer/Seek.tsx +++ b/app/containers/AudioPlayer/Seek.tsx @@ -13,7 +13,7 @@ import Animated, { import styles from './styles'; import { useTheme } from '../../theme'; -import { AUDIO_BUTTON_HIT_SLOP } from './utils'; +import { AUDIO_BUTTON_HIT_SLOP, THUMB_SEEK_SIZE } from './utils'; const DEFAULT_TIME_LABEL = '00:00'; @@ -47,7 +47,7 @@ const Seek = ({ currentTime, duration, loaded = false, onChangeTime }: ISeek) => const onLayout = (event: LayoutChangeEvent) => { const { width } = event.nativeEvent.layout; - maxWidth.value = width - 12; + maxWidth.value = width - THUMB_SEEK_SIZE; }; const onGestureEvent = useAnimatedGestureHandler({ diff --git a/app/containers/AudioPlayer/styles.ts b/app/containers/AudioPlayer/styles.ts index b4c9fa3fb..1307d8a27 100644 --- a/app/containers/AudioPlayer/styles.ts +++ b/app/containers/AudioPlayer/styles.ts @@ -1,6 +1,7 @@ import { StyleSheet } from 'react-native'; import sharedStyles from '../../views/Styles'; +import { THUMB_SEEK_SIZE } from './utils'; const styles = StyleSheet.create({ audioContainer: { @@ -44,9 +45,9 @@ const styles = StyleSheet.create({ ...sharedStyles.textRegular }, thumbSeek: { - height: 12, - width: 12, - borderRadius: 6, + height: THUMB_SEEK_SIZE, + width: THUMB_SEEK_SIZE, + borderRadius: THUMB_SEEK_SIZE / 2, position: 'absolute' }, containerPlaybackSpeed: { diff --git a/app/containers/AudioPlayer/utils.ts b/app/containers/AudioPlayer/utils.ts index 43a8b7fef..1530913b8 100644 --- a/app/containers/AudioPlayer/utils.ts +++ b/app/containers/AudioPlayer/utils.ts @@ -1,3 +1,5 @@ export const AVAILABLE_SPEEDS = [1, 1.5, 2, 0.5]; export const AUDIO_BUTTON_HIT_SLOP = { top: 8, right: 8, bottom: 8, left: 8 }; + +export const THUMB_SEEK_SIZE = 12;