diff --git a/src/navigation/navigation.js b/src/navigation/navigation.js index 84f51ee..738e4d6 100644 --- a/src/navigation/navigation.js +++ b/src/navigation/navigation.js @@ -138,6 +138,17 @@ export function pushPlayDetailScreen(componentId, id) { duration: 300, }, }, + { + id: 'pageIndicator', + alpha: { + from: 0, // We don't declare 'to' value as that is the element's current alpha value, here we're essentially animating from 0 to 1 + duration: 300, + }, + translationX: { + from: -16, // Animate translationY from 16dp to 0dp + duration: 300, + }, + }, { id: 'player', alpha: { diff --git a/src/screens/PlayDetail/Portrait/Player/Pic.js b/src/screens/PlayDetail/Portrait/Player/Pic.js index 48f5bf4..f8110f1 100644 --- a/src/screens/PlayDetail/Portrait/Player/Pic.js +++ b/src/screens/PlayDetail/Portrait/Player/Pic.js @@ -2,21 +2,27 @@ import React, { memo, useMemo, useState, useEffect } from 'react' import { View, Image, StyleSheet } from 'react-native' import { useGetter, useDispatch } from '@/store' import { useLayout } from '@/utils/hooks' +import { useNavigationComponentDidAppear } from '@/navigation' -export default memo(() => { +export default memo(({ componentId }) => { const playMusicInfo = useGetter('player', 'playMusicInfo') const theme = useGetter('common', 'theme') const { onLayout, ...layout } = useLayout() + const [animated, setAnimated] = useState(false) const musicInfo = useMemo(() => { return (playMusicInfo && playMusicInfo.musicInfo) || {} }, [playMusicInfo]) + useNavigationComponentDidAppear(componentId, () => { + setAnimated(true) + }) + const imgWidth = Math.max(layout.width * 0.8, 100) return ( - + { } // global.iskeep = false -export default memo(() => { +export default memo(({ componentId }) => { const theme = useGetter('common', 'theme') const [pageIndex, setPageIndex] = useState(0) @@ -49,13 +49,13 @@ export default memo(() => { style={styles.pagerView} > - + - + diff --git a/src/screens/PlayDetail/Portrait/index.js b/src/screens/PlayDetail/Portrait/index.js index 3dd2941..b114279 100644 --- a/src/screens/PlayDetail/Portrait/index.js +++ b/src/screens/PlayDetail/Portrait/index.js @@ -4,10 +4,10 @@ import { useGetter, useDispatch } from '@/store' import Player from './Player' -export default () => { +export default ({ componentId }) => { return ( <> - + ) } diff --git a/src/screens/PlayDetail/index.js b/src/screens/PlayDetail/index.js index 246efa5..6bd2e1c 100644 --- a/src/screens/PlayDetail/index.js +++ b/src/screens/PlayDetail/index.js @@ -21,6 +21,6 @@ export default (props) => { }) return ( - window.width > window.height ? : + window.width > window.height ? : ) }