diff --git a/compose/src/main/java/com/yourssu/design/system/compose/base/YdsScaffold.kt b/compose/src/main/java/com/yourssu/design/system/compose/base/YdsScaffold.kt index c6078842..92963aef 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/base/YdsScaffold.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/base/YdsScaffold.kt @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.size import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -21,7 +20,7 @@ import com.yourssu.design.system.compose.R import com.yourssu.design.system.compose.YdsTheme import com.yourssu.design.system.compose.atom.BoxButton import com.yourssu.design.system.compose.atom.TopBarButton -import com.yourssu.design.system.compose.component.TopBar +import com.yourssu.design.system.compose.component.topbar.TopBar import com.yourssu.design.system.compose.component.toast.ToastDuration import com.yourssu.design.system.compose.component.toast.ToastHost import com.yourssu.design.system.compose.component.toast.ToastHostState diff --git a/compose/src/main/java/com/yourssu/design/system/compose/component/BottomBar.kt b/compose/src/main/java/com/yourssu/design/system/compose/component/BottomBar.kt index f4bdb0a6..28a93b50 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/component/BottomBar.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/component/BottomBar.kt @@ -48,6 +48,7 @@ import com.yourssu.design.system.compose.base.IconSize import com.yourssu.design.system.compose.base.Surface import com.yourssu.design.system.compose.base.YdsScaffold import com.yourssu.design.system.compose.base.YdsText +import com.yourssu.design.system.compose.component.topbar.TopBar import com.yourssu.design.system.compose.rule.YdsInAndOutEasing /** diff --git a/compose/src/main/java/com/yourssu/design/system/compose/component/DoubleTitleTopBar.kt b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/DoubleTitleTopBar.kt similarity index 93% rename from compose/src/main/java/com/yourssu/design/system/compose/component/DoubleTitleTopBar.kt rename to compose/src/main/java/com/yourssu/design/system/compose/component/topbar/DoubleTitleTopBar.kt index 10466f2d..ddca7747 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/component/DoubleTitleTopBar.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/DoubleTitleTopBar.kt @@ -1,4 +1,4 @@ -package com.yourssu.design.system.compose.component +package com.yourssu.design.system.compose.component.topbar import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.RowScope import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.material.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -31,9 +30,6 @@ fun DoubleTitleTopBar( modifier = modifier .fillMaxWidth() .height(72.dp), - backgroundColor = YdsTheme.colors.bgElevated, - contentColor = YdsTheme.colors.textPrimary, - elevation = 0.dp, contentPadding = PaddingValues(end = 4.dp) ) { Box( diff --git a/compose/src/main/java/com/yourssu/design/system/compose/component/SearchTopBar.kt b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/SearchTopBar.kt similarity index 94% rename from compose/src/main/java/com/yourssu/design/system/compose/component/SearchTopBar.kt rename to compose/src/main/java/com/yourssu/design/system/compose/component/topbar/SearchTopBar.kt index aa9cd1a7..e5369b69 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/component/SearchTopBar.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/SearchTopBar.kt @@ -1,4 +1,4 @@ -package com.yourssu.design.system.compose.component +package com.yourssu.design.system.compose.component.topbar import android.widget.Toast import androidx.compose.foundation.interaction.MutableInteractionSource @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.material.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -42,9 +41,6 @@ fun SearchTopBar( modifier = modifier .fillMaxWidth() .height(56.dp), - backgroundColor = YdsTheme.colors.bgElevated, - contentColor = YdsTheme.colors.textPrimary, - elevation = 0.dp, contentPadding = PaddingValues(start = 4.dp), ) { Box( diff --git a/compose/src/main/java/com/yourssu/design/system/compose/component/SingleTitleTopBar.kt b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/SingleTitleTopBar.kt similarity index 92% rename from compose/src/main/java/com/yourssu/design/system/compose/component/SingleTitleTopBar.kt rename to compose/src/main/java/com/yourssu/design/system/compose/component/topbar/SingleTitleTopBar.kt index 43957579..1bb92e2f 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/component/SingleTitleTopBar.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/SingleTitleTopBar.kt @@ -1,4 +1,4 @@ -package com.yourssu.design.system.compose.component +package com.yourssu.design.system.compose.component.topbar import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues @@ -9,7 +9,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.material.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -31,9 +30,6 @@ fun SingleTitleTopBar( modifier = modifier .fillMaxWidth() .height(56.dp), - backgroundColor = YdsTheme.colors.bgElevated, - contentColor = YdsTheme.colors.textPrimary, - elevation = 0.dp, contentPadding = PaddingValues(end = 4.dp) ) { Box( diff --git a/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/TopAppBar.kt b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/TopAppBar.kt new file mode 100644 index 00000000..9f83b801 --- /dev/null +++ b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/TopAppBar.kt @@ -0,0 +1,65 @@ +package com.yourssu.design.system.compose.component.topbar + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.PaddingValues +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.RowScope +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.RectangleShape +import androidx.compose.ui.graphics.Shape +import androidx.compose.ui.unit.dp +import com.yourssu.design.system.compose.YdsTheme +import com.yourssu.design.system.compose.base.Surface + +@Composable +internal fun TopAppBar( + modifier: Modifier = Modifier, + backgroundColor: Color = YdsTheme.colors.bgElevated, + contentColor: Color = YdsTheme.colors.textPrimary, + contentPadding: PaddingValues, + content: @Composable RowScope.() -> Unit, +) { + AppBar( + backgroundColor, + contentColor, + contentPadding, + RectangleShape, + modifier = modifier, + content = content, + ) +} + +@Composable +private fun AppBar( + backgroundColor: Color, + contentColor: Color, + contentPadding: PaddingValues, + shape: Shape, + modifier: Modifier = Modifier, + content: @Composable RowScope.() -> Unit, +) { + Surface( + color = backgroundColor, + contentColor = contentColor, + shape = shape, + modifier = modifier, + ) { + Row( + Modifier + .fillMaxWidth() + .padding(contentPadding) + .height(AppBarHeight), + horizontalArrangement = Arrangement.Start, + verticalAlignment = Alignment.CenterVertically, + content = content, + ) + } +} + +private val AppBarHeight = 56.dp diff --git a/compose/src/main/java/com/yourssu/design/system/compose/component/TopBar.kt b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/TopBar.kt similarity index 93% rename from compose/src/main/java/com/yourssu/design/system/compose/component/TopBar.kt rename to compose/src/main/java/com/yourssu/design/system/compose/component/topbar/TopBar.kt index 0ba4953c..6ae82c6d 100644 --- a/compose/src/main/java/com/yourssu/design/system/compose/component/TopBar.kt +++ b/compose/src/main/java/com/yourssu/design/system/compose/component/topbar/TopBar.kt @@ -1,4 +1,4 @@ -package com.yourssu.design.system.compose.component +package com.yourssu.design.system.compose.component.topbar import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.PaddingValues @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding -import androidx.compose.material.TopAppBar import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -31,9 +30,6 @@ fun TopBar( modifier = modifier .fillMaxWidth() .height(56.dp), - backgroundColor = YdsTheme.colors.bgElevated, - contentColor = YdsTheme.colors.textPrimary, - elevation = 0.dp, contentPadding = PaddingValues(horizontal = 4.dp) ) { Box( diff --git a/version.properties b/version.properties index 2074e8c6..32dafcc4 100644 --- a/version.properties +++ b/version.properties @@ -1,2 +1,2 @@ -versionName=2.5.0 +versionName=2.5.1 #자동 배포를 위해서 버전은 여기 한 군데에서 관리하면 된다