diff --git a/shared/src/commonMain/kotlin/com/bumble/livemosaic/model/Entries.kt b/shared/src/commonMain/kotlin/com/bumble/livemosaic/model/Entries.kt index d2ff1725..07cada1c 100644 --- a/shared/src/commonMain/kotlin/com/bumble/livemosaic/model/Entries.kt +++ b/shared/src/commonMain/kotlin/com/bumble/livemosaic/model/Entries.kt @@ -19,125 +19,130 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import com.bumble.livemosaic.model.MosaicConfig.MOSAIC1 -import com.bumble.livemosaic.model.MosaicConfig.MOSAIC2 -import com.bumble.livemosaic.model.MosaicConfig.MOSAIC3 import com.bumble.livemosaic.participant.ClockWidget import com.bumble.livemosaic.participant.DroidconLondonHalloweenSpecial val entries = listOf( Entry.Text( - mosaic = MOSAIC1, githubUserName = "zsoltk", message = "Hello Droidcon!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "KovalevAndrey", message = "Looking forward to all the talks, meeting new people and beer at the afterparty!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "manuel-martos", message = "Happy to be here for another year, eager to attend the talks and meet with many folks! #dclnd23" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "sergioborne", message = "Last year Berlin, this year London. Where to next year?? #dcldn23" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "manuelvicnt", message = "Don't miss the UI layer talk on Friday at 10:15am!!!! See you at Lovelace ;)" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "Cassnyo", message = "It's awesome to be here for the first time! :D" ), Entry.Text( - mosaic = MOSAIC1, githubUserName = "soniammarshall", message = "Hello DroidCon London, from Berlin :)" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "mapm14", message = "Welcome back to London, folks! Excited to be here for another year" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "astamato", message = "Hey yall! Who's at DC LON??? :D Hoping to meet ye here!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "emepox", message = "This is my first time in the London Droidcon! I'm very happy to be here!" ), - Entry.Text( - mosaic = MOSAIC1, + + Entry.Text( githubUserName = "freedomchuks", message = "Freedom was here! mama i made it" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "jlmd", message = "Hi mom, I'm on TV!!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "kardelio", message = "Practical ADB to enhance your life talk in Hamilton on Friday at 13:25 ... You wont regret it... Or maybe you will, I dunno..." ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "pedrorg18", message = "Hi there, happy to be here and attend interesting talks!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "juanmazake", message = "You never lose. You either win or you learn." ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "kamikatze2008", message = "Welcome to #droidconLondon. What's your favorite talk so far?" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "JorgeDLS", message = "I develop, Kotlin guides me. Knock knock!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "VadymPinchuk", message = "System limitations boosts creativity." ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "jamesdpli", message = "Hello Droidcon 2023 :)" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "vladcipariu91", message = "Another great year for Droidcon London! Can't wait to see you all there!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "neobrahma", message = "Bokit is the new burger" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "Phelenor", message = "Greetings from Sofascore!" ), + + Entry.Text( + githubUserName = "AnujVashisht", + message = "This is the most popular entry, coming straight from phone 😅" + ), + + Entry.Text( + githubUserName = "alsafer", + message = "Hello Droidcon London! Another great conference meeting great people!" + ), + Entry.ComposableContent( - mosaic = MOSAIC1, githubUserName = "adriantache", content = { val infiniteTransition = rememberInfiniteTransition() @@ -165,185 +170,150 @@ val entries = listOf( } } ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "Aman-15", message = "Excited to attend my first Droidcon! Hoping to meet many of you :)" ), + Entry.Image( - mosaic = MOSAIC1, githubUserName = "mike-n-jordan", path = "mike_avatar.png" ), + Entry.Image( - mosaic = MOSAIC1, githubUserName = "esmagoksal", path = "esma_manel.png" ), + Entry.Image( - mosaic = MOSAIC1, githubUserName = "aashay-gaikwad", path = "aashay-photo.png", contentDescription = "Bumble team" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "vassilisimon", message = "First time at dcldn, it is amazing here." ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "jorcollmar", message = "For the people sound enjoying the sun!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "osaamakhalil", message = "Enjoy Android life" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "petra-cendelinova", message = "Having a great time at my first Droidcon London!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "ayusch", message = "Blimey! Great to be in Droidcon London" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "LethalMaus", message = "Nice to see you all here at Droidcon!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "marin-marsic", message = "Roses are red, Bumble is yellow, if you're reading this, you're a nice fellow!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "Zhelyazko", message = "Have fun everyone at Droidcon London!" ), + Entry.Image( - mosaic = MOSAIC1, githubUserName = "di-maroo", path = "watching_you.jpeg", contentDescription = "Bumble team" ), + Entry.Image( - mosaic = MOSAIC1, githubUserName = "mezentsev", path = "mezentsev.jpg" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "edward1432", message = "Best wishes from all LBG Android Devs!" ), + Entry.ComposableContent( - mosaic = MOSAIC1, githubUserName = "zsmb13", content = { ClockWidget(Modifier.background(Color.DarkGray).fillMaxSize()) } ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "cortinico", message = "OSS is Awesome (⌐■_■)" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "marekpdev", message = "Great to talk to so many interesting people at Droidcon!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "mho-bbk", message = "Amazing Droidcon! Very inspired by everyone here today :)" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "victor-wallapop", message = "Why so serious?" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "vladislavfitz", message = "Vive Android" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "berovikaki", message = "So happy to be here!" ), Entry.Text( - mosaic = MOSAIC1, githubUserName = "aallam", message = "Hello from Paris 🥖" ), + Entry.Image( - mosaic = MOSAIC1, githubUserName = "jeremyleenz", path = "jeremy.jpg", contentDescription = "Having a great time at Droidcon London!" ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "hln-h", message = "Droidcon London lets go! 🤙🤙" ), + Entry.ComposableContent( - mosaic = MOSAIC1, githubUserName = "stewemetal", content = { DroidconLondonHalloweenSpecial() } ), + Entry.Text( - mosaic = MOSAIC1, githubUserName = "katekatjuchka", message = "It is an amazing conference, kudos to the organisers, Happy Friday!" ), + + Entry.Text( + githubUserName = "gabrielrodriguez2746", + message = "Bumble give me the voucher! 🤙🤙" + ), ) -val mosaic1Entries = entries - .filter { it.mosaic == MOSAIC1 } - .also { - if (it.size > MOSAIC1.maxEntryCount) - error("Mosaic 1 is already filled up. Add your entry to another one!") - if (it.map { it.githubUserName }.distinct().size < it.size) { - error("One entry per mosaic is the limit, but you can try again in the next one!") - } - } - -val mosaic2Entries = entries - .filter { it.mosaic == MOSAIC2 } - .also { - if (it.size > MOSAIC2.maxEntryCount) - error("Mosaic 2 is already filled up. Add your entry to another one!") - if (it.isNotEmpty() && entries.filter { it.mosaic == MOSAIC1 }.size < MOSAIC1.maxEntryCount) - error("Mosaic 1 is not yet filled up. Add your entry to it!") - if (it.map { it.githubUserName }.distinct().size < it.size) { - error("One entry per mosaic is the limit, but you can try again in the next one!") - } - } - -val mosaic3Entries = entries - .filter { it.mosaic == MOSAIC3 } - .also { - if (it.size > MOSAIC3.maxEntryCount) - error("Mosaic 3 is already filled up. Add your entry to another one!") - if (it.isNotEmpty() && entries.filter { it.mosaic == MOSAIC1 }.size < MOSAIC1.maxEntryCount) - error("Mosaic 1 is not yet filled up. Add your entry to it!") - if (it.isNotEmpty() && entries.filter { it.mosaic == MOSAIC2 }.size < MOSAIC2.maxEntryCount) - error("Mosaic 2 is not yet filled up. Add your entry to it!") - if (it.map { it.githubUserName }.distinct().size < it.size) { - error("One entry per mosaic is the limit, but you can try again in the next one!") - } - } - -fun List.hasMosaic2Entries() = any { it.mosaic == MOSAIC2 } - -fun List.hasMosaic3Entries() = any { it.mosaic == MOSAIC3 } diff --git a/shared/src/commonMain/kotlin/com/bumble/livemosaic/model/Entry.kt b/shared/src/commonMain/kotlin/com/bumble/livemosaic/model/Entry.kt index e265aebb..685482b0 100644 --- a/shared/src/commonMain/kotlin/com/bumble/livemosaic/model/Entry.kt +++ b/shared/src/commonMain/kotlin/com/bumble/livemosaic/model/Entry.kt @@ -4,17 +4,14 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.layout.ContentScale sealed class Entry { - abstract val mosaic: MosaicConfig abstract val githubUserName: String data class Text( - override val mosaic: MosaicConfig, override val githubUserName: String, val message: String ) : Entry() data class Image( - override val mosaic: MosaicConfig, override val githubUserName: String, /** * - Should not be larger than 500 KB @@ -29,7 +26,6 @@ sealed class Entry { ) : Entry() data class ComposableContent( - override val mosaic: MosaicConfig, override val githubUserName: String, /** * Please create your custom composable in a new file in: diff --git a/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/app/LiveMosaicAppNode.kt b/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/app/LiveMosaicAppNode.kt index 37983418..e9b2c83c 100644 --- a/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/app/LiveMosaicAppNode.kt +++ b/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/app/LiveMosaicAppNode.kt @@ -1,3 +1,4 @@ +@file:Suppress("MagicNumber") package com.bumble.livemosaic.node.app import androidx.compose.animation.core.FastOutLinearInEasing @@ -41,9 +42,6 @@ import com.bumble.livemosaic.imageloader.EmbeddableResourceImage import com.bumble.livemosaic.model.MosaicConfig.MOSAIC1 import com.bumble.livemosaic.model.MosaicConfig.MOSAIC2 import com.bumble.livemosaic.model.MosaicConfig.MOSAIC3 -import com.bumble.livemosaic.model.entries -import com.bumble.livemosaic.model.hasMosaic2Entries -import com.bumble.livemosaic.model.hasMosaic3Entries import com.bumble.livemosaic.node.app.LiveMosaicAppNode.NavTarget import com.bumble.livemosaic.node.app.LiveMosaicAppNode.NavTarget.CallToAction import com.bumble.livemosaic.node.app.LiveMosaicAppNode.NavTarget.ManuelTalk @@ -58,21 +56,26 @@ import com.bumble.livemosaic.node.mosaic.MosaicNode import com.bumble.livemosaic.node.starfield.StarFieldNode import com.bumble.livemosaic.ui.DottedMeshShape import com.bumble.livemosaic.ui.LocalAutoPlayFlow +import kotlin.random.Random private val screens = listOfNotNull( Mosaic1, CallToAction, - ManuelTalk, - StarField, + getRandomVisualization(), + ZsoltTalk, + Mosaic2, + CallToAction, + getRandomVisualization(), + ZsoltTalk, + Mosaic3, + CallToAction, + getRandomVisualization(), ZsoltTalk, - Mosaic2.takeIf { entries.hasMosaic2Entries() }, - CallToAction.takeIf { entries.hasMosaic2Entries() }, - StackedMessages.takeIf { entries.hasMosaic2Entries() }, - Mosaic3.takeIf { entries.hasMosaic3Entries() }, - CallToAction.takeIf { entries.hasMosaic3Entries() }, - StarField.takeIf { entries.hasMosaic3Entries() }, ) +private fun getRandomVisualization() = + if (Random(123).nextBoolean()) StackedMessages else StarField + class LiveMosaicAppNode( buildContext: BuildContext, private val backStack: BackStack = BackStack( diff --git a/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/mosaic/MosaicNode.kt b/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/mosaic/MosaicNode.kt index 3f3fa7f3..2a12e92a 100644 --- a/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/mosaic/MosaicNode.kt +++ b/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/mosaic/MosaicNode.kt @@ -38,9 +38,6 @@ import com.bumble.livemosaic.composable.FlashCard import com.bumble.livemosaic.imageloader.EmbeddableResourceImage import com.bumble.livemosaic.model.MosaicConfig import com.bumble.livemosaic.model.MosaicPiece -import com.bumble.livemosaic.model.mosaic1Entries -import com.bumble.livemosaic.model.mosaic2Entries -import com.bumble.livemosaic.model.mosaic3Entries import com.bumble.livemosaic.ui.LocalAutoPlayFlow import com.bumble.livemosaic.ui.appyx_dark import kotlin.random.Random @@ -58,13 +55,6 @@ class MosaicNode( gridCols = config.columns, pieces = IntRange(0, config.rows * config.columns - 1) .shuffled(Random(123)) - .take( - when (config) { - MosaicConfig.MOSAIC1 -> mosaic1Entries - MosaicConfig.MOSAIC2 -> mosaic2Entries - MosaicConfig.MOSAIC3 -> mosaic3Entries - }.size - ) .mapIndexed { sequentialIdx, shuffledIdx -> MosaicPiece( i = shuffledIdx % config.columns, diff --git a/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/starfield/StarFieldNode.kt b/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/starfield/StarFieldNode.kt index e155dbab..2495d2d6 100644 --- a/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/starfield/StarFieldNode.kt +++ b/shared/src/commonMain/kotlin/com/bumble/livemosaic/node/starfield/StarFieldNode.kt @@ -23,7 +23,7 @@ class StarFieldNode( @Composable override fun View(modifier: Modifier) { var entriesForStarField by remember { mutableStateOf(immutableListOf()) } - AutoPlayScript(initialDelayMs = 20000) { finish() } + AutoPlayScript(initialDelayMs = 30000) { finish() } LaunchedEffect(Unit) { entriesForStarField = entries.getFeaturedEntries( entriesCount = 20,