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 1/4] 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 2/4] 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 3/4] 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 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 4/4] 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