thumb seek size

This commit is contained in:
Reinaldo Neto 2023-10-24 12:05:53 -03:00
parent 7e11357873
commit 9b3986f22c
3 changed files with 8 additions and 5 deletions

View File

@ -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({

View File

@ -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: {

View File

@ -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;