mirror of
https://github.com/zimplexing/OrionTV.git
synced 2026-03-07 03:07:29 +08:00
feat: Refactor settings management into a dedicated page with new configuration options, including live stream source and remote input settings
This commit is contained in:
18
hooks/useAnimation.ts
Normal file
18
hooks/useAnimation.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { useRef, useEffect } from 'react';
|
||||
import { Animated } from 'react-native';
|
||||
|
||||
export const useButtonAnimation = (isFocused: boolean, size: number = 1.1) => {
|
||||
const scaleValue = useRef(new Animated.Value(1)).current;
|
||||
|
||||
useEffect(() => {
|
||||
Animated.spring(scaleValue, {
|
||||
toValue: isFocused ? size : 1,
|
||||
friction: 5,
|
||||
useNativeDriver: true,
|
||||
}).start();
|
||||
}, [ isFocused, scaleValue, size]);
|
||||
|
||||
return {
|
||||
transform: [{ scale: scaleValue }],
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user