diff --git a/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched/ui/component/AnimatedLargeTopAppBar.kt b/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched/ui/component/AnimatedLargeTopAppBar.kt index 1437795c2..8a0a6412b 100644 --- a/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched/ui/component/AnimatedLargeTopAppBar.kt +++ b/core/ui/src/commonMain/kotlin/io/github/droidkaigi/confsched/ui/component/AnimatedLargeTopAppBar.kt @@ -34,6 +34,7 @@ import androidx.compose.ui.unit.dp fun AnimatedLargeTopAppBar( title: String, onBackClick: () -> Unit, + navIconContentDescription: String?, modifier: Modifier = Modifier, actions: @Composable RowScope.() -> Unit = {}, windowInsets: WindowInsets = TopAppBarDefaults.windowInsets, @@ -92,7 +93,7 @@ fun AnimatedLargeTopAppBar( ) { Icon( imageVector = Filled.ArrowBack, - contentDescription = "Back", + contentDescription = navIconContentDescription, ) } }, 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 2e014bc49..28a0a13af 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 @@ -6,16 +6,10 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items -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.Scaffold import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState -import androidx.compose.material3.Text import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.runtime.remember @@ -30,6 +24,7 @@ import io.github.droidkaigi.confsched.contributors.component.ContributorsItem import io.github.droidkaigi.confsched.model.Contributor import io.github.droidkaigi.confsched.ui.SnackbarMessageEffect import io.github.droidkaigi.confsched.ui.UserMessageStateHolder +import io.github.droidkaigi.confsched.ui.component.AnimatedLargeTopAppBar import io.github.droidkaigi.confsched.ui.handleOnClickIfNotNavigating import kotlinx.collections.immutable.PersistentList @@ -109,22 +104,12 @@ fun ContributorsScreen( modifier = modifier.testTag(ContributorsScreenTestTag), snackbarHost = { SnackbarHost(hostState = snackbarHostState) }, topBar = { - if (scrollBehavior != null) { - LargeTopAppBar( - title = { - Text(text = "Contributor") - }, - navigationIcon = { - IconButton( - onClick = onBackClick, - ) { - Icon( - imageVector = Filled.ArrowBack, - contentDescription = "Back", - ) - } - }, + if (!isTopAppBarHidden) { + AnimatedLargeTopAppBar( + title = "Contributor", + onBackClick = onBackClick, scrollBehavior = scrollBehavior, + navIconContentDescription = "Back", ) } }, 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 508206caf..79c0d7e8b 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 @@ -3,17 +3,11 @@ package io.github.droidkaigi.confsched.sponsors import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxSize 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.Scaffold import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.Surface -import androidx.compose.material3.Text import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.runtime.remember @@ -35,6 +29,7 @@ import io.github.droidkaigi.confsched.sponsors.section.SponsorsList 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.handleOnClickIfNotNavigating import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.toPersistentList @@ -120,22 +115,12 @@ fun SponsorsScreen( modifier = modifier.testTag(SponsorsScreenTestTag), snackbarHost = { SnackbarHost(hostState = snackbarHostState) }, topBar = { - if (scrollBehavior != null) { - LargeTopAppBar( - title = { - Text(text = stringResource(SponsorsRes.string.sponsor)) - }, - navigationIcon = { - IconButton( - onClick = onBackClick, - ) { - Icon( - imageVector = Filled.ArrowBack, - contentDescription = stringResource(SponsorsRes.string.content_description_back), - ) - } - }, + if (!isTopAppBarHidden) { + AnimatedLargeTopAppBar( + title = stringResource(SponsorsRes.string.sponsor), + onBackClick = onBackClick, scrollBehavior = scrollBehavior, + navIconContentDescription = stringResource(SponsorsRes.string.content_description_back), ) } }, 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 2d2704c34..eeee900dc 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 @@ -112,6 +112,7 @@ fun StaffScreen( title = "Staff", onBackClick = onBackClick, scrollBehavior = scrollBehavior, + navIconContentDescription = "Back", ) } },