From 5d5d77ae1bf009003ed12093fa87a17eb7c088b1 Mon Sep 17 00:00:00 2001 From: tapframe Date: Tue, 21 Oct 2025 14:12:20 +0530 Subject: [PATCH] sizing fix for playercontrols. --- .../player/controls/PlayerControls.tsx | 30 ++++++------------- src/components/player/utils/playerStyles.ts | 21 +++++++------ 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/src/components/player/controls/PlayerControls.tsx b/src/components/player/controls/PlayerControls.tsx index 5794b4d4..0b7eb840 100644 --- a/src/components/player/controls/PlayerControls.tsx +++ b/src/components/player/controls/PlayerControls.tsx @@ -4,7 +4,7 @@ import { Ionicons } from '@expo/vector-icons'; import Feather from 'react-native-vector-icons/Feather'; import { LinearGradient } from 'expo-linear-gradient'; import Slider from '@react-native-community/slider'; -import { styles } from '../utils/playerStyles'; +import { styles } from '../utils/playerStyles'; // Updated styles import { getTrackDisplayName } from '../utils/playerUtils'; import { useTheme } from '../../../contexts/ThemeContext'; @@ -94,11 +94,11 @@ export const PlayerControls: React.FC = ({ /* Responsive Spacing */ const screenWidth = Dimensions.get('window').width; - const buttonSpacing = screenWidth * 0.15; + const buttonSpacing = screenWidth * 0.10; // Reduced from 15% to 10% - const playButtonSize = screenWidth * 0.12; // 12% of screen width - const playIconSize = playButtonSize * 0.6; // 60% of button size - const seekButtonSize = screenWidth * 0.11; // 11% of screen width + const playButtonSize = screenWidth * 0.08; // 8% of screen width (reduced from 12%) + const playIconSizeCalculated = playButtonSize * 0.6; // 60% of button size + const seekButtonSize = screenWidth * 0.07; // 7% of screen width (reduced from 11%) const seekIconSize = seekButtonSize * 0.75; // 75% of button size const seekNumberSize = seekButtonSize * 0.25; // 25% of button size const arcBorderWidth = seekButtonSize * 0.05; // 5% of button size @@ -253,9 +253,9 @@ export const PlayerControls: React.FC = ({ const isLargeTablet = deviceType === 'largeTablet'; const isTV = deviceType === 'tv'; - const closeIconSize = isTV ? 28 : isLargeTablet ? 26 : isTablet ? 24 : 24; - const skipIconSize = isTV ? 28 : isLargeTablet ? 26 : isTablet ? 24 : 24; - const playIconSize = isTV ? 56 : isLargeTablet ? 48 : isTablet ? 44 : 40; + const closeIconSize = isTV ? 24 : isLargeTablet ? 22 : isTablet ? 20 : 20; + const skipIconSize = isTV ? 24 : isLargeTablet ? 22 : isTablet ? 20 : 20; + const playIconSize = isTV ? 48 : isLargeTablet ? 40 : isTablet ? 36 : 32; return ( = ({ }}> @@ -493,18 +493,6 @@ export const PlayerControls: React.FC = ({ ]} /> - {/* Center Controls (Play/Pause, Skip) */} - - skip(-10)} style={styles.skipButton}> - - 10 - - - - - skip(10)} style={styles.skipButton}> - - 10 diff --git a/src/components/player/utils/playerStyles.ts b/src/components/player/utils/playerStyles.ts index 0d2002a6..63c03931 100644 --- a/src/components/player/utils/playerStyles.ts +++ b/src/components/player/utils/playerStyles.ts @@ -142,13 +142,9 @@ export const styles = StyleSheet.create({ left: 0, right: 0, top: '50%', - transform: [{ translateY: -50 }], + transform: [{ translateY: controlsTranslateY }], paddingHorizontal: 20, gap: controlsGap, - left: 0, - right: 0, - top: '50%', - transform: [{ translateY: controlsTranslateY }], zIndex: 1000, }, @@ -215,10 +211,6 @@ export const styles = StyleSheet.create({ borderRightColor: 'transparent', borderBottomColor: 'transparent', position: 'absolute', - skipText: { - color: 'white', - fontSize: skipTextFont, - marginTop: 2, }, arcRight: { borderWidth: 4, @@ -1111,4 +1103,15 @@ export const styles = StyleSheet.create({ marginTop: 8, textAlign: 'center', }, + // Additional missing styles + skipButton: { + alignItems: 'center', + justifyContent: 'center', + padding: 10, + }, + skipText: { + color: 'white', + fontSize: skipTextFont, + marginTop: 2, + }, }); \ No newline at end of file