From f1140927a882e6edc80126b786bc393f6affb476 Mon Sep 17 00:00:00 2001 From: lance chant <13349722+lancechant@users.noreply.github.com> Date: Fri, 22 May 2026 15:28:03 +0200 Subject: [PATCH] chore: updated usage of tv scaling, alert text fix (#1587) Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> --- app.json | 1 + components/Button.tsx | 21 ++++-- components/login/TVAccountCard.tsx | 29 ++++---- components/login/TVAddIcon.tsx | 17 ++--- components/login/TVAddServerForm.tsx | 18 +++-- components/login/TVAddUserForm.tsx | 32 ++++++--- components/login/TVBackIcon.tsx | 17 ++--- components/login/TVInput.tsx | 9 +-- components/login/TVLogin.tsx | 7 +- components/login/TVPINEntryModal.tsx | 51 +++++++------- components/login/TVPasswordEntryModal.tsx | 57 +++++++-------- components/login/TVQRCodeDisplay.tsx | 6 +- components/login/TVSaveAccountModal.tsx | 69 ++++++++++--------- components/login/TVSaveAccountToggle.tsx | 23 ++++--- components/login/TVServerIcon.tsx | 23 ++++--- components/login/TVServerSelectionScreen.tsx | 17 ++--- components/login/TVUserIcon.tsx | 39 ++++++----- components/login/TVUserSelectionScreen.tsx | 15 ++-- components/tv/TVActorCard.tsx | 23 ++++--- components/tv/TVButton.tsx | 9 +-- components/tv/TVCancelButton.tsx | 11 +-- components/tv/TVCastCrewText.tsx | 11 +-- components/tv/TVControlButton.tsx | 11 +-- components/tv/TVFilterButton.tsx | 11 +-- components/tv/TVFocusableProgressBar.tsx | 29 ++++---- components/tv/TVHorizontalList.tsx | 7 +- components/tv/TVItemCardText.tsx | 5 +- components/tv/TVLanguageCard.tsx | 17 ++--- components/tv/TVMetadataBadges.tsx | 5 +- components/tv/TVNextEpisodeCountdown.tsx | 31 +++++---- components/tv/TVOptionButton.tsx | 9 +-- components/tv/TVOptionCard.tsx | 11 +-- components/tv/TVOptionSelector.tsx | 23 ++++--- components/tv/TVProgressBar.tsx | 11 +-- components/tv/TVSeriesNavigation.tsx | 3 +- components/tv/TVSeriesSeasonCard.tsx | 15 ++-- components/tv/TVSkipSegmentCard.tsx | 17 ++--- components/tv/TVSubtitleResultCard.tsx | 41 +++++------ components/tv/TVTabButton.tsx | 9 +-- components/tv/TVTechnicalDetails.tsx | 11 +-- components/tv/TVThemeMusicIndicator.tsx | 17 ++--- components/tv/TVTrackCard.tsx | 17 ++--- components/tv/TVUserCard.tsx | 33 +++++---- components/tv/settings/TVLogoutButton.tsx | 7 +- .../tv/settings/TVSettingsOptionButton.tsx | 17 +++-- components/tv/settings/TVSettingsRow.tsx | 17 +++-- components/tv/settings/TVSettingsStepper.tsx | 29 ++++---- .../tv/settings/TVSettingsTextInput.tsx | 19 ++--- components/tv/settings/TVSettingsToggle.tsx | 23 ++++--- constants/TVSizes.ts | 2 +- constants/TVTypography.ts | 6 +- .../TvRecommendationsPublisher.kt | 1 + plugins/withAndroidAlertColors.js | 40 +++++++++++ 53 files changed, 575 insertions(+), 424 deletions(-) create mode 100644 plugins/withAndroidAlertColors.js diff --git a/app.json b/app.json index d4699bf9..1cbf6693 100644 --- a/app.json +++ b/app.json @@ -136,6 +136,7 @@ "expo-web-browser", ["./plugins/with-runtime-framework-headers.js"], ["./plugins/withChangeNativeAndroidTextToWhite.js"], + ["./plugins/withAndroidAlertColors.js"], ["./plugins/withAndroidManifest.js"], ["./plugins/withTrustLocalCerts.js"], ["./plugins/withGradleProperties.js"], diff --git a/components/Button.tsx b/components/Button.tsx index 3b5d6351..1471a517 100644 --- a/components/Button.tsx +++ b/components/Button.tsx @@ -15,6 +15,7 @@ import { View, } from "react-native"; import { useHaptic } from "@/hooks/useHaptic"; +import { scaleSize } from "@/utils/scaleSize"; import { Loader } from "./Loader"; const getColorClasses = ( @@ -135,16 +136,26 @@ export const Button: React.FC> = ({ shadowColor: "#ffffff", shadowOffset: { width: 0, height: 0 }, shadowOpacity: focused ? 0.5 : 0, - shadowRadius: focused ? 10 : 0, + shadowRadius: focused ? scaleSize(10) : 0, elevation: focused ? 12 : 0, // Android glow }} > - + {children} diff --git a/components/login/TVAccountCard.tsx b/components/login/TVAccountCard.tsx index bb78639d..d555536d 100644 --- a/components/login/TVAccountCard.tsx +++ b/components/login/TVAccountCard.tsx @@ -3,6 +3,7 @@ import React, { useRef, useState } from "react"; import { useTranslation } from "react-i18next"; import { Animated, Easing, Pressable, View } from "react-native"; import { Text } from "@/components/common/Text"; +import { scaleSize } from "@/utils/scaleSize"; import type { SavedServerAccount } from "@/utils/secureCredentials"; interface TVAccountCardProps { @@ -97,9 +98,9 @@ export const TVAccountCard: React.FC = ({ backgroundColor: isFocused ? "#2a2a2a" : "#262626", borderWidth: 2, borderColor: isFocused ? "#FFFFFF" : "transparent", - borderRadius: 16, - paddingHorizontal: 24, - paddingVertical: 20, + borderRadius: scaleSize(16), + paddingHorizontal: scaleSize(24), + paddingVertical: scaleSize(20), flexDirection: "row", alignItems: "center", }} @@ -107,23 +108,23 @@ export const TVAccountCard: React.FC = ({ {/* Avatar */} - + {/* Account Info */} = ({ {getSecurityText()} @@ -142,7 +143,11 @@ export const TVAccountCard: React.FC = ({ {/* Security Icon */} - + diff --git a/components/login/TVAddIcon.tsx b/components/login/TVAddIcon.tsx index 111c706a..45b5f041 100644 --- a/components/login/TVAddIcon.tsx +++ b/components/login/TVAddIcon.tsx @@ -4,6 +4,7 @@ import { Animated, Pressable, View } from "react-native"; import { Text } from "@/components/common/Text"; import { useTVFocusAnimation } from "@/components/tv/hooks/useTVFocusAnimation"; import { useScaledTVTypography } from "@/constants/TVTypography"; +import { scaleSize } from "@/utils/scaleSize"; export interface TVAddIconProps { label: string; @@ -33,24 +34,24 @@ export const TVAddIcon = React.forwardRef( animatedStyle, { alignItems: "center", - width: 160, + width: scaleSize(160), shadowColor: "#fff", shadowOffset: { width: 0, height: 0 }, shadowOpacity: focused ? 0.5 : 0, - shadowRadius: focused ? 16 : 0, + shadowRadius: focused ? scaleSize(16) : 0, }, ]} > ( > diff --git a/components/login/TVAddServerForm.tsx b/components/login/TVAddServerForm.tsx index de28c64e..8d0168b2 100644 --- a/components/login/TVAddServerForm.tsx +++ b/components/login/TVAddServerForm.tsx @@ -5,6 +5,7 @@ import { Button } from "@/components/Button"; import { Text } from "@/components/common/Text"; import { useScaledTVTypography } from "@/constants/TVTypography"; import { useTVBackPress } from "@/hooks/useTVBackPress"; +import { scaleSize } from "@/utils/scaleSize"; import { TVInput } from "./TVInput"; interface TVAddServerFormProps { @@ -48,7 +49,7 @@ export const TVAddServerForm: React.FC = ({ flexGrow: 1, justifyContent: "center", alignItems: "center", - paddingVertical: 60, + paddingVertical: scaleSize(60), }} showsVerticalScrollIndicator={false} > @@ -56,7 +57,7 @@ export const TVAddServerForm: React.FC = ({ style={{ width: "100%", maxWidth: 800, - paddingHorizontal: 60, + paddingHorizontal: scaleSize(60), }} > {/* Title */} @@ -66,15 +67,20 @@ export const TVAddServerForm: React.FC = ({ fontWeight: "bold", color: "#FFFFFF", textAlign: "left", - marginBottom: 24, - paddingHorizontal: 8, + marginBottom: scaleSize(24), + paddingHorizontal: scaleSize(8), }} > {t("server.enter_url_to_jellyfin_server")} {/* Server URL Input */} - + = ({ {/* Connect Button */} - +