From cc5c19dd277f143ac155b327843f809953ba2390 Mon Sep 17 00:00:00 2001 From: sunghyun Date: Tue, 13 Aug 2024 13:15:52 +0900 Subject: [PATCH 1/7] [feature/DroidKaigi#113] Apply profile card card screen design roughly --- .../confsched/model/ProfileCardTheme.kt | 2 +- .../composeResources/drawable/icon_qr.png | Bin 0 -> 18178 bytes .../composeResources/drawable/icon_share.png | Bin 0 -> 311 bytes .../composeResources/values-ja/strings.xml | 2 +- .../composeResources/values/strings.xml | 2 +- .../confsched/profilecard/FlipCard.kt | 134 ++++++++++++++++++ .../profilecard/ProfileCardScreen.kt | 88 ++++++++++-- 7 files changed, 214 insertions(+), 14 deletions(-) create mode 100644 feature/profilecard/src/commonMain/composeResources/drawable/icon_qr.png create mode 100644 feature/profilecard/src/commonMain/composeResources/drawable/icon_share.png create mode 100644 feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/ProfileCardTheme.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/ProfileCardTheme.kt index 83a28cc1c..c83be10dc 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/ProfileCardTheme.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/ProfileCardTheme.kt @@ -1,5 +1,5 @@ package io.github.droidkaigi.confsched.model enum class ProfileCardTheme { - Default, + Default, ORANGE, YELLOW, PINK, BLUE, WHITE } diff --git a/feature/profilecard/src/commonMain/composeResources/drawable/icon_qr.png b/feature/profilecard/src/commonMain/composeResources/drawable/icon_qr.png new file mode 100644 index 0000000000000000000000000000000000000000..a5882f2bde1beda85777e60a0e9678146b4d3805 GIT binary patch literal 18178 zcmZr%Ra6_@7RKF*l;ZAI+@0d?4h4dTLU1i^#VxoMw^BSnaSiS+MT@)J<$u2qGiN1h zTtZ3Z`b9^x*vif{mn#Bn-^&c=YG5h%hj+U=W%9Ubh-JeZ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@PM24y{A3uH zbw~)ags){-)^bcK+5Y^@Wmb9DKF)&Y&9hYMXFBdnjdVS)%%UJtMN)E%l*NY1EBg)T z(MZj)91MRGKV=z0`AkVP$?Zm?(@j4~m|aAl#NBmScIlVyYiHRWCxr5J$(TwU%mOnV z*P4*B%^3ws+gWKgS|~CT%*w&@+02C1MPwy$_m$PPJa<8In69$Y71-6@zW(I+C9zI> zHzz<>{bm1vS(e~s$$%TM0jmvXELOGw|KGs|0dBy$!Uh3uz`DW)0dBy$!Uh3uz`DW) k0dBy$!Uh3uz`DZ!14JNPgv*%%zW@LL07*qoM6N<$f@W`MO8@`> literal 0 HcmV?d00001 diff --git a/feature/profilecard/src/commonMain/composeResources/drawable/icon_share.png b/feature/profilecard/src/commonMain/composeResources/drawable/icon_share.png new file mode 100644 index 0000000000000000000000000000000000000000..690c2612c6320ed5ba5c6e9c0988106e7c0202e9 GIT binary patch literal 311 zcmeAS@N?(olHy`uVBq!ia0vp^!ayvF+B?o$RCi-j29qs)g79U{H zA#dg2cveNd@cfQX`r$MDPO{joOq_E!O}TGNb9R18tNls=uk}ae*3IQ!J^KuA;*Q!a zQYk?nA8T*@sHlEW>EoUUSqlz?r_>g`HSv7RYrxUIrFBz~|KTNJ(SJ|uI67aV#qfrp zjYPWabcy|stv{Zr;ATD99j74ATyA{rk?g7XfJyqNcbP@7E)ens`isHS)z4*}Q$iB} DV - !!Please remove this resource when you add string resource!! + プロフィールカード diff --git a/feature/profilecard/src/commonMain/composeResources/values/strings.xml b/feature/profilecard/src/commonMain/composeResources/values/strings.xml index 8f3723939..eace07bed 100644 --- a/feature/profilecard/src/commonMain/composeResources/values/strings.xml +++ b/feature/profilecard/src/commonMain/composeResources/values/strings.xml @@ -1,4 +1,4 @@ - !!Please remove this resource when you add string resource!! + Profile Card diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt new file mode 100644 index 000000000..5dd26ce51 --- /dev/null +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt @@ -0,0 +1,134 @@ +package io.github.droidkaigi.confsched.profilecard + +import androidx.compose.animation.core.FastOutSlowInEasing +import androidx.compose.animation.core.animateFloatAsState +import androidx.compose.animation.core.tween +import androidx.compose.foundation.Image +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.CircleShape +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Text +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.graphicsLayer +import androidx.compose.ui.unit.dp +import conference_app_2024.feature.profilecard.generated.resources.icon_qr +import io.github.droidkaigi.confsched.model.ProfileCardTheme.BLUE +import io.github.droidkaigi.confsched.model.ProfileCardTheme.Default +import io.github.droidkaigi.confsched.model.ProfileCardTheme.ORANGE +import io.github.droidkaigi.confsched.model.ProfileCardTheme.PINK +import io.github.droidkaigi.confsched.model.ProfileCardTheme.WHITE +import io.github.droidkaigi.confsched.model.ProfileCardTheme.YELLOW +import io.github.droidkaigi.confsched.ui.rememberAsyncImagePainter +import kotlinx.coroutines.delay +import org.jetbrains.compose.resources.painterResource + +@Composable +internal fun FlipCard( + uiState: ProfileCardUiState.Card, + modifier: Modifier = Modifier, + isCreated: Boolean = false +) { + var isFlipped by remember { mutableStateOf(false) } + var initialRotation by remember { mutableStateOf(0f) } + val rotation = animateFloatAsState( + targetValue = if (isFlipped) 180f else initialRotation, + animationSpec = tween( + durationMillis = 400, + easing = FastOutSlowInEasing, + ), + ) + val targetRotation = animateFloatAsState( + targetValue = 30f, + animationSpec = tween( + durationMillis = 400, + easing = FastOutSlowInEasing, + ), + ).value + val targetRotation2 = animateFloatAsState( + targetValue = 0f, + animationSpec = tween( + durationMillis = 400, + easing = FastOutSlowInEasing, + ), + ).value + + LaunchedEffect(Unit) { + if (isCreated) { + initialRotation = targetRotation + delay(400) + initialRotation = targetRotation2 + } + } + + Card( + modifier = modifier + .size(width = 300.dp, height = 380.dp) + .clickable { isFlipped = !isFlipped } + .graphicsLayer { + rotationY = rotation.value + cameraDistance = 12f * density + }, + colors = CardDefaults.cardColors( + containerColor = when (uiState.theme) { + Default -> Color(0xFFC0FF8E) + ORANGE -> Color(0xFFFFBB69) + YELLOW -> Color(0xFFFFFA77) + PINK -> Color(0xFFFFA0C9) + BLUE -> Color(0xFF93E5FF) + WHITE -> Color.White + } + ), + elevation = CardDefaults.cardElevation(10.dp) + ) { + if (isFlipped) { // Back + Column( + modifier = Modifier + .fillMaxSize() + .graphicsLayer { + rotationY = 180f + }, + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, + ) { + Image( + painter = painterResource(ProfileCardRes.drawable.icon_qr), + contentDescription = null, + modifier = Modifier.size(160.dp), + ) + } + } else { // Front + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, + ) { + Image( + painter = rememberAsyncImagePainter(uiState.imageUri ?: ""), + contentDescription = null, + modifier = Modifier + .clip(CircleShape) + .size(120.dp), + ) + Spacer(Modifier.height(12.dp)) + Text( + text = uiState.occupation ?: "", + style = MaterialTheme.typography.titleMedium, + color = Color.Black, + ) + Spacer(Modifier.height(2.dp)) + Text( + text = uiState.nickname, + style = MaterialTheme.typography.headlineSmall, + color = Color.Black, + ) + } + } + } +} diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt index e2acf902e..4507a38d9 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt @@ -1,13 +1,22 @@ package io.github.droidkaigi.confsched.profilecard +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.CircularProgressIndicator +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Scaffold import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState @@ -20,19 +29,31 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.platform.testTag +import androidx.compose.ui.unit.dp import androidx.navigation.NavController import androidx.navigation.NavGraph.Companion.findStartDestination import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable +import conference_app_2024.feature.profilecard.generated.resources.icon_share +import conference_app_2024.feature.profilecard.generated.resources.profile_card import io.github.droidkaigi.confsched.compose.EventEmitter import io.github.droidkaigi.confsched.compose.rememberEventEmitter import io.github.droidkaigi.confsched.model.ProfileCard import io.github.droidkaigi.confsched.model.ProfileCardTheme +import io.github.droidkaigi.confsched.model.ProfileCardTheme.BLUE +import io.github.droidkaigi.confsched.model.ProfileCardTheme.Default +import io.github.droidkaigi.confsched.model.ProfileCardTheme.ORANGE +import io.github.droidkaigi.confsched.model.ProfileCardTheme.PINK +import io.github.droidkaigi.confsched.model.ProfileCardTheme.WHITE +import io.github.droidkaigi.confsched.model.ProfileCardTheme.YELLOW import io.github.droidkaigi.confsched.profilecard.ProfileCardUiState.Edit import io.github.droidkaigi.confsched.ui.SnackbarMessageEffect import io.github.droidkaigi.confsched.ui.UserMessageStateHolder +import org.jetbrains.compose.resources.painterResource +import org.jetbrains.compose.resources.stringResource const val profileCardScreenRoute = "profilecard" @@ -169,7 +190,11 @@ internal fun ProfileCardScreen( onClickReset = { eventEmitter.tryEmit(CardScreenEvent.Reset) }, + onClickShareProfileCard = { + eventEmitter.tryEmit(CardScreenEvent.ShareProfileCard) + }, contentPadding = padding, + isCreated = true, ) } } @@ -249,24 +274,65 @@ internal fun EditScreen( internal fun CardScreen( uiState: ProfileCardUiState.Card, onClickReset: () -> Unit, + onClickShareProfileCard: () -> Unit, modifier: Modifier = Modifier, - contentPadding: PaddingValues = PaddingValues(), + isCreated: Boolean = false, + contentPadding: PaddingValues = PaddingValues(16.dp), ) { Column( modifier = modifier + .fillMaxSize() + .background( + color = when (uiState.theme) { + Default -> Color(0xFFB4FF79) + ORANGE -> Color(0xFFFEB258) + YELLOW -> Color(0xFFFCF65F) + PINK -> Color(0xFF6FD7F8) + BLUE -> Color(0xFFB4FF79) + WHITE -> Color(0xFFF9F9F9) + } + ) .testTag(ProfileCardTestTag.CardScreen.SCREEN) .padding(contentPadding), ) { - Text("ProfileCard") - Text(uiState.nickname) - if (uiState.occupation != null) { - Text(uiState.occupation) - } - if (uiState.link != null) { - Text(uiState.link) - } - Button(onClickReset) { - Text("Reset") + Text( + text = stringResource(ProfileCardRes.string.profile_card), + style = MaterialTheme.typography.headlineSmall, + color = Color.Black, + modifier = Modifier.fillMaxWidth().padding(16.dp), + ) + Spacer(Modifier.height(72.dp)) + FlipCard( + uiState = uiState, + modifier = Modifier.align(Alignment.CenterHorizontally), + isCreated = isCreated, + ) + Spacer(Modifier.height(44.dp)) + Button( + onClick = { onClickShareProfileCard() }, + colors = ButtonDefaults.buttonColors(containerColor = Color(0xFFFFFFFF)), + contentPadding = PaddingValues(vertical = 10.dp), + modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp), + ) { + Icon( + painter = painterResource(ProfileCardRes.drawable.icon_share), + contentDescription = "Share", + tint = Color.Black, + modifier = Modifier.size(18.dp), + ) + Spacer(Modifier.width(8.dp)) + Text( + text = "共有する", + style = MaterialTheme.typography.labelLarge, + color = Color.Black, + ) } + Spacer(Modifier.height(18.dp)) + Text( + text = "編集する", + style = MaterialTheme.typography.labelLarge, + color = Color.Black, + modifier = Modifier.align(Alignment.CenterHorizontally), + ) } } From c0ae065d074a32a9875c4fda75545b5c1296503c Mon Sep 17 00:00:00 2001 From: sunghyun Date: Tue, 13 Aug 2024 13:21:15 +0900 Subject: [PATCH 2/7] [feature/DroidKaigi#113] Apply detekt --- .../confsched/profilecard/FlipCard.kt | 20 ++++++++++++++----- .../profilecard/ProfileCardScreen.kt | 7 +++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt index 5dd26ce51..5f358b364 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt @@ -5,13 +5,23 @@ import androidx.compose.animation.core.animateFloatAsState import androidx.compose.animation.core.tween import androidx.compose.foundation.Image import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text -import androidx.compose.runtime.* +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.clip @@ -33,7 +43,7 @@ import org.jetbrains.compose.resources.painterResource internal fun FlipCard( uiState: ProfileCardUiState.Card, modifier: Modifier = Modifier, - isCreated: Boolean = false + isCreated: Boolean = false, ) { var isFlipped by remember { mutableStateOf(false) } var initialRotation by remember { mutableStateOf(0f) } @@ -83,9 +93,9 @@ internal fun FlipCard( PINK -> Color(0xFFFFA0C9) BLUE -> Color(0xFF93E5FF) WHITE -> Color.White - } + }, ), - elevation = CardDefaults.cardElevation(10.dp) + elevation = CardDefaults.cardElevation(10.dp), ) { if (isFlipped) { // Back Column( diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt index 4507a38d9..efd010281 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt @@ -1,6 +1,7 @@ package io.github.droidkaigi.confsched.profilecard import androidx.compose.foundation.background +import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.PaddingValues @@ -290,7 +291,7 @@ internal fun CardScreen( PINK -> Color(0xFF6FD7F8) BLUE -> Color(0xFFB4FF79) WHITE -> Color(0xFFF9F9F9) - } + }, ) .testTag(ProfileCardTestTag.CardScreen.SCREEN) .padding(contentPadding), @@ -332,7 +333,9 @@ internal fun CardScreen( text = "編集する", style = MaterialTheme.typography.labelLarge, color = Color.Black, - modifier = Modifier.align(Alignment.CenterHorizontally), + modifier = Modifier + .align(Alignment.CenterHorizontally) + .clickable { onClickReset() }, // Is onClickReset located here? ) } } From f2cab07d20c4937d4b39d40c974da20ac8fafbe5 Mon Sep 17 00:00:00 2001 From: sunghyun Date: Tue, 13 Aug 2024 14:59:45 +0900 Subject: [PATCH 3/7] [feature/DroidKaigi#113] Apply Theme --- .../theme/ProfileCardScreenTheme.kt | 69 ++++++++++ .../confsched/model/ProfileCardTheme.kt | 2 +- .../confsched/profilecard/FlipCard.kt | 121 ++++++++---------- .../profilecard/ProfileCardScreen.kt | 101 +++++++-------- 4 files changed, 170 insertions(+), 123 deletions(-) create mode 100644 core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt diff --git a/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt b/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt new file mode 100644 index 000000000..8e44e468d --- /dev/null +++ b/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt @@ -0,0 +1,69 @@ +package io.github.droidkaigi.confsched.designsystem.theme + +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.ProvidableCompositionLocal +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.graphics.Color + +sealed interface ProfileCardScreenTheme { + data object Default : ProfileCardScreenTheme { + override val primaryColor = Color(0xFFB4FF79) + override val containerColor = Color(0xFFC0FF8E) + } + + data object Orange : ProfileCardScreenTheme { + override val primaryColor = Color(0xFFFEB258) + override val containerColor = Color(0xFFFFBB69) + } + + data object Yellow : ProfileCardScreenTheme { + override val primaryColor = Color(0xFFFCF65F) + override val containerColor = Color(0xFFFFFA77) + } + + data object Pink : ProfileCardScreenTheme { + override val primaryColor = Color(0xFF6FD7F8) + override val containerColor = Color(0xFFFFA0C9) + } + + data object Blue : ProfileCardScreenTheme { + override val primaryColor = Color(0xFFB4FF79) + override val containerColor = Color(0xFF93E5FF) + } + + data object White : ProfileCardScreenTheme { + override val primaryColor = Color(0xFFF9F9F9) + override val containerColor = Color.White + } + + val primaryColor: Color + val containerColor: Color + + companion object { + fun ofOrNull(profileCardTheme: String): ProfileCardScreenTheme? { + return when (profileCardTheme) { + "Default" -> Default + "Orange" -> Orange + "Yellow" -> Yellow + "Pink" -> Pink + "Blue" -> Blue + "White" -> White + else -> null + } + } + } +} + +@Suppress("CompositionLocalAllowlist") +val LocalProfileCardScreenTheme: ProvidableCompositionLocal = staticCompositionLocalOf { + error("No RoomTheme provided") +} + +@Composable +fun ProvideProfileCardScreenTheme(profileCardTheme: String, content: @Composable () -> Unit) { + val roomTheme = ProfileCardScreenTheme.ofOrNull(profileCardTheme) ?: ProfileCardScreenTheme.Default + CompositionLocalProvider(LocalProfileCardScreenTheme provides roomTheme) { + content() + } +} diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/ProfileCardTheme.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/ProfileCardTheme.kt index c83be10dc..398a55488 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/ProfileCardTheme.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched/model/ProfileCardTheme.kt @@ -1,5 +1,5 @@ package io.github.droidkaigi.confsched.model enum class ProfileCardTheme { - Default, ORANGE, YELLOW, PINK, BLUE, WHITE + Default, Orange, Yellow, Pink, Blue, White } diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt index 5f358b364..000b7c25f 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt @@ -29,12 +29,8 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.unit.dp import conference_app_2024.feature.profilecard.generated.resources.icon_qr -import io.github.droidkaigi.confsched.model.ProfileCardTheme.BLUE -import io.github.droidkaigi.confsched.model.ProfileCardTheme.Default -import io.github.droidkaigi.confsched.model.ProfileCardTheme.ORANGE -import io.github.droidkaigi.confsched.model.ProfileCardTheme.PINK -import io.github.droidkaigi.confsched.model.ProfileCardTheme.WHITE -import io.github.droidkaigi.confsched.model.ProfileCardTheme.YELLOW +import io.github.droidkaigi.confsched.designsystem.theme.LocalProfileCardScreenTheme +import io.github.droidkaigi.confsched.designsystem.theme.ProvideProfileCardScreenTheme import io.github.droidkaigi.confsched.ui.rememberAsyncImagePainter import kotlinx.coroutines.delay import org.jetbrains.compose.resources.painterResource @@ -77,67 +73,60 @@ internal fun FlipCard( } } - Card( - modifier = modifier - .size(width = 300.dp, height = 380.dp) - .clickable { isFlipped = !isFlipped } - .graphicsLayer { - rotationY = rotation.value - cameraDistance = 12f * density - }, - colors = CardDefaults.cardColors( - containerColor = when (uiState.theme) { - Default -> Color(0xFFC0FF8E) - ORANGE -> Color(0xFFFFBB69) - YELLOW -> Color(0xFFFFFA77) - PINK -> Color(0xFFFFA0C9) - BLUE -> Color(0xFF93E5FF) - WHITE -> Color.White - }, - ), - elevation = CardDefaults.cardElevation(10.dp), - ) { - if (isFlipped) { // Back - Column( - modifier = Modifier - .fillMaxSize() - .graphicsLayer { - rotationY = 180f - }, - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.Center, - ) { - Image( - painter = painterResource(ProfileCardRes.drawable.icon_qr), - contentDescription = null, - modifier = Modifier.size(160.dp), - ) - } - } else { // Front - Column( - modifier = Modifier.fillMaxSize(), - horizontalAlignment = Alignment.CenterHorizontally, - verticalArrangement = Arrangement.Center, - ) { - Image( - painter = rememberAsyncImagePainter(uiState.imageUri ?: ""), - contentDescription = null, + ProvideProfileCardScreenTheme(uiState.theme.toString()) { + Card( + modifier = modifier + .size(width = 300.dp, height = 380.dp) + .clickable { isFlipped = !isFlipped } + .graphicsLayer { + rotationY = rotation.value + cameraDistance = 12f * density + }, + colors = CardDefaults.cardColors(containerColor = LocalProfileCardScreenTheme.current.containerColor), + elevation = CardDefaults.cardElevation(10.dp), + ) { + if (isFlipped) { // Back + Column( modifier = Modifier - .clip(CircleShape) - .size(120.dp), - ) - Spacer(Modifier.height(12.dp)) - Text( - text = uiState.occupation ?: "", - style = MaterialTheme.typography.titleMedium, - color = Color.Black, - ) - Spacer(Modifier.height(2.dp)) - Text( - text = uiState.nickname, - style = MaterialTheme.typography.headlineSmall, - color = Color.Black, - ) + .fillMaxSize() + .graphicsLayer { + rotationY = 180f + }, + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, + ) { + Image( + painter = painterResource(ProfileCardRes.drawable.icon_qr), + contentDescription = null, + modifier = Modifier.size(160.dp), + ) + } + } else { // Front + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, + ) { + Image( + painter = rememberAsyncImagePainter(uiState.imageUri ?: ""), + contentDescription = null, + modifier = Modifier + .clip(CircleShape) + .size(120.dp), + ) + Spacer(Modifier.height(12.dp)) + Text( + text = uiState.occupation ?: "", + style = MaterialTheme.typography.titleMedium, + color = Color.Black, + ) + Spacer(Modifier.height(2.dp)) + Text( + text = uiState.nickname, + style = MaterialTheme.typography.headlineSmall, + color = Color.Black, + ) + } } } } diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt index efd010281..bc17c08b8 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt @@ -42,14 +42,10 @@ import conference_app_2024.feature.profilecard.generated.resources.icon_share import conference_app_2024.feature.profilecard.generated.resources.profile_card import io.github.droidkaigi.confsched.compose.EventEmitter import io.github.droidkaigi.confsched.compose.rememberEventEmitter +import io.github.droidkaigi.confsched.designsystem.theme.LocalProfileCardScreenTheme +import io.github.droidkaigi.confsched.designsystem.theme.ProvideProfileCardScreenTheme import io.github.droidkaigi.confsched.model.ProfileCard import io.github.droidkaigi.confsched.model.ProfileCardTheme -import io.github.droidkaigi.confsched.model.ProfileCardTheme.BLUE -import io.github.droidkaigi.confsched.model.ProfileCardTheme.Default -import io.github.droidkaigi.confsched.model.ProfileCardTheme.ORANGE -import io.github.droidkaigi.confsched.model.ProfileCardTheme.PINK -import io.github.droidkaigi.confsched.model.ProfileCardTheme.WHITE -import io.github.droidkaigi.confsched.model.ProfileCardTheme.YELLOW import io.github.droidkaigi.confsched.profilecard.ProfileCardUiState.Edit import io.github.droidkaigi.confsched.ui.SnackbarMessageEffect import io.github.droidkaigi.confsched.ui.UserMessageStateHolder @@ -280,62 +276,55 @@ internal fun CardScreen( isCreated: Boolean = false, contentPadding: PaddingValues = PaddingValues(16.dp), ) { - Column( - modifier = modifier - .fillMaxSize() - .background( - color = when (uiState.theme) { - Default -> Color(0xFFB4FF79) - ORANGE -> Color(0xFFFEB258) - YELLOW -> Color(0xFFFCF65F) - PINK -> Color(0xFF6FD7F8) - BLUE -> Color(0xFFB4FF79) - WHITE -> Color(0xFFF9F9F9) - }, - ) - .testTag(ProfileCardTestTag.CardScreen.SCREEN) - .padding(contentPadding), - ) { - Text( - text = stringResource(ProfileCardRes.string.profile_card), - style = MaterialTheme.typography.headlineSmall, - color = Color.Black, - modifier = Modifier.fillMaxWidth().padding(16.dp), - ) - Spacer(Modifier.height(72.dp)) - FlipCard( - uiState = uiState, - modifier = Modifier.align(Alignment.CenterHorizontally), - isCreated = isCreated, - ) - Spacer(Modifier.height(44.dp)) - Button( - onClick = { onClickShareProfileCard() }, - colors = ButtonDefaults.buttonColors(containerColor = Color(0xFFFFFFFF)), - contentPadding = PaddingValues(vertical = 10.dp), - modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp), + ProvideProfileCardScreenTheme(uiState.theme.toString()) { + Column( + modifier = modifier + .fillMaxSize() + .background(LocalProfileCardScreenTheme.current.primaryColor) + .testTag(ProfileCardTestTag.CardScreen.SCREEN) + .padding(contentPadding), ) { - Icon( - painter = painterResource(ProfileCardRes.drawable.icon_share), - contentDescription = "Share", - tint = Color.Black, - modifier = Modifier.size(18.dp), + Text( + text = stringResource(ProfileCardRes.string.profile_card), + style = MaterialTheme.typography.headlineSmall, + color = Color.Black, + modifier = Modifier.fillMaxWidth().padding(16.dp), ) - Spacer(Modifier.width(8.dp)) + Spacer(Modifier.height(72.dp)) + FlipCard( + uiState = uiState, + modifier = Modifier.align(Alignment.CenterHorizontally), + isCreated = isCreated, + ) + Spacer(Modifier.height(44.dp)) + Button( + onClick = { onClickShareProfileCard() }, + colors = ButtonDefaults.buttonColors(containerColor = Color.White), + contentPadding = PaddingValues(vertical = 10.dp), + modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp), + ) { + Icon( + painter = painterResource(ProfileCardRes.drawable.icon_share), + contentDescription = "Share", + tint = Color.Black, + modifier = Modifier.size(18.dp), + ) + Spacer(Modifier.width(8.dp)) + Text( + text = "共有する", + style = MaterialTheme.typography.labelLarge, + color = Color.Black, + ) + } + Spacer(Modifier.height(18.dp)) Text( - text = "共有する", + text = "編集する", style = MaterialTheme.typography.labelLarge, color = Color.Black, + modifier = Modifier + .align(Alignment.CenterHorizontally) + .clickable { onClickReset() }, // Is onClickReset located here? ) } - Spacer(Modifier.height(18.dp)) - Text( - text = "編集する", - style = MaterialTheme.typography.labelLarge, - color = Color.Black, - modifier = Modifier - .align(Alignment.CenterHorizontally) - .clickable { onClickReset() }, // Is onClickReset located here? - ) } } From c7594a60638ebedc093951a54df0b803ec81b32c Mon Sep 17 00:00:00 2001 From: sunghyun Date: Tue, 13 Aug 2024 16:12:54 +0900 Subject: [PATCH 4/7] [feature/DroidKaigi#113] Latest Code Sync --- .../theme/ProfileCardScreenTheme.kt | 17 ++++++++--------- .../confsched/profilecard/FlipCard.kt | 5 ++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt b/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt index 8e44e468d..e265df187 100644 --- a/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt +++ b/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt @@ -43,13 +43,12 @@ sealed interface ProfileCardScreenTheme { companion object { fun ofOrNull(profileCardTheme: String): ProfileCardScreenTheme? { return when (profileCardTheme) { - "Default" -> Default - "Orange" -> Orange - "Yellow" -> Yellow - "Pink" -> Pink - "Blue" -> Blue - "White" -> White - else -> null + "Iguana" -> Default + "Hedgehog" -> Orange + "Giraffe" -> Yellow + "Flamingo" -> Pink + "Jellyfish" -> Blue + else -> White } } } @@ -62,8 +61,8 @@ val LocalProfileCardScreenTheme: ProvidableCompositionLocal Unit) { - val roomTheme = ProfileCardScreenTheme.ofOrNull(profileCardTheme) ?: ProfileCardScreenTheme.Default - CompositionLocalProvider(LocalProfileCardScreenTheme provides roomTheme) { + val profileCardTheme = ProfileCardScreenTheme.ofOrNull(profileCardTheme) ?: ProfileCardScreenTheme.Default + CompositionLocalProvider(LocalProfileCardScreenTheme provides profileCardTheme) { content() } } diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt index 000b7c25f..f782a3791 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/FlipCard.kt @@ -21,6 +21,7 @@ import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember +import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -42,6 +43,7 @@ internal fun FlipCard( isCreated: Boolean = false, ) { var isFlipped by remember { mutableStateOf(false) } + var isCreated by rememberSaveable { mutableStateOf(isCreated) } var initialRotation by remember { mutableStateOf(0f) } val rotation = animateFloatAsState( targetValue = if (isFlipped) 180f else initialRotation, @@ -70,6 +72,7 @@ internal fun FlipCard( initialRotation = targetRotation delay(400) initialRotation = targetRotation2 + isCreated = false } } @@ -108,7 +111,7 @@ internal fun FlipCard( verticalArrangement = Arrangement.Center, ) { Image( - painter = rememberAsyncImagePainter(uiState.imageUri ?: ""), + painter = rememberAsyncImagePainter(uiState.image ?: ""), contentDescription = null, modifier = Modifier .clip(CircleShape) From e1892b92450713d05f0245db9818e974a32fab4c Mon Sep 17 00:00:00 2001 From: sunghyun Date: Tue, 13 Aug 2024 16:51:38 +0900 Subject: [PATCH 5/7] [feature/DroidKaigi#113] Apply detekt --- .../confsched/designsystem/theme/ProfileCardScreenTheme.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt b/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt index e265df187..4e9daeb5b 100644 --- a/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt +++ b/core/designsystem/src/commonMain/kotlin/io/github/droidkaigi/confsched/designsystem/theme/ProfileCardScreenTheme.kt @@ -55,9 +55,10 @@ sealed interface ProfileCardScreenTheme { } @Suppress("CompositionLocalAllowlist") -val LocalProfileCardScreenTheme: ProvidableCompositionLocal = staticCompositionLocalOf { - error("No RoomTheme provided") -} +val LocalProfileCardScreenTheme: ProvidableCompositionLocal = + staticCompositionLocalOf { + error("No RoomTheme provided") + } @Composable fun ProvideProfileCardScreenTheme(profileCardTheme: String, content: @Composable () -> Unit) { From d44fbf1be414b70c9fbfd9b213098a4696f55f97 Mon Sep 17 00:00:00 2001 From: sunghyun Date: Tue, 13 Aug 2024 18:59:57 +0900 Subject: [PATCH 6/7] [feature/DroidKaigi#113] Fix ScreenShotTest Error --- .../droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/feature/profilecard/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt b/feature/profilecard/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt index 9984fc4b9..f191a1559 100644 --- a/feature/profilecard/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt +++ b/feature/profilecard/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt @@ -82,6 +82,7 @@ class ProfileCardScreenTest( } itShould("show edit screen") { captureScreenWithChecks { + wait5Seconds() checkEditScreenDisplayed() checkNickName(nickName) checkOccupation(occupation) From f9b5d28eed41bf2cd35e8f49035b2bba62489fae Mon Sep 17 00:00:00 2001 From: sunghyun Date: Wed, 14 Aug 2024 10:37:45 +0900 Subject: [PATCH 7/7] [feature/DroidKaigi#113] Fix ScreenShotTest Error --- .../profilecard/ProfileCardScreenTest.kt | 1 - .../profilecard/ProfileCardScreen.kt | 64 ++++++++++--------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/feature/profilecard/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt b/feature/profilecard/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt index f191a1559..9984fc4b9 100644 --- a/feature/profilecard/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt +++ b/feature/profilecard/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreenTest.kt @@ -82,7 +82,6 @@ class ProfileCardScreenTest( } itShould("show edit screen") { captureScreenWithChecks { - wait5Seconds() checkEditScreenDisplayed() checkNickName(nickName) checkOccupation(occupation) diff --git a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt index c6ba97093..10df21bfb 100644 --- a/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt +++ b/feature/profilecard/src/commonMain/kotlin/io/github/droidkaigi/confsched/profilecard/ProfileCardScreen.kt @@ -2,6 +2,7 @@ package io.github.droidkaigi.confsched.profilecard 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.PaddingValues @@ -265,44 +266,47 @@ internal fun CardScreen( text = stringResource(ProfileCardRes.string.profile_card), style = MaterialTheme.typography.headlineSmall, color = Color.Black, - modifier = Modifier.fillMaxWidth().padding(16.dp), + modifier = Modifier.fillMaxWidth().padding(start = 16.dp, top = 16.dp), ) - Spacer(Modifier.height(72.dp)) - FlipCard( - uiState = uiState, - modifier = Modifier.align(Alignment.CenterHorizontally), - isCreated = isCreated, - ) - Spacer(Modifier.height(44.dp)) - Button( - onClick = { onClickShareProfileCard() }, - colors = ButtonDefaults.buttonColors(containerColor = Color.White), - contentPadding = PaddingValues(vertical = 10.dp), - modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp), + Column( + modifier = Modifier.fillMaxSize(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center, ) { - Icon( - painter = painterResource(ProfileCardRes.drawable.icon_share), - contentDescription = "Share", - tint = Color.Black, - modifier = Modifier.size(18.dp), + FlipCard( + uiState = uiState, + isCreated = isCreated, ) - Spacer(Modifier.width(8.dp)) + Spacer(Modifier.height(32.dp)) + Button( + onClick = { onClickShareProfileCard() }, + colors = ButtonDefaults.buttonColors(containerColor = Color.White), + contentPadding = PaddingValues(vertical = 10.dp), + modifier = Modifier.fillMaxWidth().padding(horizontal = 16.dp), + ) { + Icon( + painter = painterResource(ProfileCardRes.drawable.icon_share), + contentDescription = "Share", + tint = Color.Black, + modifier = Modifier.size(18.dp), + ) + Spacer(Modifier.width(8.dp)) + Text( + text = "共有する", + style = MaterialTheme.typography.labelLarge, + color = Color.Black, + ) + } + Spacer(Modifier.height(9.dp)) Text( - text = "共有する", + text = "編集する", style = MaterialTheme.typography.labelLarge, color = Color.Black, + modifier = Modifier + .clickable { onClickEdit() } + .testTag(ProfileCardEditButtonTestTag), ) } - Spacer(Modifier.height(18.dp)) - Text( - text = "編集する", - style = MaterialTheme.typography.labelLarge, - color = Color.Black, - modifier = Modifier - .align(Alignment.CenterHorizontally) - .clickable { onClickEdit() } - .testTag(ProfileCardEditButtonTestTag), - ) } } }