fix(mobile): remove black screen during Android player dismissal #54
No files matched your search
@@ -79,10 +79,9 @@ export default function AppLayout() {
|
||||
name="player"
|
||||
options={{
|
||||
headerShown: false,
|
||||
presentation:
|
||||
Platform.OS === "ios"
|
||||
? "transparentModal"
|
||||
: "fullScreenModal",
|
||||
// Keep the library visible behind the custom swipe animation.
|
||||
presentation: "transparentModal",
|
||||
contentStyle: { backgroundColor: "transparent" },
|
||||
animation: "slide_from_bottom",
|
||||
gestureEnabled: true,
|
||||
gestureDirection: "vertical",
|
||||
|
||||
@@ -91,6 +91,7 @@ export default function PlayerScreen() {
|
||||
} = usePlayback()
|
||||
const { volume, setVolume, available: volumeAvailable } = useSystemVolume()
|
||||
const [showQueue, setShowQueue] = useState(false)
|
||||
const [isDismissing, setIsDismissing] = useState(false)
|
||||
const [stageHeight, setStageHeight] = useState(0)
|
||||
const [scrubTime, setScrubTime] = useState<number | null>(null)
|
||||
const user = useCachedQuery(api.auth.currentUser)
|
||||
@@ -162,6 +163,7 @@ export default function PlayerScreen() {
|
||||
event.translationY > DISMISS_DISTANCE ||
|
||||
event.velocityY > DISMISS_VELOCITY
|
||||
) {
|
||||
scheduleOnRN(setIsDismissing, true)
|
||||
dismissY.value = withTiming(
|
||||
windowHeight,
|
||||
{ duration: 220 },
|
||||
@@ -221,7 +223,11 @@ export default function PlayerScreen() {
|
||||
{Platform.OS === "android" ? (
|
||||
<>
|
||||
<Stack.Screen
|
||||
options={{ statusBarStyle: colors.isDark ? "light" : "dark" }}
|
||||
options={{
|
||||
statusBarStyle: colors.isDark ? "light" : "dark",
|
||||
// The swipe already animates the player offscreen.
|
||||
animation: isDismissing ? "none" : "slide_from_bottom",
|
||||
}}
|
||||
/>
|
||||
<NavigationBar style={colors.isDark ? "light" : "dark"} />
|
||||
</>
|
||||
|
||||
Reference in new issue
Block a user