Skip to content

Commit 271f900

Browse files
MarcaDianLisoUseInAIKyrios
authored andcommitted
chore: Simplify code
1 parent 86d4ece commit 271f900

1 file changed

Lines changed: 9 additions & 32 deletions

File tree

app/src/main/java/app/revanced/manager/ui/component/morphe/home/HomeMainContent.kt

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
package app.revanced.manager.ui.component.morphe.home
22

33
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
94
import androidx.compose.foundation.horizontalScroll
105
import androidx.compose.foundation.layout.*
116
import androidx.compose.foundation.rememberScrollState
@@ -45,7 +40,7 @@ fun HomeMainContent(
4540
// Animated background
4641
AnimatedBackground(type = backgroundType)
4742

48-
// Adaptive layout based on orientation
43+
// Adaptive layout based on device orientation
4944
if (isLandscape) {
5045
LandscapeLayout(
5146
onYouTubeClick = onYouTubeClick,
@@ -88,7 +83,14 @@ private fun PortraitLayout(
8883
.height(120.dp),
8984
contentAlignment = Alignment.Center
9085
) {
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+
)
9294
}
9395

9496
Spacer(Modifier.height(32.dp))
@@ -199,28 +201,3 @@ private fun LandscapeLayout(
199201
}
200202
}
201203
}
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

Comments
 (0)