From 0e34e618f6dfb2c08ad2db8b6d8f05ac2670e780 Mon Sep 17 00:00:00 2001 From: oxy Date: Sat, 18 May 2024 20:43:53 +0800 Subject: [PATCH] fix: add enter transition for playlist tab row. --- .../internal/SmartphonePlaylistScreenImpl.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/features/playlist/src/main/java/com/m3u/features/playlist/internal/SmartphonePlaylistScreenImpl.kt b/features/playlist/src/main/java/com/m3u/features/playlist/internal/SmartphonePlaylistScreenImpl.kt index 93196167..bdad3152 100644 --- a/features/playlist/src/main/java/com/m3u/features/playlist/internal/SmartphonePlaylistScreenImpl.kt +++ b/features/playlist/src/main/java/com/m3u/features/playlist/internal/SmartphonePlaylistScreenImpl.kt @@ -5,6 +5,9 @@ package com.m3u.features.playlist.internal import android.content.res.Configuration.ORIENTATION_LANDSCAPE import android.content.res.Configuration.ORIENTATION_PORTRAIT import androidx.activity.compose.BackHandler +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.core.tween +import androidx.compose.animation.fadeIn import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -250,12 +253,18 @@ internal fun SmartphonePlaylistScreenImpl( Modifier.background(MaterialTheme.colorScheme.surfaceContainerHighest) ) { if (!isExpanded) { - if (categories.size > 1) { + AnimatedVisibility( + visible = categories.size > 1, + enter = fadeIn(animationSpec = tween(400)) + ) { tabs() } gallery() } else { - if (categories.size > 1) { + AnimatedVisibility( + visible = categories.size > 1, + enter = fadeIn(animationSpec = tween(400)) + ) { tabs() } }