From 837540df376e8b4265af9496118003e0f74fe0f3 Mon Sep 17 00:00:00 2001 From: buna Date: Sat, 8 Jun 2024 19:10:11 +0900 Subject: [PATCH 1/8] =?UTF-8?q?feat:=20TagChip=20Preview=20=EA=B5=AC?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/feature/session/component/SessionChip.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/feature/session/src/main/java/com/droidknights/app/feature/session/component/SessionChip.kt b/feature/session/src/main/java/com/droidknights/app/feature/session/component/SessionChip.kt index 3bee6640..502be128 100644 --- a/feature/session/src/main/java/com/droidknights/app/feature/session/component/SessionChip.kt +++ b/feature/session/src/main/java/com/droidknights/app/feature/session/component/SessionChip.kt @@ -80,6 +80,12 @@ internal class RoomPreviewParameterProvider : PreviewParameterProvider { ) } +@Preview +@Composable +private fun TagChipPreview() { + TagChip(Tag("Android")) +} + @Preview @Composable fun TrackChipPreview( From 6650e2af256f7693592eba8b7d30b873db03f479 Mon Sep 17 00:00:00 2001 From: buna Date: Sat, 8 Jun 2024 19:20:20 +0900 Subject: [PATCH 2/8] =?UTF-8?q?feat:=20SessionTopAppBar=20Preview=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../session/component/SessionTopAppBar.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/feature/session/src/main/java/com/droidknights/app/feature/session/component/SessionTopAppBar.kt b/feature/session/src/main/java/com/droidknights/app/feature/session/component/SessionTopAppBar.kt index 64f5ee84..05531d12 100644 --- a/feature/session/src/main/java/com/droidknights/app/feature/session/component/SessionTopAppBar.kt +++ b/feature/session/src/main/java/com/droidknights/app/feature/session/component/SessionTopAppBar.kt @@ -16,6 +16,7 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentSize +import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme @@ -45,6 +46,7 @@ import com.droidknights.app.core.ui.RoomText import com.droidknights.app.feature.session.R import com.droidknights.app.feature.session.model.SessionState import kotlinx.collections.immutable.PersistentList +import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.launch @@ -186,6 +188,21 @@ private fun Modifier.tabIndicatorOffset( .width(currentTabWidth) } +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) +@Composable +private fun SessionTopAppBarPreview() { + KnightsTheme { + SessionTopAppBar( + sessionState = SessionState( + sessions = persistentListOf(), + listState = rememberLazyListState() + ), + onBackClick = { } + ) + } +} + @Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) @Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) @Composable From 50b731888273340e4bc2c390bb5acbb46b1531f8 Mon Sep 17 00:00:00 2001 From: buna Date: Sat, 8 Jun 2024 19:34:11 +0900 Subject: [PATCH 3/8] =?UTF-8?q?refactor:=20ContributorCard=20=ED=95=A8?= =?UTF-8?q?=EC=88=98=EC=9D=98=20modifier=20=EC=9D=B8=EC=9E=90=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=EA=B0=92=EC=9D=84=20Modifier=EB=A1=9C=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/feature/contributor/component/ContributorCard.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt index 40073661..ce716cbe 100644 --- a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt +++ b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt @@ -27,7 +27,7 @@ import com.valentinilk.shimmer.shimmer @Composable internal fun ContributorCard( contributor: Contributor?, - modifier: Modifier, + modifier: Modifier = Modifier, ) { val uriHandler = LocalUriHandler.current val shimmerModifier = if (contributor == null) { From 098b4ef85e76adb193707e20541d78d51823c11e Mon Sep 17 00:00:00 2001 From: buna Date: Sat, 8 Jun 2024 19:36:05 +0900 Subject: [PATCH 4/8] =?UTF-8?q?feat:=20ContributorCard=20Preview=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contributor/component/ContributorCard.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt index ce716cbe..addd5a21 100644 --- a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt +++ b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt @@ -14,6 +14,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.droidknights.app.core.designsystem.component.KnightsCard import com.droidknights.app.core.designsystem.component.NetworkImage @@ -88,3 +89,18 @@ internal fun ContributorCard( } } } + +@Preview +@Composable +private fun ContributorCardPreview() { + KnightsTheme { + ContributorCard( + contributor = Contributor( + id = 1L, + name = "Droid Knights", + imageUrl = "", + githubUrl = "" + ), + ) + } +} From 413a330dfebaa298a897d100fbd71b644db75031 Mon Sep 17 00:00:00 2001 From: buna Date: Sat, 8 Jun 2024 19:38:24 +0900 Subject: [PATCH 5/8] =?UTF-8?q?feat:=20ContributorTopAppBar=20Preview=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/ContributorTopAppBar.kt | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorTopAppBar.kt b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorTopAppBar.kt index 5c00ce96..8325be39 100644 --- a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorTopAppBar.kt +++ b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorTopAppBar.kt @@ -1,13 +1,20 @@ package com.droidknights.app.feature.contributor.component +import android.content.res.Configuration import androidx.compose.animation.core.animateFloatAsState +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp import com.droidknights.app.core.designsystem.component.KnightsTopAppBar import com.droidknights.app.core.designsystem.component.TopAppBarNavigationType +import com.droidknights.app.core.designsystem.theme.KnightsTheme import com.droidknights.app.feature.contributor.R @Composable @@ -29,3 +36,24 @@ internal fun ContributorTopAppBar( containerColor = containerColor, ) } + +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) +@Composable +private fun ContributorTopAppBarPreview() { + KnightsTheme { + Column { + ContributorTopAppBar( + isAtTop = false, + onBackClick = {}, + ) + + Spacer(modifier = Modifier.padding(top = 20.dp)) + + ContributorTopAppBar( + isAtTop = true, + onBackClick = {}, + ) + } + } +} From 15b5d004641bc0e21f21b56a26df60857831d0a2 Mon Sep 17 00:00:00 2001 From: buna Date: Sat, 8 Jun 2024 19:41:14 +0900 Subject: [PATCH 6/8] =?UTF-8?q?feat:=20ContributorTopBanner=20Preview=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/ContributorTopBanner.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorTopBanner.kt b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorTopBanner.kt index ec059e0a..d2db5059 100644 --- a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorTopBanner.kt +++ b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorTopBanner.kt @@ -4,6 +4,7 @@ import androidx.compose.foundation.Image import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.statusBarsPadding @@ -14,6 +15,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import com.droidknights.app.core.designsystem.theme.Black import com.droidknights.app.core.designsystem.theme.KnightsTheme @@ -76,3 +78,17 @@ private fun ContributorBannerContent( ) } } + +@Preview +@Composable +private fun ContributorTopBannerPreview() { + KnightsTheme { + Column { + ContributorTopBanner(darkTheme = false) + + Spacer(modifier = Modifier.padding(top = 20.dp)) + + ContributorTopBanner(darkTheme = true) + } + } +} From 734ae87887ac90037519832220f0f71bcc15778a Mon Sep 17 00:00:00 2001 From: buna Date: Sat, 8 Jun 2024 19:49:49 +0900 Subject: [PATCH 7/8] =?UTF-8?q?feat:=20EditModeLeadingItem=20Preview=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bookmark/component/EditModeLeadingItem.kt | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/feature/bookmark/src/main/java/com/droidknights/app/feature/bookmark/component/EditModeLeadingItem.kt b/feature/bookmark/src/main/java/com/droidknights/app/feature/bookmark/component/EditModeLeadingItem.kt index 5f5268af..86c5bfb2 100644 --- a/feature/bookmark/src/main/java/com/droidknights/app/feature/bookmark/component/EditModeLeadingItem.kt +++ b/feature/bookmark/src/main/java/com/droidknights/app/feature/bookmark/component/EditModeLeadingItem.kt @@ -15,13 +15,18 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp +import com.droidknights.app.core.designsystem.theme.KnightsTheme import com.droidknights.app.core.designsystem.theme.Purple01 import com.droidknights.app.core.designsystem.theme.White +import com.droidknights.app.core.model.Room import com.droidknights.app.core.model.Session import com.droidknights.app.feature.bookmark.R import com.droidknights.app.feature.bookmark.model.BookmarkItemUiState import kotlinx.collections.immutable.ImmutableSet +import kotlinx.collections.immutable.persistentSetOf +import kotlinx.datetime.LocalDateTime @Composable internal fun EditModeLeadingItem( @@ -58,3 +63,45 @@ internal fun EditModeLeadingItem( ) } } + +private val SampleBookmarkItemUiState = BookmarkItemUiState( + index = 0, + session = Session( + id = "1", + title = "Session Title", + content = "Compose 성능 최적화를 위한 Stability 마스터하기", + speakers = emptyList(), + tags = emptyList(), + room = Room.TRACK1, + startTime = LocalDateTime(2022, 1, 1, 10, 0, 0), + endTime = LocalDateTime(2022, 1, 1, 11, 0, 0), + isBookmarked = true, + ), +) + +private val SampleSelectedSessionIds = persistentSetOf("1", "2", "3") +private val SampleUnselectedSessionIds = persistentSetOf("-1") + +@Preview +@Composable +private fun CheckedEditModeLeadingItemPreview() { + KnightsTheme { + EditModeLeadingItem( + itemState = SampleBookmarkItemUiState, + selectedSessionIds = SampleSelectedSessionIds, + onSelectedItem = {} + ) + } +} + +@Preview +@Composable +private fun UncheckedEditModeLeadingItemPreview() { + KnightsTheme { + EditModeLeadingItem( + itemState = SampleBookmarkItemUiState, + selectedSessionIds = SampleUnselectedSessionIds, + onSelectedItem = {} + ) + } +} From 160d21aabeedf53692a2bc8e42619e175cce049b Mon Sep 17 00:00:00 2001 From: buna Date: Sat, 8 Jun 2024 19:54:26 +0900 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20ContributorCard=20=EB=8B=A4?= =?UTF-8?q?=ED=81=AC=EB=AA=A8=EB=93=9C=20Preview=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/feature/contributor/component/ContributorCard.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt index addd5a21..6cd6b5fc 100644 --- a/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt +++ b/feature/contributor/src/main/java/com/droidknights/app/feature/contributor/component/ContributorCard.kt @@ -1,5 +1,6 @@ package com.droidknights.app.feature.contributor.component +import android.content.res.Configuration import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -90,7 +91,8 @@ internal fun ContributorCard( } } -@Preview +@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO) +@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES) @Composable private fun ContributorCardPreview() { KnightsTheme {