From 0e651e8be3972c33723cabc98ff8a860034a5374 Mon Sep 17 00:00:00 2001 From: Honey Date: Mon, 15 Jun 2026 00:28:44 +0200 Subject: [PATCH] feat: randomized home greetings (music-themed, EN) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../com/novasonic/app/ui/screen/HomeScreen.kt | 41 ++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/android/app/src/main/kotlin/com/novasonic/app/ui/screen/HomeScreen.kt b/android/app/src/main/kotlin/com/novasonic/app/ui/screen/HomeScreen.kt index 267618c..ad5b1f5 100644 --- a/android/app/src/main/kotlin/com/novasonic/app/ui/screen/HomeScreen.kt +++ b/android/app/src/main/kotlin/com/novasonic/app/ui/screen/HomeScreen.kt @@ -30,7 +30,34 @@ import com.novasonic.app.api.model.Genre import com.novasonic.app.ui.component.AlbumCard import com.novasonic.app.ui.theme.* 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( Color(0xFF1a1a3e), Color(0xFF1e2a1a), Color(0xFF2a1a1a), @@ -54,14 +81,8 @@ fun HomeScreen( LaunchedEffect(refreshKey) { if (refreshKey > 0) vm.load() } - val greeting = remember { - val hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY) - when { - hour < 12 -> "Guten Morgen" - hour < 18 -> "Guten Tag" - else -> "Guten Abend" - } - } + val greeting = remember { greetingsNoName.random() } + val greetingWithName = remember { greetingsWithName.random() } LazyColumn( contentPadding = PaddingValues(bottom = 24.dp), @@ -70,7 +91,7 @@ fun HomeScreen( item { val name = state.username.replaceFirstChar { it.uppercaseChar() } Text( - text = if (name.isBlank()) greeting else "$greeting, $name 👋", + text = if (name.isBlank()) greeting else "$greetingWithName $name", fontFamily = Outfit, fontSize = 24.sp, fontWeight = FontWeight.Bold,