From 6eaca3cb5b76a414e1146abce8c2c2371abec337 Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Sat, 28 Dec 2024 15:26:10 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[PC-185]=20=EB=B0=94=ED=85=80=20=EB=84=A4?= =?UTF-8?q?=EB=B9=84=EA=B2=8C=EC=9D=B4=EC=85=98=20=EB=B7=B0=20=EB=B0=8F=20?= =?UTF-8?q?Scaffold=20Container=20=EC=83=89=EC=83=81=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../piece/navigation/TopLevelDestinvation.kt | 40 ++++++++----------- app/src/main/java/com/puzzle/piece/ui/App.kt | 32 +++++++++------ app/src/main/res/drawable/ic_profile.xml | 33 +++++++++++++++ app/src/main/res/drawable/ic_setting.xml | 16 ++++++++ 4 files changed, 86 insertions(+), 35 deletions(-) create mode 100644 app/src/main/res/drawable/ic_profile.xml create mode 100644 app/src/main/res/drawable/ic_setting.xml diff --git a/app/src/main/java/com/puzzle/piece/navigation/TopLevelDestinvation.kt b/app/src/main/java/com/puzzle/piece/navigation/TopLevelDestinvation.kt index ef734737..61ed448e 100644 --- a/app/src/main/java/com/puzzle/piece/navigation/TopLevelDestinvation.kt +++ b/app/src/main/java/com/puzzle/piece/navigation/TopLevelDestinvation.kt @@ -1,40 +1,34 @@ package com.puzzle.piece.navigation -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Call -import androidx.compose.material.icons.outlined.Call -import androidx.compose.ui.graphics.vector.ImageVector +import androidx.annotation.DrawableRes import com.puzzle.navigation.EtcRoute import com.puzzle.navigation.MatchingGraphDest import com.puzzle.navigation.MyPageRoute +import com.puzzle.piece.R import kotlin.reflect.KClass enum class TopLevelDestination( - val selectedIcon: ImageVector, - val unselectedIcon: ImageVector, - val iconText: String, - val titleText: String, + @DrawableRes val iconDrawableId: Int, + val contentDescription: String, + val title: String, val route: KClass<*>, ) { - MATCHING( - selectedIcon = Icons.Filled.Call, - unselectedIcon = Icons.Outlined.Call, - iconText = "매칭", - titleText = "매칭", - route = MatchingGraphDest.MatchingRoute::class, - ), MY_PAGE( - selectedIcon = Icons.Filled.Call, - unselectedIcon = Icons.Outlined.Call, - iconText = "마이페이지", - titleText = "마이페이지", + iconDrawableId = R.drawable.ic_profile, + contentDescription = "마이페이지", + title = "마이페이지", route = MyPageRoute::class, ), + MATCHING( + iconDrawableId = R.drawable.ic_profile, + contentDescription = "매칭", + title = "매칭", + route = MatchingGraphDest.MatchingRoute::class, + ), ETC( - selectedIcon = Icons.Filled.Call, - unselectedIcon = Icons.Outlined.Call, - iconText = "ETC", - titleText = "ETC", + iconDrawableId = R.drawable.ic_setting, + contentDescription = "ETC", + title = "ETC", route = EtcRoute::class, ); diff --git a/app/src/main/java/com/puzzle/piece/ui/App.kt b/app/src/main/java/com/puzzle/piece/ui/App.kt index 7174510e..eeb07dd0 100644 --- a/app/src/main/java/com/puzzle/piece/ui/App.kt +++ b/app/src/main/java/com/puzzle/piece/ui/App.kt @@ -1,19 +1,22 @@ package com.puzzle.piece.ui +import androidx.compose.foundation.Image import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.material.BottomNavigation import androidx.compose.material.BottomNavigationItem -import androidx.compose.material3.Icon import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp import androidx.navigation.NavDestination import androidx.navigation.NavDestination.Companion.hasRoute import androidx.navigation.NavDestination.Companion.hierarchy import androidx.navigation.NavHostController import androidx.navigation.compose.currentBackStackEntryAsState +import com.puzzle.designsystem.foundation.PieceTheme import com.puzzle.navigation.AuthGraph import com.puzzle.navigation.EtcRoute import com.puzzle.navigation.MatchingGraph @@ -42,7 +45,8 @@ fun App( navigateToTopLevelDestination = navigateToTopLevelDestination, ) } - } + }, + containerColor = PieceTheme.colors.white, ) { innerPadding -> val contentModifier = modifier.padding(innerPadding) @@ -59,18 +63,27 @@ private fun AppBottomBar( navigateToTopLevelDestination: (Route) -> Unit, ) { BottomNavigation( + elevation = 0.dp, + backgroundColor = PieceTheme.colors.white, modifier = Modifier.navigationBarsPadding() ) { TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> BottomNavigationItem( icon = { - Icon( - imageVector = topLevelRoute.selectedIcon, - contentDescription = topLevelRoute.name + Image( + painter = painterResource(topLevelRoute.iconDrawableId), + contentDescription = topLevelRoute.contentDescription, + ) + }, + label = { + Text( + text = topLevelRoute.title, + style = PieceTheme.typography.captionM, ) }, - label = { Text(topLevelRoute.name) }, selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), + selectedContentColor = PieceTheme.colors.primaryDefault, + unselectedContentColor = PieceTheme.colors.dark3, onClick = { when (topLevelRoute) { TopLevelDestination.MATCHING -> navigateToTopLevelDestination(MatchingGraph) @@ -88,9 +101,6 @@ private val HIDDEN_BOTTOM_NAV_ROUTES = setOf( MatchingDetailRoute::class.qualifiedName ) -/** - * 현재 목적지가 바텀 네비게이션이 보여지지 않는 화면인지 확인하는 메서드 - */ private fun NavDestination?.shouldHideBottomNavigation(): Boolean = this?.hierarchy?.any { destination -> destination.route in HIDDEN_BOTTOM_NAV_ROUTES @@ -100,6 +110,4 @@ private fun NavDestination?.shouldHideBottomNavigation(): Boolean = * 현재 목적지가 TopLevelDestination 라우트에 속하는지 확인하는 메서드 */ private fun NavDestination?.isRouteInHierarchy(route: KClass<*>): Boolean = - this?.hierarchy?.any { - it.hasRoute(route) - } ?: false \ No newline at end of file + this?.hierarchy?.any { it.hasRoute(route) } ?: false \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_profile.xml b/app/src/main/res/drawable/ic_profile.xml new file mode 100644 index 00000000..bc255864 --- /dev/null +++ b/app/src/main/res/drawable/ic_profile.xml @@ -0,0 +1,33 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_setting.xml b/app/src/main/res/drawable/ic_setting.xml new file mode 100644 index 00000000..3371d1cd --- /dev/null +++ b/app/src/main/res/drawable/ic_setting.xml @@ -0,0 +1,16 @@ + + + + From f80f29c5edc4776507bf362530d91b7c87af28d2 Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Sat, 28 Dec 2024 16:44:56 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[PC-185]=20BottomNavigationItem=EC=9D=84=20?= =?UTF-8?q?=ED=81=B4=EB=A6=AD=ED=95=A0=20=EB=95=8C=20Ripple=20=ED=9A=A8?= =?UTF-8?q?=EA=B3=BC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/puzzle/piece/ui/App.kt | 39 +++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/com/puzzle/piece/ui/App.kt b/app/src/main/java/com/puzzle/piece/ui/App.kt index eeb07dd0..ff7ee09f 100644 --- a/app/src/main/java/com/puzzle/piece/ui/App.kt +++ b/app/src/main/java/com/puzzle/piece/ui/App.kt @@ -1,13 +1,19 @@ +@file:OptIn(ExperimentalMaterial3Api::class) + package com.puzzle.piece.ui -import androidx.compose.foundation.Image +import androidx.compose.foundation.interaction.Interaction +import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.material.BottomNavigation import androidx.compose.material.BottomNavigationItem +import androidx.compose.material.Icon +import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp @@ -25,6 +31,8 @@ import com.puzzle.navigation.MyPageRoute import com.puzzle.navigation.Route import com.puzzle.piece.navigation.AppNavHost import com.puzzle.piece.navigation.TopLevelDestination +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.emptyFlow import kotlin.reflect.KClass @Composable @@ -65,12 +73,13 @@ private fun AppBottomBar( BottomNavigation( elevation = 0.dp, backgroundColor = PieceTheme.colors.white, - modifier = Modifier.navigationBarsPadding() + modifier = Modifier.navigationBarsPadding(), ) { TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> BottomNavigationItem( + interactionSource = remember { NoRippleInteractionSource() }, icon = { - Image( + Icon( painter = painterResource(topLevelRoute.iconDrawableId), contentDescription = topLevelRoute.contentDescription, ) @@ -81,12 +90,15 @@ private fun AppBottomBar( style = PieceTheme.typography.captionM, ) }, - selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), selectedContentColor = PieceTheme.colors.primaryDefault, unselectedContentColor = PieceTheme.colors.dark3, + selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), onClick = { when (topLevelRoute) { - TopLevelDestination.MATCHING -> navigateToTopLevelDestination(MatchingGraph) + TopLevelDestination.MATCHING -> navigateToTopLevelDestination( + MatchingGraph + ) + TopLevelDestination.MY_PAGE -> navigateToTopLevelDestination(MyPageRoute) TopLevelDestination.ETC -> navigateToTopLevelDestination(EtcRoute) } @@ -96,18 +108,19 @@ private fun AppBottomBar( } } +class NoRippleInteractionSource : MutableInteractionSource { + override suspend fun emit(interaction: Interaction) {} + override val interactions: Flow = emptyFlow() + override fun tryEmit(interaction: Interaction): Boolean = true +} + private val HIDDEN_BOTTOM_NAV_ROUTES = setOf( AuthGraph::class.qualifiedName, - MatchingDetailRoute::class.qualifiedName + MatchingDetailRoute::class.qualifiedName, ) private fun NavDestination?.shouldHideBottomNavigation(): Boolean = - this?.hierarchy?.any { destination -> - destination.route in HIDDEN_BOTTOM_NAV_ROUTES - } ?: false + this?.hierarchy?.any { destination -> destination.route in HIDDEN_BOTTOM_NAV_ROUTES } ?: false -/** - * 현재 목적지가 TopLevelDestination 라우트에 속하는지 확인하는 메서드 - */ private fun NavDestination?.isRouteInHierarchy(route: KClass<*>): Boolean = - this?.hierarchy?.any { it.hasRoute(route) } ?: false \ No newline at end of file + this?.hierarchy?.any { it.hasRoute(route) } == true From 4c73d4e8c4ae0f9676ac0fb04fa668d74b8aaef0 Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Sat, 28 Dec 2024 16:55:15 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[PC-185]=20NoRippleInteractionSource?= =?UTF-8?q?=EB=A5=BC=20common-ui=20=EB=AA=A8=EB=93=88=EB=A1=9C=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 1 + app/src/main/java/com/puzzle/piece/ui/App.kt | 11 +++-------- .../java/com/puzzle/common/ui/InteractionSource.kt | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 core/common-ui/src/main/java/com/puzzle/common/ui/InteractionSource.kt diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e78c245d..6a0cb374 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -52,4 +52,5 @@ dependencies { implementation(projects.core.designsystem) implementation(projects.core.navigation) + implementation(projects.core.commonUi) } \ No newline at end of file diff --git a/app/src/main/java/com/puzzle/piece/ui/App.kt b/app/src/main/java/com/puzzle/piece/ui/App.kt index ff7ee09f..dc2a2cb1 100644 --- a/app/src/main/java/com/puzzle/piece/ui/App.kt +++ b/app/src/main/java/com/puzzle/piece/ui/App.kt @@ -22,6 +22,7 @@ import androidx.navigation.NavDestination.Companion.hasRoute import androidx.navigation.NavDestination.Companion.hierarchy import androidx.navigation.NavHostController import androidx.navigation.compose.currentBackStackEntryAsState +import com.puzzle.common.ui.NoRippleInteractionSource import com.puzzle.designsystem.foundation.PieceTheme import com.puzzle.navigation.AuthGraph import com.puzzle.navigation.EtcRoute @@ -77,7 +78,6 @@ private fun AppBottomBar( ) { TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> BottomNavigationItem( - interactionSource = remember { NoRippleInteractionSource() }, icon = { Icon( painter = painterResource(topLevelRoute.iconDrawableId), @@ -90,9 +90,10 @@ private fun AppBottomBar( style = PieceTheme.typography.captionM, ) }, + selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), selectedContentColor = PieceTheme.colors.primaryDefault, unselectedContentColor = PieceTheme.colors.dark3, - selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), + interactionSource = remember { NoRippleInteractionSource() }, onClick = { when (topLevelRoute) { TopLevelDestination.MATCHING -> navigateToTopLevelDestination( @@ -108,12 +109,6 @@ private fun AppBottomBar( } } -class NoRippleInteractionSource : MutableInteractionSource { - override suspend fun emit(interaction: Interaction) {} - override val interactions: Flow = emptyFlow() - override fun tryEmit(interaction: Interaction): Boolean = true -} - private val HIDDEN_BOTTOM_NAV_ROUTES = setOf( AuthGraph::class.qualifiedName, MatchingDetailRoute::class.qualifiedName, diff --git a/core/common-ui/src/main/java/com/puzzle/common/ui/InteractionSource.kt b/core/common-ui/src/main/java/com/puzzle/common/ui/InteractionSource.kt new file mode 100644 index 00000000..634660a4 --- /dev/null +++ b/core/common-ui/src/main/java/com/puzzle/common/ui/InteractionSource.kt @@ -0,0 +1,14 @@ +package com.puzzle.common.ui + +import androidx.compose.foundation.interaction.Interaction +import androidx.compose.foundation.interaction.MutableInteractionSource +import androidx.compose.runtime.Immutable +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.emptyFlow + +@Immutable +class NoRippleInteractionSource : MutableInteractionSource { + override suspend fun emit(interaction: Interaction) {} + override val interactions: Flow = emptyFlow() + override fun tryEmit(interaction: Interaction): Boolean = true +} \ No newline at end of file From 9a7410f593c199eb626e4aa05a034f6966b52616 Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Sat, 28 Dec 2024 17:11:33 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[PC-185]=20BottomNavigation=EC=9D=84=20Mate?= =?UTF-8?q?ria3=EB=A1=9C=20=EB=A7=88=EC=9D=B4=EA=B7=B8=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=85=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/puzzle/piece/ui/App.kt | 33 +++++++++----------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/com/puzzle/piece/ui/App.kt b/app/src/main/java/com/puzzle/piece/ui/App.kt index dc2a2cb1..98bdc3a3 100644 --- a/app/src/main/java/com/puzzle/piece/ui/App.kt +++ b/app/src/main/java/com/puzzle/piece/ui/App.kt @@ -2,21 +2,19 @@ package com.puzzle.piece.ui -import androidx.compose.foundation.interaction.Interaction -import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding -import androidx.compose.material.BottomNavigation -import androidx.compose.material.BottomNavigationItem -import androidx.compose.material.Icon import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.NavigationBar +import androidx.compose.material3.NavigationBarItem import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource -import androidx.compose.ui.unit.dp import androidx.navigation.NavDestination import androidx.navigation.NavDestination.Companion.hasRoute import androidx.navigation.NavDestination.Companion.hierarchy @@ -32,8 +30,6 @@ import com.puzzle.navigation.MyPageRoute import com.puzzle.navigation.Route import com.puzzle.piece.navigation.AppNavHost import com.puzzle.piece.navigation.TopLevelDestination -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.emptyFlow import kotlin.reflect.KClass @Composable @@ -71,13 +67,12 @@ private fun AppBottomBar( currentDestination: NavDestination?, navigateToTopLevelDestination: (Route) -> Unit, ) { - BottomNavigation( - elevation = 0.dp, - backgroundColor = PieceTheme.colors.white, + NavigationBar( + containerColor = PieceTheme.colors.white, modifier = Modifier.navigationBarsPadding(), ) { TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> - BottomNavigationItem( + NavigationBarItem( icon = { Icon( painter = painterResource(topLevelRoute.iconDrawableId), @@ -91,15 +86,17 @@ private fun AppBottomBar( ) }, selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), - selectedContentColor = PieceTheme.colors.primaryDefault, - unselectedContentColor = PieceTheme.colors.dark3, + colors = androidx.compose.material3.NavigationBarItemDefaults.colors( + selectedIconColor = PieceTheme.colors.primaryDefault, + unselectedIconColor = PieceTheme.colors.dark3, + selectedTextColor = PieceTheme.colors.primaryDefault, + unselectedTextColor = PieceTheme.colors.dark3, + indicatorColor = Color.Transparent, + ), interactionSource = remember { NoRippleInteractionSource() }, onClick = { when (topLevelRoute) { - TopLevelDestination.MATCHING -> navigateToTopLevelDestination( - MatchingGraph - ) - + TopLevelDestination.MATCHING -> navigateToTopLevelDestination(MatchingGraph) TopLevelDestination.MY_PAGE -> navigateToTopLevelDestination(MyPageRoute) TopLevelDestination.ETC -> navigateToTopLevelDestination(EtcRoute) } From 4fee7de907d1653bbb188feb64d39710b0dc5ece Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Sat, 28 Dec 2024 17:43:57 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[PC-185]=20BottomNavigation=EC=9D=98=20Icon?= =?UTF-8?q?=EA=B3=BC=20Label=EC=82=AC=EC=9D=B4=20=EA=B0=84=EA=B2=A9?= =?UTF-8?q?=EC=9D=84=20=EC=A1=B0=EC=A0=95=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/puzzle/piece/ui/App.kt | 33 +++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/puzzle/piece/ui/App.kt b/app/src/main/java/com/puzzle/piece/ui/App.kt index 98bdc3a3..6a4e353f 100644 --- a/app/src/main/java/com/puzzle/piece/ui/App.kt +++ b/app/src/main/java/com/puzzle/piece/ui/App.kt @@ -2,8 +2,11 @@ package com.puzzle.piece.ui +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.NavigationBar @@ -15,6 +18,7 @@ import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource +import androidx.compose.ui.unit.dp import androidx.navigation.NavDestination import androidx.navigation.NavDestination.Companion.hasRoute import androidx.navigation.NavDestination.Companion.hierarchy @@ -69,21 +73,28 @@ private fun AppBottomBar( ) { NavigationBar( containerColor = PieceTheme.colors.white, - modifier = Modifier.navigationBarsPadding(), + modifier = Modifier + .navigationBarsPadding() + .height(68.dp), ) { TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> NavigationBarItem( + alwaysShowLabel = false, icon = { - Icon( - painter = painterResource(topLevelRoute.iconDrawableId), - contentDescription = topLevelRoute.contentDescription, - ) - }, - label = { - Text( - text = topLevelRoute.title, - style = PieceTheme.typography.captionM, - ) + Column( + horizontalAlignment = androidx.compose.ui.Alignment.CenterHorizontally, + modifier = Modifier.padding(top = 2.dp), + ) { + Icon( + painter = painterResource(topLevelRoute.iconDrawableId), + contentDescription = topLevelRoute.contentDescription, + modifier = Modifier.size(32.dp), + ) + Text( + text = topLevelRoute.title, + style = PieceTheme.typography.captionM, + ) + } }, selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), colors = androidx.compose.material3.NavigationBarItemDefaults.colors( From 6f925ceba8dfe9c92454e91f2b66e6f320a191bd Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Sat, 28 Dec 2024 17:59:18 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[PC-185]=20ETC=20->=20Setting=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=9D=B4=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 4 +- .../com/puzzle/piece/navigation/AppNavHost.kt | 4 +- .../piece/navigation/TopLevelDestinvation.kt | 14 +-- app/src/main/java/com/puzzle/piece/ui/App.kt | 111 +++++++++++------- app/src/main/res/drawable/ic_matching.xml | 17 +++ .../main/java/com/puzzle/navigation/Route.kt | 2 +- .../puzzle/etc/navigation/EtcNavigation.kt | 12 -- feature/{etc => setting}/.gitignore | 0 feature/{etc => setting}/build.gradle.kts | 2 +- feature/{etc => setting}/consumer-rules.pro | 0 feature/{etc => setting}/proguard-rules.pro | 0 .../setting}/ExampleInstrumentedTest.kt | 2 +- .../src/main/AndroidManifest.xml | 0 .../java/com/puzzle/setting/SettingScreen.kt} | 10 +- .../setting/navigation/SettingNavigation.kt | 12 ++ .../com/puzzle/setting}/ExampleUnitTest.kt | 2 +- settings.gradle.kts | 2 +- 17 files changed, 119 insertions(+), 75 deletions(-) create mode 100644 app/src/main/res/drawable/ic_matching.xml delete mode 100644 feature/etc/src/main/java/com/puzzle/etc/navigation/EtcNavigation.kt rename feature/{etc => setting}/.gitignore (100%) rename feature/{etc => setting}/build.gradle.kts (60%) rename feature/{etc => setting}/consumer-rules.pro (100%) rename feature/{etc => setting}/proguard-rules.pro (100%) rename feature/{etc/src/androidTest/java/com/puzzle/etc => setting/src/androidTest/java/com/puzzle/setting}/ExampleInstrumentedTest.kt (95%) rename feature/{etc => setting}/src/main/AndroidManifest.xml (100%) rename feature/{etc/src/main/java/com/puzzle/etc/EtcScreen.kt => setting/src/main/java/com/puzzle/setting/SettingScreen.kt} (77%) create mode 100644 feature/setting/src/main/java/com/puzzle/setting/navigation/SettingNavigation.kt rename feature/{etc/src/test/java/com/puzzle/etc => setting/src/test/java/com/puzzle/setting}/ExampleUnitTest.kt (92%) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6a0cb374..ceba3e48 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -21,8 +21,6 @@ android { buildConfigField("String", "KAKAO_APP_KEY", "\"${localProperties["KAKAO_APP_KEY"]}\"") } - packaging { resources { excludes += "/META-INF/*" } } - buildTypes { release { signingConfig = signingConfigs.getByName("debug") @@ -46,7 +44,7 @@ dependencies { implementation(libs.kakao.user) implementation(projects.feature.auth) - implementation(projects.feature.etc) + implementation(projects.feature.setting) implementation(projects.feature.matching) implementation(projects.feature.mypage) diff --git a/app/src/main/java/com/puzzle/piece/navigation/AppNavHost.kt b/app/src/main/java/com/puzzle/piece/navigation/AppNavHost.kt index 4364d591..32b4ea71 100644 --- a/app/src/main/java/com/puzzle/piece/navigation/AppNavHost.kt +++ b/app/src/main/java/com/puzzle/piece/navigation/AppNavHost.kt @@ -5,7 +5,7 @@ import androidx.compose.ui.Modifier import androidx.navigation.NavHostController import androidx.navigation.compose.NavHost import com.puzzle.auth.navigation.authNavGraph -import com.puzzle.etc.navigation.etcScreen +import com.puzzle.setting.navigation.settingScreen import com.puzzle.matching.navigation.matchingNavGraph import com.puzzle.mypage.navigation.myPageScreen import com.puzzle.navigation.AuthGraph @@ -23,6 +23,6 @@ fun AppNavHost( authNavGraph() matchingNavGraph() myPageScreen() - etcScreen() + settingScreen() } } diff --git a/app/src/main/java/com/puzzle/piece/navigation/TopLevelDestinvation.kt b/app/src/main/java/com/puzzle/piece/navigation/TopLevelDestinvation.kt index 61ed448e..199a1ba3 100644 --- a/app/src/main/java/com/puzzle/piece/navigation/TopLevelDestinvation.kt +++ b/app/src/main/java/com/puzzle/piece/navigation/TopLevelDestinvation.kt @@ -1,7 +1,7 @@ package com.puzzle.piece.navigation import androidx.annotation.DrawableRes -import com.puzzle.navigation.EtcRoute +import com.puzzle.navigation.SettingRoute import com.puzzle.navigation.MatchingGraphDest import com.puzzle.navigation.MyPageRoute import com.puzzle.piece.R @@ -15,8 +15,8 @@ enum class TopLevelDestination( ) { MY_PAGE( iconDrawableId = R.drawable.ic_profile, - contentDescription = "마이페이지", - title = "마이페이지", + contentDescription = "프로필", + title = "프로필", route = MyPageRoute::class, ), MATCHING( @@ -25,11 +25,11 @@ enum class TopLevelDestination( title = "매칭", route = MatchingGraphDest.MatchingRoute::class, ), - ETC( + SETTING( iconDrawableId = R.drawable.ic_setting, - contentDescription = "ETC", - title = "ETC", - route = EtcRoute::class, + contentDescription = "설정", + title = "설정", + route = SettingRoute::class, ); companion object { diff --git a/app/src/main/java/com/puzzle/piece/ui/App.kt b/app/src/main/java/com/puzzle/piece/ui/App.kt index 6a4e353f..78f1a94e 100644 --- a/app/src/main/java/com/puzzle/piece/ui/App.kt +++ b/app/src/main/java/com/puzzle/piece/ui/App.kt @@ -2,11 +2,16 @@ package com.puzzle.piece.ui +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.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.NavigationBar @@ -15,7 +20,9 @@ import androidx.compose.material3.Scaffold import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp @@ -27,11 +34,12 @@ import androidx.navigation.compose.currentBackStackEntryAsState import com.puzzle.common.ui.NoRippleInteractionSource import com.puzzle.designsystem.foundation.PieceTheme import com.puzzle.navigation.AuthGraph -import com.puzzle.navigation.EtcRoute +import com.puzzle.navigation.SettingRoute import com.puzzle.navigation.MatchingGraph import com.puzzle.navigation.MatchingGraphDest.MatchingDetailRoute import com.puzzle.navigation.MyPageRoute import com.puzzle.navigation.Route +import com.puzzle.piece.R import com.puzzle.piece.navigation.AppNavHost import com.puzzle.piece.navigation.TopLevelDestination import kotlin.reflect.KClass @@ -71,49 +79,70 @@ private fun AppBottomBar( currentDestination: NavDestination?, navigateToTopLevelDestination: (Route) -> Unit, ) { - NavigationBar( - containerColor = PieceTheme.colors.white, + Box( modifier = Modifier - .navigationBarsPadding() - .height(68.dp), + .fillMaxWidth() + .height(80.dp), ) { - TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> - NavigationBarItem( - alwaysShowLabel = false, - icon = { - Column( - horizontalAlignment = androidx.compose.ui.Alignment.CenterHorizontally, - modifier = Modifier.padding(top = 2.dp), - ) { - Icon( - painter = painterResource(topLevelRoute.iconDrawableId), - contentDescription = topLevelRoute.contentDescription, - modifier = Modifier.size(32.dp), - ) - Text( - text = topLevelRoute.title, - style = PieceTheme.typography.captionM, - ) - } - }, - selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), - colors = androidx.compose.material3.NavigationBarItemDefaults.colors( - selectedIconColor = PieceTheme.colors.primaryDefault, - unselectedIconColor = PieceTheme.colors.dark3, - selectedTextColor = PieceTheme.colors.primaryDefault, - unselectedTextColor = PieceTheme.colors.dark3, - indicatorColor = Color.Transparent, - ), - interactionSource = remember { NoRippleInteractionSource() }, - onClick = { - when (topLevelRoute) { - TopLevelDestination.MATCHING -> navigateToTopLevelDestination(MatchingGraph) - TopLevelDestination.MY_PAGE -> navigateToTopLevelDestination(MyPageRoute) - TopLevelDestination.ETC -> navigateToTopLevelDestination(EtcRoute) - } - }, - ) + NavigationBar( + containerColor = PieceTheme.colors.white, + modifier = Modifier + .align(Alignment.BottomCenter) + .navigationBarsPadding() + .height(68.dp), + ) { + TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> + NavigationBarItem( + alwaysShowLabel = false, + icon = { + Column( + horizontalAlignment = androidx.compose.ui.Alignment.CenterHorizontally, + modifier = Modifier.padding(top = 2.dp), + ) { + Icon( + painter = painterResource(topLevelRoute.iconDrawableId), + contentDescription = topLevelRoute.contentDescription, + modifier = Modifier.size(32.dp), + ) + Text( + text = topLevelRoute.title, + style = PieceTheme.typography.captionM, + ) + } + }, + selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), + colors = androidx.compose.material3.NavigationBarItemDefaults.colors( + selectedIconColor = PieceTheme.colors.primaryDefault, + unselectedIconColor = PieceTheme.colors.dark3, + selectedTextColor = PieceTheme.colors.primaryDefault, + unselectedTextColor = PieceTheme.colors.dark3, + indicatorColor = Color.Transparent, + ), + interactionSource = remember { NoRippleInteractionSource() }, + onClick = { + when (topLevelRoute) { + TopLevelDestination.MATCHING -> navigateToTopLevelDestination( + MatchingGraph + ) + + TopLevelDestination.MY_PAGE -> navigateToTopLevelDestination(MyPageRoute) + TopLevelDestination.SETTING -> navigateToTopLevelDestination(SettingRoute) + } + }, + ) + } } + + Image( + painter = painterResource(R.drawable.ic_matching), + contentDescription = null, + modifier = Modifier + .align(Alignment.BottomCenter) + .navigationBarsPadding() + .size(80.dp) + .clip(CircleShape) + .background(PieceTheme.colors.white), + ) } } diff --git a/app/src/main/res/drawable/ic_matching.xml b/app/src/main/res/drawable/ic_matching.xml new file mode 100644 index 00000000..46acaef7 --- /dev/null +++ b/app/src/main/res/drawable/ic_matching.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/core/navigation/src/main/java/com/puzzle/navigation/Route.kt b/core/navigation/src/main/java/com/puzzle/navigation/Route.kt index 20da3740..a2984cc5 100644 --- a/core/navigation/src/main/java/com/puzzle/navigation/Route.kt +++ b/core/navigation/src/main/java/com/puzzle/navigation/Route.kt @@ -13,7 +13,7 @@ sealed class AuthGraphDest : Route { } @Serializable -data object EtcRoute : Route +data object SettingRoute : Route @Serializable data object MatchingGraph : Route diff --git a/feature/etc/src/main/java/com/puzzle/etc/navigation/EtcNavigation.kt b/feature/etc/src/main/java/com/puzzle/etc/navigation/EtcNavigation.kt deleted file mode 100644 index 9dc4db8b..00000000 --- a/feature/etc/src/main/java/com/puzzle/etc/navigation/EtcNavigation.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.puzzle.etc.navigation - -import androidx.navigation.NavGraphBuilder -import androidx.navigation.compose.composable -import com.puzzle.etc.EtcRoute -import com.puzzle.navigation.EtcRoute - -fun NavGraphBuilder.etcScreen() { - composable { - EtcRoute() - } -} diff --git a/feature/etc/.gitignore b/feature/setting/.gitignore similarity index 100% rename from feature/etc/.gitignore rename to feature/setting/.gitignore diff --git a/feature/etc/build.gradle.kts b/feature/setting/build.gradle.kts similarity index 60% rename from feature/etc/build.gradle.kts rename to feature/setting/build.gradle.kts index 4b387bc2..5d23cc98 100644 --- a/feature/etc/build.gradle.kts +++ b/feature/setting/build.gradle.kts @@ -3,5 +3,5 @@ plugins { } android { - namespace = "com.puzzle.etc" + namespace = "com.puzzle.setting" } diff --git a/feature/etc/consumer-rules.pro b/feature/setting/consumer-rules.pro similarity index 100% rename from feature/etc/consumer-rules.pro rename to feature/setting/consumer-rules.pro diff --git a/feature/etc/proguard-rules.pro b/feature/setting/proguard-rules.pro similarity index 100% rename from feature/etc/proguard-rules.pro rename to feature/setting/proguard-rules.pro diff --git a/feature/etc/src/androidTest/java/com/puzzle/etc/ExampleInstrumentedTest.kt b/feature/setting/src/androidTest/java/com/puzzle/setting/ExampleInstrumentedTest.kt similarity index 95% rename from feature/etc/src/androidTest/java/com/puzzle/etc/ExampleInstrumentedTest.kt rename to feature/setting/src/androidTest/java/com/puzzle/setting/ExampleInstrumentedTest.kt index 8ba53323..8d6f6fc1 100644 --- a/feature/etc/src/androidTest/java/com/puzzle/etc/ExampleInstrumentedTest.kt +++ b/feature/setting/src/androidTest/java/com/puzzle/setting/ExampleInstrumentedTest.kt @@ -1,4 +1,4 @@ -package com.puzzle.etc +package com.puzzle.setting import androidx.test.ext.junit.runners.AndroidJUnit4 import androidx.test.platform.app.InstrumentationRegistry diff --git a/feature/etc/src/main/AndroidManifest.xml b/feature/setting/src/main/AndroidManifest.xml similarity index 100% rename from feature/etc/src/main/AndroidManifest.xml rename to feature/setting/src/main/AndroidManifest.xml diff --git a/feature/etc/src/main/java/com/puzzle/etc/EtcScreen.kt b/feature/setting/src/main/java/com/puzzle/setting/SettingScreen.kt similarity index 77% rename from feature/etc/src/main/java/com/puzzle/etc/EtcScreen.kt rename to feature/setting/src/main/java/com/puzzle/setting/SettingScreen.kt index b5ee9317..477492f1 100644 --- a/feature/etc/src/main/java/com/puzzle/etc/EtcScreen.kt +++ b/feature/setting/src/main/java/com/puzzle/setting/SettingScreen.kt @@ -1,4 +1,4 @@ -package com.puzzle.etc +package com.puzzle.setting import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize @@ -9,14 +9,14 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.unit.sp @Composable -fun EtcRoute( +fun SettingRoute( modifier: Modifier = Modifier, ) { Box(modifier = modifier.fillMaxSize(), contentAlignment = Alignment.Center) { - Text(text = "EtcRoute", fontSize = 30.sp) + Text(text = "SettingRoute", fontSize = 30.sp) } } @Composable -internal fun EtcScreen() { -} \ No newline at end of file +internal fun SettingScreen() { +} diff --git a/feature/setting/src/main/java/com/puzzle/setting/navigation/SettingNavigation.kt b/feature/setting/src/main/java/com/puzzle/setting/navigation/SettingNavigation.kt new file mode 100644 index 00000000..6b047673 --- /dev/null +++ b/feature/setting/src/main/java/com/puzzle/setting/navigation/SettingNavigation.kt @@ -0,0 +1,12 @@ +package com.puzzle.setting.navigation + +import androidx.navigation.NavGraphBuilder +import androidx.navigation.compose.composable +import com.puzzle.setting.SettingRoute +import com.puzzle.navigation.SettingRoute + +fun NavGraphBuilder.settingScreen() { + composable { + SettingRoute() + } +} diff --git a/feature/etc/src/test/java/com/puzzle/etc/ExampleUnitTest.kt b/feature/setting/src/test/java/com/puzzle/setting/ExampleUnitTest.kt similarity index 92% rename from feature/etc/src/test/java/com/puzzle/etc/ExampleUnitTest.kt rename to feature/setting/src/test/java/com/puzzle/setting/ExampleUnitTest.kt index 8bca67f4..da9fd3f5 100644 --- a/feature/etc/src/test/java/com/puzzle/etc/ExampleUnitTest.kt +++ b/feature/setting/src/test/java/com/puzzle/setting/ExampleUnitTest.kt @@ -1,4 +1,4 @@ -package com.puzzle.etc +package com.puzzle.setting import org.junit.Assert.assertEquals import org.junit.Test diff --git a/settings.gradle.kts b/settings.gradle.kts index 04bb79af..bed14419 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -27,7 +27,7 @@ include(":app") include(":feature:auth") include(":feature:mypage") include(":feature:matching") -include(":feature:etc") +include(":feature:setting") include(":core:domain") include(":core:designsystem") include(":core:data") From e36bec31752663bb3ae500506263dd4cdee47166 Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Mon, 30 Dec 2024 18:02:05 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[PC-185]=20BottomNavigationView=20=EC=99=84?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 2 + app/src/main/java/com/puzzle/piece/ui/App.kt | 135 +++++++++--------- .../build/logic/configure/AndroidComposes.kt | 2 +- .../com/puzzle/matching/MatchingScreen.kt | 2 +- gradle/libs.versions.toml | 12 +- 5 files changed, 78 insertions(+), 75 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index ceba3e48..e045b811 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -21,6 +21,8 @@ android { buildConfigField("String", "KAKAO_APP_KEY", "\"${localProperties["KAKAO_APP_KEY"]}\"") } + packaging { resources { excludes += "/META-INF/*" } } + buildTypes { release { signingConfig = signingConfigs.getByName("debug") diff --git a/app/src/main/java/com/puzzle/piece/ui/App.kt b/app/src/main/java/com/puzzle/piece/ui/App.kt index 78f1a94e..dcecd432 100644 --- a/app/src/main/java/com/puzzle/piece/ui/App.kt +++ b/app/src/main/java/com/puzzle/piece/ui/App.kt @@ -4,15 +4,17 @@ package com.puzzle.piece.ui 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.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.navigationBarsPadding +import androidx.compose.foundation.layout.offset import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.FabPosition +import androidx.compose.material3.FloatingActionButton +import androidx.compose.material3.FloatingActionButtonDefaults.bottomAppBarFabElevation import androidx.compose.material3.Icon import androidx.compose.material3.NavigationBar import androidx.compose.material3.NavigationBarItem @@ -22,7 +24,6 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp @@ -34,11 +35,11 @@ import androidx.navigation.compose.currentBackStackEntryAsState import com.puzzle.common.ui.NoRippleInteractionSource import com.puzzle.designsystem.foundation.PieceTheme import com.puzzle.navigation.AuthGraph -import com.puzzle.navigation.SettingRoute import com.puzzle.navigation.MatchingGraph import com.puzzle.navigation.MatchingGraphDest.MatchingDetailRoute import com.puzzle.navigation.MyPageRoute import com.puzzle.navigation.Route +import com.puzzle.navigation.SettingRoute import com.puzzle.piece.R import com.puzzle.piece.navigation.AppNavHost import com.puzzle.piece.navigation.TopLevelDestination @@ -63,7 +64,26 @@ fun App( ) } }, - containerColor = PieceTheme.colors.white, + floatingActionButton = { + if (currentDestination?.shouldHideBottomNavigation() == false) { + FloatingActionButton( + onClick = { navigateToTopLevelDestination(MatchingGraph) }, + containerColor = PieceTheme.colors.white, + shape = CircleShape, + elevation = bottomAppBarFabElevation(), + modifier = Modifier.offset(y = 84.dp), + ) { + Image( + painter = painterResource(R.drawable.ic_matching), + contentDescription = null, + modifier = Modifier + .size(80.dp) + .background(PieceTheme.colors.white), + ) + } + } + }, + floatingActionButtonPosition = FabPosition.Center, ) { innerPadding -> val contentModifier = modifier.padding(innerPadding) @@ -79,70 +99,55 @@ private fun AppBottomBar( currentDestination: NavDestination?, navigateToTopLevelDestination: (Route) -> Unit, ) { - Box( + NavigationBar( + containerColor = PieceTheme.colors.white, modifier = Modifier - .fillMaxWidth() - .height(80.dp), + .navigationBarsPadding() + .height(68.dp), ) { - NavigationBar( - containerColor = PieceTheme.colors.white, - modifier = Modifier - .align(Alignment.BottomCenter) - .navigationBarsPadding() - .height(68.dp), - ) { - TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> - NavigationBarItem( - alwaysShowLabel = false, - icon = { - Column( - horizontalAlignment = androidx.compose.ui.Alignment.CenterHorizontally, - modifier = Modifier.padding(top = 2.dp), - ) { - Icon( - painter = painterResource(topLevelRoute.iconDrawableId), - contentDescription = topLevelRoute.contentDescription, - modifier = Modifier.size(32.dp), - ) - Text( - text = topLevelRoute.title, - style = PieceTheme.typography.captionM, - ) - } - }, - selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), - colors = androidx.compose.material3.NavigationBarItemDefaults.colors( - selectedIconColor = PieceTheme.colors.primaryDefault, - unselectedIconColor = PieceTheme.colors.dark3, - selectedTextColor = PieceTheme.colors.primaryDefault, - unselectedTextColor = PieceTheme.colors.dark3, - indicatorColor = Color.Transparent, - ), - interactionSource = remember { NoRippleInteractionSource() }, - onClick = { - when (topLevelRoute) { - TopLevelDestination.MATCHING -> navigateToTopLevelDestination( - MatchingGraph - ) + TopLevelDestination.topLevelDestinations.forEach { topLevelRoute -> + NavigationBarItem( + icon = { + Column( + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier.padding(top = 2.dp), + ) { + Icon( + painter = painterResource(topLevelRoute.iconDrawableId), + contentDescription = topLevelRoute.contentDescription, + modifier = Modifier.size(32.dp), + ) - TopLevelDestination.MY_PAGE -> navigateToTopLevelDestination(MyPageRoute) - TopLevelDestination.SETTING -> navigateToTopLevelDestination(SettingRoute) - } - }, - ) - } - } + Text( + text = topLevelRoute.title, + style = PieceTheme.typography.captionM, + ) + } + }, + alwaysShowLabel = false, + selected = currentDestination.isRouteInHierarchy(topLevelRoute.route), + colors = androidx.compose.material3.NavigationBarItemDefaults.colors( + selectedIconColor = PieceTheme.colors.primaryDefault, + unselectedIconColor = PieceTheme.colors.dark3, + selectedTextColor = PieceTheme.colors.primaryDefault, + unselectedTextColor = PieceTheme.colors.dark3, + indicatorColor = Color.Transparent, + ), + interactionSource = remember { NoRippleInteractionSource() }, + onClick = { + when (topLevelRoute) { + TopLevelDestination.MATCHING -> navigateToTopLevelDestination( + MatchingGraph + ) - Image( - painter = painterResource(R.drawable.ic_matching), - contentDescription = null, - modifier = Modifier - .align(Alignment.BottomCenter) - .navigationBarsPadding() - .size(80.dp) - .clip(CircleShape) - .background(PieceTheme.colors.white), - ) + TopLevelDestination.MY_PAGE -> navigateToTopLevelDestination(MyPageRoute) + TopLevelDestination.SETTING -> navigateToTopLevelDestination( + SettingRoute + ) + } + }, + ) + } } } diff --git a/build-logic/src/main/java/com/puzzle/build/logic/configure/AndroidComposes.kt b/build-logic/src/main/java/com/puzzle/build/logic/configure/AndroidComposes.kt index 51cba50f..722cd11a 100644 --- a/build-logic/src/main/java/com/puzzle/build/logic/configure/AndroidComposes.kt +++ b/build-logic/src/main/java/com/puzzle/build/logic/configure/AndroidComposes.kt @@ -14,7 +14,7 @@ internal fun Project.configureAndroidCompose() { androidExtension.apply { composeOptions { - kotlinCompilerExtensionVersion = "1.3.0" + kotlinCompilerExtensionVersion = "1.5.15" } buildFeatures.apply { diff --git a/feature/matching/src/main/java/com/puzzle/matching/MatchingScreen.kt b/feature/matching/src/main/java/com/puzzle/matching/MatchingScreen.kt index 5148a701..bc597062 100644 --- a/feature/matching/src/main/java/com/puzzle/matching/MatchingScreen.kt +++ b/feature/matching/src/main/java/com/puzzle/matching/MatchingScreen.kt @@ -275,4 +275,4 @@ private fun PreviewMatchingScreen() { navigateToMatchingDetail = {}, ) } -} \ No newline at end of file +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0e6e3bef..ac04860f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] ## Android gradle plugin -androidGradlePlugin = "8.6.1" +androidGradlePlugin = "8.7.2" ## AndroidX # https://developer.android.com/jetpack/androidx/releases/core @@ -24,13 +24,9 @@ androidxSplashscreen = "1.0.1" ## Compose # https://developer.android.com/develop/ui/compose/bom/bom-mapping -androidxComposeBom = "2024.10.01" +androidxComposeBom = "2024.12.01" # https://developer.android.com/jetpack/androidx/releases/navigation androidxComposeNavigation = "2.8.4" -# https://developer.android.com/jetpack/androidx/releases/compose-material -androidxComposeMaterial = "1.7.4" -# https://developer.android.com/jetpack/androidx/releases/compose-material3 -androidxComposeMaterial3 = "1.3.0" ## Amplitude # https://amplitude.com/docs/sdks/analytics/android @@ -120,8 +116,8 @@ androidx-lifecycle-runtimeCompose = { group = "androidx.lifecycle", name = "life androidx-lifecycle-viewModelCompose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "androidxLifecycle" } androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "androidxActivity" } androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" } -androidx-compose-material = { group = "androidx.compose.material", name = "material", version.ref = "androidxComposeMaterial" } -androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "androidxComposeMaterial3" } +androidx-compose-material = { group = "androidx.compose.material", name = "material" } +androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" } androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" } androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } From 745551773448b97246be30f7ec710f7eba13f25b Mon Sep 17 00:00:00 2001 From: tgyuuAn Date: Mon, 30 Dec 2024 18:02:46 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[PC-185]=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=BD=94=EB=93=9C=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/puzzle/piece/ui/App.kt | 5 +---- .../src/main/java/com/puzzle/common/ui/InteractionSource.kt | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/puzzle/piece/ui/App.kt b/app/src/main/java/com/puzzle/piece/ui/App.kt index dcecd432..f08eab2a 100644 --- a/app/src/main/java/com/puzzle/piece/ui/App.kt +++ b/app/src/main/java/com/puzzle/piece/ui/App.kt @@ -3,7 +3,6 @@ package com.puzzle.piece.ui import androidx.compose.foundation.Image -import androidx.compose.foundation.background import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.navigationBarsPadding @@ -76,9 +75,7 @@ fun App( Image( painter = painterResource(R.drawable.ic_matching), contentDescription = null, - modifier = Modifier - .size(80.dp) - .background(PieceTheme.colors.white), + modifier = Modifier.size(80.dp), ) } } diff --git a/core/common-ui/src/main/java/com/puzzle/common/ui/InteractionSource.kt b/core/common-ui/src/main/java/com/puzzle/common/ui/InteractionSource.kt index 634660a4..6d276386 100644 --- a/core/common-ui/src/main/java/com/puzzle/common/ui/InteractionSource.kt +++ b/core/common-ui/src/main/java/com/puzzle/common/ui/InteractionSource.kt @@ -11,4 +11,4 @@ class NoRippleInteractionSource : MutableInteractionSource { override suspend fun emit(interaction: Interaction) {} override val interactions: Flow = emptyFlow() override fun tryEmit(interaction: Interaction): Boolean = true -} \ No newline at end of file +}