From 8197157a3cb58cf061d8f9e91ef925f46bc18992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=8B=E1=85=AE=E1=84=89=E1=85=A5?= =?UTF-8?q?=E1=86=BC/InappPlatform=ED=8C=80/=E1=84=8B=E1=85=AF=E1=86=AB?= =?UTF-8?q?=E1=84=89=E1=85=B3=E1=84=90=E1=85=A9=E1=84=8B=E1=85=A5?= <63629853+choi-woo-sung@users.noreply.github.com> Date: Fri, 23 Aug 2024 20:38:52 +0900 Subject: [PATCH 01/21] add : add Medium TopBar change Topbar beacuse Staff Screen TobBar not matched --- .../ui/component/AnimatedMediumTopAppBar.kt | 109 ++++++++++++++++++ .../droidkaigi/confsched/staff/StaffScreen.kt | 3 +- 2 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched/ui/component/AnimatedMediumTopAppBar.kt diff --git a/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched/ui/component/AnimatedMediumTopAppBar.kt b/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched/ui/component/AnimatedMediumTopAppBar.kt new file mode 100644 index 000000000..8e6a66cf0 --- /dev/null +++ b/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched/ui/component/AnimatedMediumTopAppBar.kt @@ -0,0 +1,109 @@ +package io.github.droidkaigi.confsched.ui.component + +import androidx.compose.animation.AnimatedVisibility +import androidx.compose.animation.ExitTransition +import androidx.compose.animation.fadeIn +import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.WindowInsets +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material.icons.Icons.AutoMirrored.Filled +import androidx.compose.material.icons.automirrored.filled.ArrowBack +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.IconButton +import androidx.compose.material3.LargeTopAppBar +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.MediumTopAppBar +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBarColors +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.material3.TopAppBarScrollBehavior +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.alpha +import androidx.compose.ui.layout.onGloballyPositioned +import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun AnimatedMediumTopAppBar( + title: String, + onBackClick: () -> Unit, + navIconContentDescription: String?, + modifier: Modifier = Modifier, + actions: @Composable RowScope.() -> Unit = {}, + windowInsets: WindowInsets = TopAppBarDefaults.windowInsets, + colors: TopAppBarColors = TopAppBarDefaults.largeTopAppBarColors().copy( + scrolledContainerColor = MaterialTheme.colorScheme.surfaceContainer, + ), + scrollBehavior: TopAppBarScrollBehavior? = null, +) { + val density = LocalDensity.current.density + var navigationIconWidthDp by remember { mutableStateOf(0f) } + val isCenterTitle = remember(scrollBehavior?.state?.collapsedFraction) { + if (scrollBehavior == null) { + // Always left-align when scrollBehavior is not present + false + } else { + // Hide title position because it doesn't look smooth if it is displayed when collapsing + when (scrollBehavior.state.collapsedFraction) { + in 0.7f..1.0f -> true + in 0.0f..0.5f -> false + else -> null // Don't display while on the move. + } + } + } + + MediumTopAppBar( + title = { + AnimatedVisibility( + visible = isCenterTitle != null, + enter = fadeIn(), + // No animation required as it is erased with alpha + exit = ExitTransition.None, + ) { + Text( + text = title, + modifier = Modifier.then( + when (isCenterTitle) { + true -> { + Modifier + .padding(end = navigationIconWidthDp.dp) + .fillMaxWidth() + } + false -> Modifier + null -> Modifier.alpha(0f) + }, + ), + textAlign = TextAlign.Center, + ) + } + }, + modifier = modifier, + navigationIcon = { + IconButton( + modifier = Modifier + .onGloballyPositioned { + navigationIconWidthDp = it.size.width / density + }, + onClick = onBackClick, + ) { + Icon( + imageVector = Filled.ArrowBack, + contentDescription = navIconContentDescription, + ) + } + }, + actions = actions, + windowInsets = windowInsets, + colors = colors, + scrollBehavior = scrollBehavior, + ) +} diff --git a/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt b/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt index 8fa7565ff..d0075864a 100644 --- a/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt +++ b/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt @@ -30,6 +30,7 @@ import io.github.droidkaigi.confsched.ui.SnackbarMessageEffect import io.github.droidkaigi.confsched.ui.UserMessageStateHolder import io.github.droidkaigi.confsched.ui.UserMessageStateHolderImpl import io.github.droidkaigi.confsched.ui.component.AnimatedLargeTopAppBar +import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import io.github.droidkaigi.confsched.ui.handleOnClickIfNotNavigating import kotlinx.collections.immutable.PersistentList import org.jetbrains.compose.resources.stringResource @@ -111,7 +112,7 @@ fun StaffScreen( snackbarHost = { SnackbarHost(hostState = snackbarHostState) }, topBar = { if (!isTopAppBarHidden) { - AnimatedLargeTopAppBar( + AnimatedMediumTopAppBar( title = stringResource(StaffRes.string.staff_title), onBackClick = onBackClick, scrollBehavior = scrollBehavior, From cafb7f7c375ba2ab99be35f6b98149143dfad86c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=8B=E1=85=AE=E1=84=89=E1=85=A5?= =?UTF-8?q?=E1=86=BC/InappPlatform=ED=8C=80/=E1=84=8B=E1=85=AF=E1=86=AB?= =?UTF-8?q?=E1=84=89=E1=85=B3=E1=84=90=E1=85=A9=E1=84=8B=E1=85=A5?= <63629853+choi-woo-sung@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:30:44 +0900 Subject: [PATCH 02/21] add : change unmatched TopBar --- .../droidkaigi/confsched/contributors/ContributorsScreen.kt | 4 ++-- .../io/github/droidkaigi/confsched/settings/SettingsScreen.kt | 4 ++-- .../io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt | 4 ++-- .../io/github/droidkaigi/confsched/staff/StaffScreen.kt | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt index 4ca7f7a1c..060217360 100644 --- a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt +++ b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt @@ -24,9 +24,9 @@ import io.github.droidkaigi.confsched.compose.rememberEventFlow import io.github.droidkaigi.confsched.contributors.component.ContributorsItem import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder -import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedLargeTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.model.Contributor +import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import kotlinx.collections.immutable.PersistentList import org.jetbrains.compose.resources.stringResource @@ -107,7 +107,7 @@ fun ContributorsScreen( snackbarHost = { SnackbarHost(hostState = snackbarHostState) }, topBar = { if (!isTopAppBarHidden) { - AnimatedLargeTopAppBar( + AnimatedMediumTopAppBar( title = stringResource(ContributorsRes.string.contributor_title), onBackClick = onBackClick, scrollBehavior = scrollBehavior, diff --git a/feature/settings/src/commonMain/kotlin/io/github/droidkaigi/confsched/settings/SettingsScreen.kt b/feature/settings/src/commonMain/kotlin/io/github/droidkaigi/confsched/settings/SettingsScreen.kt index f7088dcd5..4cbb52d5a 100644 --- a/feature/settings/src/commonMain/kotlin/io/github/droidkaigi/confsched/settings/SettingsScreen.kt +++ b/feature/settings/src/commonMain/kotlin/io/github/droidkaigi/confsched/settings/SettingsScreen.kt @@ -22,10 +22,10 @@ import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolderImpl -import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedLargeTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.model.FontFamily import io.github.droidkaigi.confsched.settings.section.accessibility +import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview @@ -101,7 +101,7 @@ fun SettingsScreen( snackbarHost = { SnackbarHost(hostState = snackbarHostState) }, topBar = { if (!isTopAppBarHidden) { - AnimatedLargeTopAppBar( + AnimatedMediumTopAppBar( title = stringResource(SettingsRes.string.settings_title), onBackClick = onBackClick, scrollBehavior = scrollBehavior, diff --git a/feature/sponsors/src/commonMain/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt b/feature/sponsors/src/commonMain/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt index 454b6adfd..29637075b 100644 --- a/feature/sponsors/src/commonMain/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt +++ b/feature/sponsors/src/commonMain/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt @@ -22,7 +22,6 @@ import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolderImpl -import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedLargeTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.model.Plan.GOLD import io.github.droidkaigi.confsched.model.Plan.PLATINUM @@ -30,6 +29,7 @@ import io.github.droidkaigi.confsched.model.Plan.SUPPORTER import io.github.droidkaigi.confsched.model.Sponsor import io.github.droidkaigi.confsched.model.fakes import io.github.droidkaigi.confsched.sponsors.section.SponsorsList +import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.toPersistentList import org.jetbrains.compose.resources.stringResource @@ -114,7 +114,7 @@ fun SponsorsScreen( snackbarHost = { SnackbarHost(hostState = snackbarHostState) }, topBar = { if (!isTopAppBarHidden) { - AnimatedLargeTopAppBar( + AnimatedMediumTopAppBar( title = stringResource(SponsorsRes.string.sponsor), onBackClick = onBackClick, scrollBehavior = scrollBehavior, diff --git a/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt b/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt index 5211ae716..07afa2d5a 100644 --- a/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt +++ b/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt @@ -26,11 +26,11 @@ import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolderImpl -import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedLargeTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.model.Staff import io.github.droidkaigi.confsched.model.fakes import io.github.droidkaigi.confsched.staff.component.StaffItem +import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import kotlinx.collections.immutable.PersistentList import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview From 09d178b0ce4e763f99457a0a38a0624915664a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=8B=E1=85=AE=E1=84=89=E1=85=A5?= =?UTF-8?q?=E1=86=BC/InappPlatform=ED=8C=80/=E1=84=8B=E1=85=AF=E1=86=AB?= =?UTF-8?q?=E1=84=89=E1=85=B3=E1=84=90=E1=85=A9=E1=84=8B=E1=85=A5?= <63629853+choi-woo-sung@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:38:22 +0900 Subject: [PATCH 03/21] execute detekt --- .../droidkaigiui/component/AnimatedMediumTopAppBar.kt | 3 +-- .../droidkaigi/confsched/contributors/ContributorsScreen.kt | 2 +- .../io/github/droidkaigi/confsched/settings/SettingsScreen.kt | 2 +- .../io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt | 2 +- .../kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/component/AnimatedMediumTopAppBar.kt b/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/component/AnimatedMediumTopAppBar.kt index 8e6a66cf0..86635b829 100644 --- a/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/component/AnimatedMediumTopAppBar.kt +++ b/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/component/AnimatedMediumTopAppBar.kt @@ -1,4 +1,4 @@ -package io.github.droidkaigi.confsched.ui.component +package io.github.droidkaigi.confsched.droidkaigiui.component import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.ExitTransition @@ -12,7 +12,6 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton -import androidx.compose.material3.LargeTopAppBar import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MediumTopAppBar import androidx.compose.material3.Text diff --git a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt index c36c1824b..7a3b30839 100644 --- a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt +++ b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt @@ -24,9 +24,9 @@ import io.github.droidkaigi.confsched.compose.rememberEventFlow import io.github.droidkaigi.confsched.contributors.component.ContributorsItem import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder +import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedMediumTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.model.Contributor -import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import kotlinx.collections.immutable.PersistentList import org.jetbrains.compose.resources.stringResource diff --git a/feature/settings/src/commonMain/kotlin/io/github/droidkaigi/confsched/settings/SettingsScreen.kt b/feature/settings/src/commonMain/kotlin/io/github/droidkaigi/confsched/settings/SettingsScreen.kt index ce4950a44..add874ce8 100644 --- a/feature/settings/src/commonMain/kotlin/io/github/droidkaigi/confsched/settings/SettingsScreen.kt +++ b/feature/settings/src/commonMain/kotlin/io/github/droidkaigi/confsched/settings/SettingsScreen.kt @@ -24,11 +24,11 @@ import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolderImpl +import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedMediumTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.droidkaigiui.plus import io.github.droidkaigi.confsched.model.FontFamily import io.github.droidkaigi.confsched.settings.section.accessibility -import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview diff --git a/feature/sponsors/src/commonMain/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt b/feature/sponsors/src/commonMain/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt index 9e636ebbd..68060112d 100644 --- a/feature/sponsors/src/commonMain/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt +++ b/feature/sponsors/src/commonMain/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreen.kt @@ -22,6 +22,7 @@ import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolderImpl +import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedMediumTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.model.Plan.GOLD import io.github.droidkaigi.confsched.model.Plan.PLATINUM @@ -29,7 +30,6 @@ import io.github.droidkaigi.confsched.model.Plan.SUPPORTER import io.github.droidkaigi.confsched.model.Sponsor import io.github.droidkaigi.confsched.model.fakes import io.github.droidkaigi.confsched.sponsors.section.SponsorsList -import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.toPersistentList import org.jetbrains.compose.resources.stringResource diff --git a/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt b/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt index 4ed9c18eb..4bddd4e66 100644 --- a/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt +++ b/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt @@ -26,11 +26,11 @@ import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolderImpl +import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedMediumTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.model.Staff import io.github.droidkaigi.confsched.model.fakes import io.github.droidkaigi.confsched.staff.component.StaffItem -import io.github.droidkaigi.confsched.ui.component.AnimatedMediumTopAppBar import kotlinx.collections.immutable.PersistentList import org.jetbrains.compose.resources.stringResource import org.jetbrains.compose.ui.tooling.preview.Preview From 54027560cf6eaed48d2d27a004d94929f1138017 Mon Sep 17 00:00:00 2001 From: nishimy432 Date: Wed, 28 Aug 2024 12:13:00 +0900 Subject: [PATCH 04/21] Add a message for no search results when there is no input --- .../src/commonMain/composeResources/values-ja/strings.xml | 1 + .../sessions/src/commonMain/composeResources/values/strings.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/sessions/src/commonMain/composeResources/values-ja/strings.xml b/feature/sessions/src/commonMain/composeResources/values-ja/strings.xml index fd6547b2f..0aa52dc9e 100644 --- a/feature/sessions/src/commonMain/composeResources/values-ja/strings.xml +++ b/feature/sessions/src/commonMain/composeResources/values-ja/strings.xml @@ -29,6 +29,7 @@ 対応言語 カテゴリ 「%1$s」と一致する検索結果がありません + 一致する検索結果がありません 開催日 カテゴリ セッション種別 diff --git a/feature/sessions/src/commonMain/composeResources/values/strings.xml b/feature/sessions/src/commonMain/composeResources/values/strings.xml index b1c0049b5..afa1952e2 100644 --- a/feature/sessions/src/commonMain/composeResources/values/strings.xml +++ b/feature/sessions/src/commonMain/composeResources/values/strings.xml @@ -28,7 +28,7 @@ Location Supported Languages Category - Nothing matched your search criteria "%1$s" + Nothing matched your search criteria Day Category Session type From 6c3f13b02a4ac55b2eda3139b0401382f0ea9dba Mon Sep 17 00:00:00 2001 From: nishimy432 Date: Wed, 28 Aug 2024 12:19:56 +0900 Subject: [PATCH 05/21] Modify to change the display message based on whether the search text is empty or not --- .../sessions/component/EmptySearchResultBody.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/component/EmptySearchResultBody.kt b/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/component/EmptySearchResultBody.kt index a7e879bfc..fefa06ca0 100644 --- a/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/component/EmptySearchResultBody.kt +++ b/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/component/EmptySearchResultBody.kt @@ -14,6 +14,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import conference_app_2024.feature.sessions.generated.resources.Res import conference_app_2024.feature.sessions.generated.resources.empty_search_result +import conference_app_2024.feature.sessions.generated.resources.empty_search_result_no_input import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.stringResource @@ -24,6 +25,12 @@ fun EmptySearchResultBody( searchWord: String, modifier: Modifier = Modifier, ) { + val message = if (searchWord.isEmpty()) { + stringResource(Res.string.empty_search_result_no_input) + } else { + stringResource(Res.string.empty_search_result, searchWord) + } + Column( modifier = modifier .fillMaxSize() @@ -36,7 +43,7 @@ fun EmptySearchResultBody( contentDescription = null, ) Text( - text = stringResource(Res.string.empty_search_result, searchWord), + text = message, style = MaterialTheme.typography.titleMedium, textAlign = TextAlign.Center, ) From 3821d0cd6f508dcf4e7699e3c3469b98ff98903c Mon Sep 17 00:00:00 2001 From: nishimy432 Date: Wed, 28 Aug 2024 12:32:40 +0900 Subject: [PATCH 06/21] Fix the English strings --- .../src/commonMain/composeResources/values/strings.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/feature/sessions/src/commonMain/composeResources/values/strings.xml b/feature/sessions/src/commonMain/composeResources/values/strings.xml index afa1952e2..049bb9f85 100644 --- a/feature/sessions/src/commonMain/composeResources/values/strings.xml +++ b/feature/sessions/src/commonMain/composeResources/values/strings.xml @@ -28,7 +28,8 @@ Location Supported Languages Category - Nothing matched your search criteria + Nothing matched your search criteria "%1$s" + Nothing matched your search criteria Day Category Session type From 2883d086700711b195fe7dd80f6202b86b6112a4 Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Sun, 1 Sep 2024 08:56:24 +0900 Subject: [PATCH 07/21] :recycle: Since the About screen test has not been implemented, it has been implemented except where the Issue manager is located. https://github.com/DroidKaigi/conference-app-2024/issues/670 --- .../testing/robot/AboutScreenRobot.kt | 70 +++++++++++++++++++ .../confsched/about/AboutScreenTest.kt | 23 ++++++ .../droidkaigi/confsched/about/AboutScreen.kt | 6 +- .../confsched/about/section/AboutOthers.kt | 3 +- 4 files changed, 100 insertions(+), 2 deletions(-) diff --git a/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/AboutScreenRobot.kt b/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/AboutScreenRobot.kt index 42ba98740..1d731ef02 100644 --- a/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/AboutScreenRobot.kt +++ b/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/AboutScreenRobot.kt @@ -2,10 +2,22 @@ package io.github.droidkaigi.confsched.testing.robot import androidx.compose.ui.test.assertIsDisplayed import androidx.compose.ui.test.hasTestTag +import androidx.compose.ui.test.onRoot +import androidx.compose.ui.test.performScrollToNode +import androidx.compose.ui.test.performTouchInput +import androidx.compose.ui.test.swipeUp import io.github.droidkaigi.confsched.about.AboutScreen +import io.github.droidkaigi.confsched.about.AboutScreenLazyColumnTestTag +import io.github.droidkaigi.confsched.about.section.AboutCreditsContributorsItemTestTag +import io.github.droidkaigi.confsched.about.section.AboutCreditsSponsorsItemTestTag +import io.github.droidkaigi.confsched.about.section.AboutCreditsStaffItemTestTag import io.github.droidkaigi.confsched.about.section.AboutCreditsTitleTestTag import io.github.droidkaigi.confsched.about.section.AboutDetailTestTag import io.github.droidkaigi.confsched.about.section.AboutFooterLinksTestTag +import io.github.droidkaigi.confsched.about.section.AboutOthersCodeOfConductItemTestTag +import io.github.droidkaigi.confsched.about.section.AboutOthersLicenseItemTestTag +import io.github.droidkaigi.confsched.about.section.AboutOthersPrivacyPolicyItemTestTag +import io.github.droidkaigi.confsched.about.section.AboutOthersSettingsItemTestTag import io.github.droidkaigi.confsched.about.section.AboutOthersTitleTestTag import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import javax.inject.Inject @@ -24,6 +36,24 @@ class AboutScreenRobot @Inject constructor( waitUntilIdle() } + fun scrollToCreditsSection() { + composeTestRule + .onNode(hasTestTag(AboutScreenLazyColumnTestTag)) + .performScrollToNode(hasTestTag(AboutCreditsStaffItemTestTag)) + + composeTestRule.onRoot().performTouchInput { + swipeUp(startY = centerY, endY = centerY - 200) + } + waitUntilIdle() + } + + fun scrollToOthersSection() { + composeTestRule + .onNode(hasTestTag(AboutScreenLazyColumnTestTag)) + .performScrollToNode(hasTestTag(AboutOthersTitleTestTag)) + waitUntilIdle() + } + fun checkDetailSectionDisplayed() { composeTestRule .onNode(hasTestTag(AboutDetailTestTag)) @@ -36,12 +66,52 @@ class AboutScreenRobot @Inject constructor( .assertIsDisplayed() } + fun checkCreditsSectionContentsDisplayed() { + composeTestRule + .onNode(hasTestTag(AboutCreditsContributorsItemTestTag)) + .assertExists() + .assertIsDisplayed() + + composeTestRule + .onNode(hasTestTag(AboutCreditsStaffItemTestTag)) + .assertExists() + .assertIsDisplayed() + + composeTestRule + .onNode(hasTestTag(AboutCreditsSponsorsItemTestTag)) + .assertExists() + .assertIsDisplayed() + } + fun checkOthersSectionTitleDisplayed() { composeTestRule .onNode(hasTestTag(AboutOthersTitleTestTag)) .assertIsDisplayed() } + fun checkOthersSectionContentsDisplayed() { + composeTestRule + .onNode(hasTestTag(AboutOthersCodeOfConductItemTestTag)) + .assertExists() + .assertIsDisplayed() + + composeTestRule + .onNode(hasTestTag(AboutOthersLicenseItemTestTag)) + .assertExists() + .assertIsDisplayed() + + composeTestRule + .onNode(hasTestTag(AboutOthersPrivacyPolicyItemTestTag)) + .assertExists() + .assertIsDisplayed() + + composeTestRule + .onNode(hasTestTag(AboutOthersSettingsItemTestTag)) + .assertExists() + .assertIsDisplayed() + } + + // TODO https://github.com/DroidKaigi/conference-app-2024/issues/670 fun checkFooterLinksSectionDisplayed() { composeTestRule .onNode(hasTestTag(AboutFooterLinksTestTag)) diff --git a/feature/about/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/about/AboutScreenTest.kt b/feature/about/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/about/AboutScreenTest.kt index 132621976..9fcad9083 100644 --- a/feature/about/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/about/AboutScreenTest.kt +++ b/feature/about/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/about/AboutScreenTest.kt @@ -48,6 +48,29 @@ class AboutScreenTest( checkDetailSectionDisplayed() } } + describe("when scroll to credits section") { + doIt { + scrollToCreditsSection() + } + itShould("show credits contents") { + captureScreenWithChecks { + checkCreditsSectionTitleDisplayed() + checkCreditsSectionContentsDisplayed() + } + } + } + describe("when scroll to others section") { + doIt { + scrollToOthersSection() + } + itShould("show others contents") { + captureScreenWithChecks { + checkOthersSectionTitleDisplayed() + checkOthersSectionContentsDisplayed() + } + } + } + // TODO https://github.com/DroidKaigi/conference-app-2024/issues/670 } } } diff --git a/feature/about/src/commonMain/kotlin/io/github/droidkaigi/confsched/about/AboutScreen.kt b/feature/about/src/commonMain/kotlin/io/github/droidkaigi/confsched/about/AboutScreen.kt index 222e673de..0a59750e6 100644 --- a/feature/about/src/commonMain/kotlin/io/github/droidkaigi/confsched/about/AboutScreen.kt +++ b/feature/about/src/commonMain/kotlin/io/github/droidkaigi/confsched/about/AboutScreen.kt @@ -33,6 +33,8 @@ import org.jetbrains.compose.resources.stringResource const val aboutScreenRoute = "about" +const val AboutScreenLazyColumnTestTag = "AboutScreenLazyColumnTestTag" + object AboutScreenTestTag { const val Screen = "AboutScreen" } @@ -93,7 +95,9 @@ fun AboutScreen( ), ) { padding -> LazyColumn( - Modifier.nestedScroll(scrollBehavior.nestedScrollConnection), + Modifier + .nestedScroll(scrollBehavior.nestedScrollConnection) + .testTag(AboutScreenLazyColumnTestTag), contentPadding = padding, state = lazyListState, ) { diff --git a/feature/about/src/commonMain/kotlin/io/github/droidkaigi/confsched/about/section/AboutOthers.kt b/feature/about/src/commonMain/kotlin/io/github/droidkaigi/confsched/about/section/AboutOthers.kt index 458f46ba3..c7da061f5 100644 --- a/feature/about/src/commonMain/kotlin/io/github/droidkaigi/confsched/about/section/AboutOthers.kt +++ b/feature/about/src/commonMain/kotlin/io/github/droidkaigi/confsched/about/section/AboutOthers.kt @@ -30,6 +30,7 @@ const val AboutOthersTitleTestTag = "AboutOthersTitleTestTag" const val AboutOthersCodeOfConductItemTestTag = "AboutOthersCodeOfConductItemTestTag" const val AboutOthersLicenseItemTestTag = "AboutOthersLicenseItemTestTag" const val AboutOthersPrivacyPolicyItemTestTag = "AboutOthersPrivacyPolicyItemTestTag" +const val AboutOthersSettingsItemTestTag = "AboutOthersSettingsItemTestTag" fun LazyListScope.aboutOthers( modifier: Modifier = Modifier, @@ -92,7 +93,7 @@ fun LazyListScope.aboutOthers( leadingIcon = Outlined.Settings, label = stringResource(AboutRes.string.settings), onClickAction = onSettingsItemClick, - testTag = "TODO", + testTag = AboutOthersSettingsItemTestTag, modifier = modifier .padding( horizontal = 16.dp, From f144500dd89595cb7cee345601acc7c29ddabd6e Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Sun, 1 Sep 2024 18:54:14 +0900 Subject: [PATCH 08/21] :wrench: Add FIXME. --- .../droidkaigi/confsched/testing/robot/AboutScreenRobot.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/AboutScreenRobot.kt b/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/AboutScreenRobot.kt index 1d731ef02..3b9f6de41 100644 --- a/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/AboutScreenRobot.kt +++ b/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/AboutScreenRobot.kt @@ -41,6 +41,7 @@ class AboutScreenRobot @Inject constructor( .onNode(hasTestTag(AboutScreenLazyColumnTestTag)) .performScrollToNode(hasTestTag(AboutCreditsStaffItemTestTag)) + // FIXME Without this, you won't be able to scroll to the exact middle of the credits section. composeTestRule.onRoot().performTouchInput { swipeUp(startY = centerY, endY = centerY - 200) } From de5efb2908cb5d1620aa4de2c139a71e0b147819 Mon Sep 17 00:00:00 2001 From: woxtu Date: Mon, 2 Sep 2024 05:14:19 +0900 Subject: [PATCH 09/21] Add borders to user icons --- .../CommonComponents/Timetable/CircularUserIcon.swift | 5 +++++ app-ios/Sources/StaffFeature/StaffLabel.swift | 4 ---- .../Sources/TimetableFeature/TimetableGridCard.swift | 11 ++--------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/app-ios/Sources/CommonComponents/Timetable/CircularUserIcon.swift b/app-ios/Sources/CommonComponents/Timetable/CircularUserIcon.swift index 3101378f3..c3c727e80 100644 --- a/app-ios/Sources/CommonComponents/Timetable/CircularUserIcon.swift +++ b/app-ios/Sources/CommonComponents/Timetable/CircularUserIcon.swift @@ -1,5 +1,6 @@ import Foundation import SwiftUI +import Theme private actor CircularUserIconInMemoryCache { static let shared = CircularUserIconInMemoryCache() @@ -35,6 +36,10 @@ public struct CircularUserIcon: View { } } .clipShape(Circle()) + .overlay( + Circle() + .stroke(AssetColors.Outline.outline.swiftUIColor, lineWidth: 1) + ) .task { if let data = await CircularUserIconInMemoryCache.shared.data(urlString: urlString) { iconData = data diff --git a/app-ios/Sources/StaffFeature/StaffLabel.swift b/app-ios/Sources/StaffFeature/StaffLabel.swift index 564bd7f14..0c3e58ac0 100644 --- a/app-ios/Sources/StaffFeature/StaffLabel.swift +++ b/app-ios/Sources/StaffFeature/StaffLabel.swift @@ -10,10 +10,6 @@ struct StaffLabel: View { HStack(alignment: .center, spacing: 12) { CircularUserIcon(urlString: icon.absoluteString) .frame(width: 52, height: 52) - .overlay( - Circle() - .stroke(AssetColors.Outline.outline.swiftUIColor, lineWidth: 1) - ) Text(name) .textStyle(.bodyLarge) diff --git a/app-ios/Sources/TimetableFeature/TimetableGridCard.swift b/app-ios/Sources/TimetableFeature/TimetableGridCard.swift index 98c4dbb3f..53a6e2bb1 100644 --- a/app-ios/Sources/TimetableFeature/TimetableGridCard.swift +++ b/app-ios/Sources/TimetableFeature/TimetableGridCard.swift @@ -44,15 +44,8 @@ public struct TimetableGridCard: View { ForEach(timetableItem.speakers, id: \.id) { speaker in HStack(spacing: 8) { - Group { - AsyncImage(url: URL(string: speaker.iconUrl)) { - $0.resizable() - } placeholder: { - Color.gray - } - } - .frame(width: 32, height: 32) - .clipShape(Circle()) + CircularUserIcon(urlString: speaker.iconUrl) + .frame(width: 32, height: 32) Text(speaker.name) .textStyle(.titleSmall) From aa5c8a703db4460d1ddaf9431c8c268b2bcac51d Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:24:54 +0900 Subject: [PATCH 10/21] :wrench: The problem of flickering icons has been addressed by caching ImageRequests. Every time you scroll, a new ImageRequest instance was created using LocalContext.current. As a result, rememberAsyncImagePainter would create a new Painter each time, causing flickering when scrolling. --- .../component/SpeakerPainter.android.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/core/droidkaigiui/src/androidMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/component/SpeakerPainter.android.kt b/core/droidkaigiui/src/androidMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/component/SpeakerPainter.android.kt index fe9517d46..c7c2981fe 100644 --- a/core/droidkaigiui/src/androidMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/component/SpeakerPainter.android.kt +++ b/core/droidkaigiui/src/androidMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/component/SpeakerPainter.android.kt @@ -1,6 +1,7 @@ package io.github.droidkaigi.confsched.droidkaigiui.component import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.graphics.painter.Painter import androidx.compose.ui.platform.LocalContext import coil3.request.ImageRequest @@ -10,13 +11,17 @@ import io.github.droidkaigi.confsched.droidkaigiui.rememberAsyncImagePainter @Composable actual fun speakerPainter(url: String): Painter { - // TODO Use DrawableResource - // https://github.com/DroidKaigi/conference-app-2024/pull/864/files#r1736437080 - // https://github.com/coil-kt/coil/issues/2077 - return rememberAsyncImagePainter( - model = ImageRequest.Builder(LocalContext.current) + val context = LocalContext.current + + val imageRequest = remember(url, context) { + // TODO Use DrawableResource + // https://github.com/DroidKaigi/conference-app-2024/pull/864/files#r1736437080 + // https://github.com/coil-kt/coil/issues/2077 + ImageRequest.Builder(context) .data(url) .placeholder(R.drawable.icon_place_hoolder) - .build(), - ) + .build() + } + + return rememberAsyncImagePainter(model = imageRequest) } From ddac0d0e16b02562af5bf79540fcfb8b82e3b05b Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:31:42 +0900 Subject: [PATCH 11/21] :wrench: The same response was needed for rememberAsyncImagePainter, so it was implemented. --- .../github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt b/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt index ee7784eb8..90e85dd69 100644 --- a/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt +++ b/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt @@ -1,6 +1,7 @@ package io.github.droidkaigi.confsched.droidkaigiui import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.graphics.painter.Painter import coil3.request.ImageRequest @@ -13,7 +14,9 @@ fun rememberAsyncImagePainter(url: String): Painter { @Composable fun rememberAsyncImagePainter(model: ImageRequest): Painter { + val requestModel = remember(model) { model } + return coil3.compose.rememberAsyncImagePainter( - model = model, + model = requestModel ) } From 07ab2e9d120fedb248150049bde4cb4ce586ae02 Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Mon, 2 Sep 2024 08:31:59 +0900 Subject: [PATCH 12/21] :wrench: ./gradlew detekt --auto-correct --- .../io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt b/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt index 90e85dd69..eb085d6f3 100644 --- a/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt +++ b/core/droidkaigiui/src/commonMain/kotlin/io/github/droidkaigi/confsched/droidkaigiui/ImagePainter.kt @@ -17,6 +17,6 @@ fun rememberAsyncImagePainter(model: ImageRequest): Painter { val requestModel = remember(model) { model } return coil3.compose.rememberAsyncImagePainter( - model = requestModel + model = requestModel, ) } From 5048a0d41c4e06e7de97530a8f8b4dcf1661ac0a Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:06:11 +0900 Subject: [PATCH 13/21] :wrench: The focus on the item has been adjusted so that it is properly removed. 1. When you tap anywhere on the screen. 2. When you perform the Done action on the last item. --- .../confsched/profilecard/ProfileCardScreen.kt | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 c96c86bd6..e75b0517c 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 @@ -23,6 +23,7 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll import androidx.compose.material.icons.Icons @@ -78,6 +79,7 @@ import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalDensity +import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.platform.testTag @@ -231,6 +233,7 @@ internal fun ProfileCardScreen( val snackbarHostState = remember { SnackbarHostState() } val layoutDirection = LocalLayoutDirection.current val keyboardController = LocalSoftwareKeyboardController.current + val focusManager = LocalFocusManager.current SnackbarMessageEffect( snackbarHostState = snackbarHostState, @@ -256,6 +259,7 @@ internal fun ProfileCardScreen( .pointerInput(Unit) { detectTapGestures { keyboardController?.hide() + focusManager.clearFocus() } }, snackbarHost = { SnackbarHost(hostState = snackbarHostState) }, @@ -387,6 +391,8 @@ internal fun EditScreen( } } + val focusManager = LocalFocusManager.current + Column( modifier = modifier .fillMaxWidth() @@ -436,6 +442,11 @@ internal fun EditScreen( imeAction = ImeAction.Done, keyboardType = KeyboardType.Uri, ), + keyboardActions = KeyboardActions( + onDone = { + focusManager.clearFocus() + } + ) ) Column( @@ -520,6 +531,7 @@ private fun InputFieldWithError( onValueChange: (String) -> Unit, modifier: Modifier = Modifier, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, + keyboardActions: KeyboardActions = KeyboardActions.Default, maxLines: Int = 1, ) { Column(modifier = modifier) { @@ -539,6 +551,7 @@ private fun InputFieldWithError( isError = isError, shape = RoundedCornerShape(4.dp), keyboardOptions = keyboardOptions, + keyboardActions = keyboardActions, maxLines = maxLines, modifier = Modifier .indicatorLine( From cbea5689cdb097dde69fdab8356d985c54c96af7 Mon Sep 17 00:00:00 2001 From: todayama_r <13657682+Corvus400@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:06:28 +0900 Subject: [PATCH 14/21] :wrench: ./gradlew detekt --auto-correct --- .../droidkaigi/confsched/profilecard/ProfileCardScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 e75b0517c..ff11230c4 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 @@ -445,8 +445,8 @@ internal fun EditScreen( keyboardActions = KeyboardActions( onDone = { focusManager.clearFocus() - } - ) + }, + ), ) Column( From fd6be0b4ed11ffbb5c1414a496ad994f5e5c215d Mon Sep 17 00:00:00 2001 From: NUmeroAndDev Date: Mon, 2 Sep 2024 12:32:49 +0900 Subject: [PATCH 15/21] Bump targetSdk version to 35 --- .../github/droidkaigi/confsched/primitive/AndroidGradleDsl.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-logic/src/main/kotlin/io/github/droidkaigi/confsched/primitive/AndroidGradleDsl.kt b/build-logic/src/main/kotlin/io/github/droidkaigi/confsched/primitive/AndroidGradleDsl.kt index a3bc5c17f..5988bf727 100644 --- a/build-logic/src/main/kotlin/io/github/droidkaigi/confsched/primitive/AndroidGradleDsl.kt +++ b/build-logic/src/main/kotlin/io/github/droidkaigi/confsched/primitive/AndroidGradleDsl.kt @@ -31,11 +31,11 @@ fun Project.setupAndroid() { namespace?.let { this.namespace = it } - compileSdkVersion(34) + compileSdkVersion(35) defaultConfig { minSdk = 24 - targetSdk = 34 + targetSdk = 35 } compileOptions { From cfbceacd6aa87af3877235bf7215f5b0f189d20f Mon Sep 17 00:00:00 2001 From: NUmeroAndDev Date: Mon, 2 Sep 2024 12:33:11 +0900 Subject: [PATCH 16/21] Ignored edge-to-edge in licenses screen --- app-android/src/main/AndroidManifest.xml | 4 ++-- app-android/src/main/res/values/themes.xml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app-android/src/main/AndroidManifest.xml b/app-android/src/main/AndroidManifest.xml index 690a5929b..ddcc4d0b5 100644 --- a/app-android/src/main/AndroidManifest.xml +++ b/app-android/src/main/AndroidManifest.xml @@ -34,11 +34,11 @@ + android:theme="@style/Theme.KaigiApp.Licenses" /> + android:theme="@style/Theme.KaigiApp.Licenses" /> @android:color/transparent + + From 717b41bdf6fdd394cc8178aa124b1d984bb22bce Mon Sep 17 00:00:00 2001 From: NUmeroAndDev Date: Mon, 2 Sep 2024 13:08:32 +0900 Subject: [PATCH 17/21] Fixed profile input scroll direction --- .../droidkaigi/confsched/profilecard/ProfileCardScreen.kt | 2 ++ 1 file changed, 2 insertions(+) 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 c96c86bd6..8b21b4b72 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 @@ -521,6 +521,7 @@ private fun InputFieldWithError( modifier: Modifier = Modifier, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, maxLines: Int = 1, + singleLine: Boolean = true, ) { Column(modifier = modifier) { val isError = errorMessage.isNotEmpty() @@ -540,6 +541,7 @@ private fun InputFieldWithError( shape = RoundedCornerShape(4.dp), keyboardOptions = keyboardOptions, maxLines = maxLines, + singleLine = singleLine, modifier = Modifier .indicatorLine( enabled = false, From 4105fd9fc36ef841ed1c45c4274c7ce5a99587fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8E=E1=85=AC=E1=84=8B=E1=85=AE=E1=84=89=E1=85=A5?= =?UTF-8?q?=E1=86=BC/InappPlatform=ED=8C=80/=E1=84=8B=E1=85=AF=E1=86=AB?= =?UTF-8?q?=E1=84=89=E1=85=B3=E1=84=90=E1=85=A9=E1=84=8B=E1=85=A5?= Date: Mon, 2 Sep 2024 17:28:05 +0900 Subject: [PATCH 18/21] clean import and fix SponserCreenTest --- .../confsched/testing/robot/SponsorsScreenRobot.kt | 11 ++++++++++- .../confsched/contributors/ContributorsScreen.kt | 2 -- .../confsched/profilecard/ProfileCardScreen.kt | 3 +-- .../confsched/sponsors/SponsorsScreenTest.kt | 4 ++-- .../github/droidkaigi/confsched/staff/StaffScreen.kt | 1 + 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/SponsorsScreenRobot.kt b/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/SponsorsScreenRobot.kt index f6f27e7d7..4810b81a7 100644 --- a/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/SponsorsScreenRobot.kt +++ b/core/testing/src/main/java/io/github/droidkaigi/confsched/testing/robot/SponsorsScreenRobot.kt @@ -67,6 +67,14 @@ class SponsorsScreenRobot @Inject constructor( ) } + fun scrollBottom() { + composeTestRule + .onNode(hasTestTag(SponsorsListLazyVerticalGridTestTag)) + .performScrollToNode( + hasTestTag(SponsorsListSponsorItemTestTagPrefix.plus(Sponsor.fakes().last().name)), + ) + } + fun checkDisplayPlatinumSponsors() { checkSponsorItemsDisplayedByRangeAndSponsorType( sponsorType = SponsorType.Platinum, @@ -92,7 +100,8 @@ class SponsorsScreenRobot @Inject constructor( sponsorType: SponsorType, fromTo: IntRange, ) { - val sponsorList = Sponsor.fakes().filter { it.plan.toSponsorType() == sponsorType }.subList(fromTo.first, fromTo.last) + val sponsorList = Sponsor.fakes().filter { it.plan.toSponsorType() == sponsorType } + .subList(fromTo.first, fromTo.last) sponsorList.forEach { sponsor -> composeTestRule .onNode(hasTestTag(SponsorsListSponsorItemTestTagPrefix.plus(sponsor.name))) diff --git a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt index 0f5f8c508..c6902b369 100644 --- a/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt +++ b/feature/contributors/src/commonMain/kotlin/io/github/droidkaigi/confsched/contributors/ContributorsScreen.kt @@ -24,9 +24,7 @@ import io.github.droidkaigi.confsched.compose.rememberEventFlow import io.github.droidkaigi.confsched.contributors.component.ContributorsItem import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder -import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedLargeTopAppBar import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedMediumTopAppBar -import io.github.droidkaigi.confsched.droidkaigiui.handleOnClickIfNotNavigating import io.github.droidkaigi.confsched.model.Contributor import kotlinx.collections.immutable.PersistentList import org.jetbrains.compose.resources.stringResource 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 161a12a5c..985e9ba92 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 @@ -833,10 +833,9 @@ internal fun CardScreen( text = stringResource(ProfileCardRes.string.edit), modifier = Modifier.padding(8.dp), style = MaterialTheme.typography.labelLarge, - color = Color.Black + color = Color.Black, ) } - } } } diff --git a/feature/sponsors/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreenTest.kt b/feature/sponsors/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreenTest.kt index 5ce968c4c..b585caa42 100644 --- a/feature/sponsors/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreenTest.kt +++ b/feature/sponsors/src/androidUnitTest/kotlin/io/github/droidkaigi/confsched/sponsors/SponsorsScreenTest.kt @@ -65,9 +65,9 @@ class SponsorsScreenTest( } } - describe("when scroll to supporters header") { + describe("when scroll to scroll Bottom") { doIt { - scrollToSupportersSponsorsHeader() + scrollBottom() } itShould("display supporters sponsors") { captureScreenWithChecks { diff --git a/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt b/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt index 04bb72b9c..912d69fcc 100644 --- a/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt +++ b/feature/staff/src/commonMain/kotlin/io/github/droidkaigi/confsched/staff/StaffScreen.kt @@ -26,6 +26,7 @@ import io.github.droidkaigi.confsched.designsystem.theme.KaigiTheme import io.github.droidkaigi.confsched.droidkaigiui.SnackbarMessageEffect import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolder import io.github.droidkaigi.confsched.droidkaigiui.UserMessageStateHolderImpl +import io.github.droidkaigi.confsched.droidkaigiui.component.AnimatedMediumTopAppBar import io.github.droidkaigi.confsched.model.Staff import io.github.droidkaigi.confsched.model.fakes import io.github.droidkaigi.confsched.staff.component.StaffItem From 3dc0c0cfc8f37a22b8e7c0a5f4f19cf5c6eaa35c Mon Sep 17 00:00:00 2001 From: nishimy432 Date: Mon, 2 Sep 2024 18:05:07 +0900 Subject: [PATCH 19/21] Changed to make SearchScreenUiState become Empty once a search is performed --- .../droidkaigi/confsched/sessions/SearchScreenPresenter.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/SearchScreenPresenter.kt b/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/SearchScreenPresenter.kt index 877b7609b..a26063ed0 100644 --- a/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/SearchScreenPresenter.kt +++ b/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/SearchScreenPresenter.kt @@ -50,6 +50,7 @@ fun searchScreenPresenter( val sessions by rememberUpdatedState(sessionsRepository.timetable()) var searchWord by rememberRetained { mutableStateOf("") } + var hasSearched by rememberRetained { mutableStateOf(false) } val selectedDays = rememberRetained { mutableStateListOf() } val selectedSessionTypes = rememberRetained { mutableStateListOf() } val selectedCategories = rememberRetained { mutableStateListOf() } @@ -109,6 +110,7 @@ fun searchScreenPresenter( is UpdateSearchWord -> { searchWord = event.word + hasSearched = true } is ClearSearchWord -> { @@ -150,7 +152,7 @@ fun searchScreenPresenter( } when { - filters.isNotEmpty() && filteredSessions.isEmpty() -> { + (filters.isNotEmpty() || hasSearched) && filteredSessions.isEmpty() -> { SearchScreenUiState.Empty( searchWord = searchWord, searchFilterDayUiState = searchFilterDayUiState, From 306021747cfef37445cfdc434bddd19ce3719c36 Mon Sep 17 00:00:00 2001 From: nishimy432 Date: Mon, 2 Sep 2024 20:02:12 +0900 Subject: [PATCH 20/21] Remove space --- .../droidkaigi/confsched/sessions/SearchScreenPresenter.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/SearchScreenPresenter.kt b/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/SearchScreenPresenter.kt index a26063ed0..d196348c4 100644 --- a/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/SearchScreenPresenter.kt +++ b/feature/sessions/src/commonMain/kotlin/io/github/droidkaigi/confsched/sessions/SearchScreenPresenter.kt @@ -50,7 +50,7 @@ fun searchScreenPresenter( val sessions by rememberUpdatedState(sessionsRepository.timetable()) var searchWord by rememberRetained { mutableStateOf("") } - var hasSearched by rememberRetained { mutableStateOf(false) } + var hasSearched by rememberRetained { mutableStateOf(false) } val selectedDays = rememberRetained { mutableStateListOf() } val selectedSessionTypes = rememberRetained { mutableStateListOf() } val selectedCategories = rememberRetained { mutableStateListOf() } From 08b1948bf0655654a43a78c0c308742925ad8877 Mon Sep 17 00:00:00 2001 From: yimajo Date: Tue, 3 Sep 2024 01:44:29 +0900 Subject: [PATCH 21/21] Remove unnecessary import --- app-ios/Sources/AboutFeature/AboutView.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/app-ios/Sources/AboutFeature/AboutView.swift b/app-ios/Sources/AboutFeature/AboutView.swift index d1a8ab2cd..072eb09eb 100644 --- a/app-ios/Sources/AboutFeature/AboutView.swift +++ b/app-ios/Sources/AboutFeature/AboutView.swift @@ -1,6 +1,5 @@ import ComposableArchitecture import SwiftUI -import LicenseList import Theme @ViewAction(for: AboutReducer.self)