Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
mmartosdev authored Oct 27, 2023
2 parents d8279b3 + 3cc77ab commit 545dcb0
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.bumble.livemosaic.participant.ClockWidget
import com.bumble.livemosaic.participant.DroidconLondonHalloweenSpecial
import com.bumble.livemosaic.participant.MagicButton

val entries = listOf(
Entry.Text(
githubUserName = "zsoltk",
message = "Hello Droidcon!"
),
Entry.Text(
Entry.Text(
githubUserName = "renclav",
message = "Hello Droidcon!"
),
Expand Down Expand Up @@ -74,7 +75,6 @@ Entry.Text(
githubUserName = "emepox",
message = "This is my first time in the London Droidcon! I'm very happy to be here!"
),

Entry.Text(
githubUserName = "freedomchuks",
message = "Freedom was here! mama i made it"
Expand Down Expand Up @@ -292,7 +292,6 @@ Entry.Text(
githubUserName = "berovikaki",
message = "So happy to be here!"
),

Entry.Text(
githubUserName = "aallam",
message = "Hello from Paris 🥖"
Expand All @@ -318,17 +317,24 @@ Entry.Text(
githubUserName = "stewemetal",
content = { DroidconLondonHalloweenSpecial() }
),

Entry.ComposableContent(
githubUserName = "wisors",
content = { MagicButton() }
),
Entry.Image(
githubUserName = "Kaaveh",
path = "kaaveh.jpg",
),
Entry.Text(
githubUserName = "Karambar",
message = "Having amazing time at DroidCon London! 🎉🤙"
),

Entry.Text(
githubUserName = "katekatjuchka",
message = "It is an amazing conference, kudos to the organisers, Happy Friday!"
),

Entry.Text(
githubUserName = "gabrielrodriguez2746",
message = "Bumble give me the voucher! 🤙🤙"
Expand All @@ -347,5 +353,42 @@ Entry.Text(
githubUserName = "michaeltweed",
message = "Great speaking to everyone at the booth'"
),
Entry.Text(
githubUserName = "arj154",
message = "Happy Friday"
),

Entry.Text(
githubUserName = "oheyadam",
message = "Zsolt made me do it"
),
Entry.Text(
githubUserName = "ericdecanini",
message = "Mike is a legend (he didn't make me say this)"
),
Entry.Text(
githubUserName = "VladislavAlfredov",
message = "Woot! Hi at DroidCon!"
),
Entry.Text(
githubUserName = "gaelmarhic",
message = "Make the first move!"
),
Entry.Text(
githubUserName = "JuliaSotola",
message = "Make the world a better place!"
),
Entry.Text(
githubUserName = "battagliandrea",
message = "Houston we have a problem"
),
Entry.Text(
githubUserName = "MovementSpeed",
message = "I am that italian guy"
),
Entry.Text(
githubUserName = "vyguera",
message = "3, 2, 1: Code!"
),
)

Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
@file:Suppress("MagicNumber")
package com.bumble.livemosaic.participant

import androidx.compose.animation.animateColorAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import kotlinx.coroutines.delay
import kotlin.random.Random

@Composable
fun MagicButton(modifier: Modifier = Modifier) {
// Generate random colors
fun randomColor(): Color = Color(
red = Random.nextInt(256),
green = Random.nextInt(256),
blue = Random.nextInt(256)
)

var bgColor by remember { mutableStateOf(randomColor()) }
var textColor by remember { mutableStateOf(randomColor()) }
// Animate color transition
val animatedBgColor by animateColorAsState(targetValue = bgColor, animationSpec = tween(1000))
val animatedTextColor by animateColorAsState(
targetValue = textColor,
animationSpec = tween(1000)
)
LaunchedEffect(Unit) {
// Change color every 1 second
while (true) {
delay(1000) // wait for 1 second
bgColor = randomColor()
textColor = randomColor()
}
}
val uriHandler = LocalUriHandler.current
Column(
modifier = modifier.fillMaxSize().background(Color.White),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Box(
modifier = Modifier
.fillMaxSize()
.padding(32.dp)
.clip(shape = RoundedCornerShape(8.dp, 8.dp, 8.dp, 8.dp))
.background(animatedBgColor)
.clickable {
// Redirect to the website
uriHandler.openUri("https://bumble-tech.github.io/appyx/")
},
contentAlignment = Alignment.Center
) {
Text(
text = "Click me!",
color = animatedTextColor,
fontSize = 22.sp,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Center,
modifier = Modifier.padding(16.dp).alpha(1f).align(Alignment.Center)
)
}

}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 545dcb0

Please sign in to comment.