feat: randomized home greetings (music-themed, EN)
Replace static time-of-day greetings (Guten Morgen/Tag/Abend) with a random pick from a pool of 10-12 music-themed phrases each time HomeScreen is composed. With username: "Ready for some beats, Marc" — without: "What's on the playlist today?" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
3855207530
commit
0e651e8be3
1 file changed
+31
-10
@@ -30,7 +30,34 @@ import com.novasonic.app.api.model.Genre
|
|||||||
import com.novasonic.app.ui.component.AlbumCard
|
import com.novasonic.app.ui.component.AlbumCard
|
||||||
import com.novasonic.app.ui.theme.*
|
import com.novasonic.app.ui.theme.*
|
||||||
import com.novasonic.app.viewmodel.HomeViewModel
|
import com.novasonic.app.viewmodel.HomeViewModel
|
||||||
import java.util.Calendar
|
|
||||||
|
private val greetingsWithName = listOf(
|
||||||
|
"Ready for some beats,",
|
||||||
|
"What's on the playlist,",
|
||||||
|
"Good vibes only,",
|
||||||
|
"Let the music play,",
|
||||||
|
"Your soundtrack awaits,",
|
||||||
|
"Turn it up,",
|
||||||
|
"Time to tune in,",
|
||||||
|
"Hit play and chill,",
|
||||||
|
"Music is the answer,",
|
||||||
|
"Welcome back,",
|
||||||
|
)
|
||||||
|
|
||||||
|
private val greetingsNoName = listOf(
|
||||||
|
"Ready for some beats?",
|
||||||
|
"What's on the playlist today?",
|
||||||
|
"Good vibes only",
|
||||||
|
"Let the music play",
|
||||||
|
"Your soundtrack awaits",
|
||||||
|
"Turn it up",
|
||||||
|
"Time to tune in",
|
||||||
|
"Hit play and chill",
|
||||||
|
"Music is the answer",
|
||||||
|
"What are we listening to?",
|
||||||
|
"Time to escape into music",
|
||||||
|
"Pick something great",
|
||||||
|
)
|
||||||
|
|
||||||
internal val genreColors = listOf(
|
internal val genreColors = listOf(
|
||||||
Color(0xFF1a1a3e), Color(0xFF1e2a1a), Color(0xFF2a1a1a),
|
Color(0xFF1a1a3e), Color(0xFF1e2a1a), Color(0xFF2a1a1a),
|
||||||
@@ -54,14 +81,8 @@ fun HomeScreen(
|
|||||||
|
|
||||||
LaunchedEffect(refreshKey) { if (refreshKey > 0) vm.load() }
|
LaunchedEffect(refreshKey) { if (refreshKey > 0) vm.load() }
|
||||||
|
|
||||||
val greeting = remember {
|
val greeting = remember { greetingsNoName.random() }
|
||||||
val hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY)
|
val greetingWithName = remember { greetingsWithName.random() }
|
||||||
when {
|
|
||||||
hour < 12 -> "Guten Morgen"
|
|
||||||
hour < 18 -> "Guten Tag"
|
|
||||||
else -> "Guten Abend"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LazyColumn(
|
LazyColumn(
|
||||||
contentPadding = PaddingValues(bottom = 24.dp),
|
contentPadding = PaddingValues(bottom = 24.dp),
|
||||||
@@ -70,7 +91,7 @@ fun HomeScreen(
|
|||||||
item {
|
item {
|
||||||
val name = state.username.replaceFirstChar { it.uppercaseChar() }
|
val name = state.username.replaceFirstChar { it.uppercaseChar() }
|
||||||
Text(
|
Text(
|
||||||
text = if (name.isBlank()) greeting else "$greeting, $name 👋",
|
text = if (name.isBlank()) greeting else "$greetingWithName $name",
|
||||||
fontFamily = Outfit,
|
fontFamily = Outfit,
|
||||||
fontSize = 24.sp,
|
fontSize = 24.sp,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
|
|||||||
Reference in new issue
Block a user