|
1 | 1 | package app.revanced.manager.ui.component.morphe.home |
2 | 2 |
|
3 | 3 | import android.content.res.Configuration |
4 | | -import androidx.compose.animation.AnimatedContent |
5 | | -import androidx.compose.animation.core.tween |
6 | | -import androidx.compose.animation.fadeIn |
7 | | -import androidx.compose.animation.fadeOut |
8 | | -import androidx.compose.animation.togetherWith |
9 | 4 | import androidx.compose.foundation.horizontalScroll |
10 | 5 | import androidx.compose.foundation.layout.* |
11 | 6 | import androidx.compose.foundation.rememberScrollState |
@@ -45,7 +40,7 @@ fun HomeMainContent( |
45 | 40 | // Animated background |
46 | 41 | AnimatedBackground(type = backgroundType) |
47 | 42 |
|
48 | | - // Adaptive layout based on orientation |
| 43 | + // Adaptive layout based on device orientation |
49 | 44 | if (isLandscape) { |
50 | 45 | LandscapeLayout( |
51 | 46 | onYouTubeClick = onYouTubeClick, |
@@ -88,7 +83,14 @@ private fun PortraitLayout( |
88 | 83 | .height(120.dp), |
89 | 84 | contentAlignment = Alignment.Center |
90 | 85 | ) { |
91 | | - AnimatedGreeting(greeting) |
| 86 | + Text( |
| 87 | + text = stringResource(greeting), |
| 88 | + style = MaterialTheme.typography.headlineMedium, |
| 89 | + fontWeight = FontWeight.Bold, |
| 90 | + textAlign = TextAlign.Center, |
| 91 | + color = MaterialTheme.colorScheme.onBackground, |
| 92 | + modifier = Modifier.fillMaxWidth() |
| 93 | + ) |
92 | 94 | } |
93 | 95 |
|
94 | 96 | Spacer(Modifier.height(32.dp)) |
@@ -199,28 +201,3 @@ private fun LandscapeLayout( |
199 | 201 | } |
200 | 202 | } |
201 | 203 | } |
202 | | - |
203 | | -/** |
204 | | - * Animated greeting message with fade transitions |
205 | | - * Changes every 10 seconds |
206 | | - */ |
207 | | -@Composable |
208 | | -private fun AnimatedGreeting(greeting: Int) { |
209 | | - AnimatedContent( |
210 | | - targetState = stringResource(greeting), |
211 | | - transitionSpec = { |
212 | | - fadeIn(animationSpec = tween(1000)) togetherWith |
213 | | - fadeOut(animationSpec = tween(1000)) |
214 | | - }, |
215 | | - label = "message_animation" |
216 | | - ) { messageText -> |
217 | | - Text( |
218 | | - text = messageText, |
219 | | - style = MaterialTheme.typography.headlineMedium, |
220 | | - fontWeight = FontWeight.Bold, |
221 | | - textAlign = TextAlign.Center, |
222 | | - color = MaterialTheme.colorScheme.onBackground, |
223 | | - modifier = Modifier.fillMaxWidth() |
224 | | - ) |
225 | | - } |
226 | | -} |
0 commit comments