diff --git a/core/design-system/src/main/java/team/aliens/dms/android/core/designsystem/Shadows.kt b/core/design-system/src/main/java/team/aliens/dms/android/core/designsystem/Shadows.kt index 48ff45cf3..4f25bc481 100644 --- a/core/design-system/src/main/java/team/aliens/dms/android/core/designsystem/Shadows.kt +++ b/core/design-system/src/main/java/team/aliens/dms/android/core/designsystem/Shadows.kt @@ -10,7 +10,7 @@ import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp fun Modifier.shadow( - elevation: Dp = ShadowDefaults.SmallElevation, + elevation: Dp = ShadowDefaults.MediumElevation, shape: Shape = ShadowDefaults.RoundedShape, clip: Boolean = elevation > 0.dp, ambientColor: Color? = null, @@ -20,8 +20,10 @@ fun Modifier.shadow( elevation = elevation, shape = shape, clip = clip, - ambientColor = ambientColor ?: DmsTheme.colorScheme.surfaceVariant, - spotColor = spotColor ?: DmsTheme.colorScheme.surfaceVariant, + ambientColor = ambientColor + ?: DmsTheme.colorScheme.onSurfaceVariant.copy(alpha = ShadowDefaults.DefaultAlpha), + spotColor = spotColor + ?: DmsTheme.colorScheme.onSurfaceVariant.copy(alpha = ShadowDefaults.DefaultAlpha), ) } @@ -30,5 +32,7 @@ object ShadowDefaults { val MediumElevation = 4.dp val LargeElevation = 8.dp - val RoundedShape = RoundedCornerShape(8.dp) + const val DefaultAlpha = 0.6f + + val RoundedShape = RoundedCornerShape(12.dp) } diff --git a/core/ui/src/main/java/team/aliens/dms/android/core/ui/PaddingDefaults.kt b/core/ui/src/main/java/team/aliens/dms/android/core/ui/PaddingDefaults.kt index 727061865..e67241ff9 100644 --- a/core/ui/src/main/java/team/aliens/dms/android/core/ui/PaddingDefaults.kt +++ b/core/ui/src/main/java/team/aliens/dms/android/core/ui/PaddingDefaults.kt @@ -97,7 +97,7 @@ fun Modifier.bottomPadding( value: Dp = PaddingDefaults.Medium, ): Modifier = padding(bottom = value) -val DefaultVerticalSpace = PaddingDefaults.Small +val DefaultVerticalSpace = PaddingDefaults.Medium val LargeVerticalSpace = PaddingDefaults.Medium diff --git a/feature/src/main/java/team/aliens/dms/android/feature/main/announcement/AnnouncementListScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/main/announcement/AnnouncementListScreen.kt index e3734d334..c3d97aa95 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/main/announcement/AnnouncementListScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/main/announcement/AnnouncementListScreen.kt @@ -29,6 +29,7 @@ import team.aliens.dms.android.core.designsystem.DmsTopAppBar import team.aliens.dms.android.core.designsystem.OutlinedButton import team.aliens.dms.android.core.designsystem.ShadowDefaults import team.aliens.dms.android.core.designsystem.clickable +import team.aliens.dms.android.core.designsystem.shadow import team.aliens.dms.android.core.ui.DefaultVerticalSpace import team.aliens.dms.android.core.ui.PaddingDefaults import team.aliens.dms.android.core.ui.bottomPadding @@ -144,13 +145,13 @@ private fun NoticeCard( Card( modifier = modifier .horizontalPadding() - .verticalPadding(PaddingDefaults.ExtraSmall), + .verticalPadding(PaddingDefaults.ExtraSmall) + .shadow(), shape = DmsTheme.shapes.surfaceSmall, colors = CardDefaults.cardColors( containerColor = DmsTheme.colorScheme.surface, contentColor = DmsTheme.colorScheme.onSurface, ), - elevation = CardDefaults.outlinedCardElevation(defaultElevation = ShadowDefaults.SmallElevation), ) { Column( modifier = Modifier diff --git a/feature/src/main/java/team/aliens/dms/android/feature/main/application/ApplicationScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/main/application/ApplicationScreen.kt index 2b6b026d1..01e13dfbc 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/main/application/ApplicationScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/main/application/ApplicationScreen.kt @@ -31,6 +31,7 @@ import team.aliens.dms.android.core.designsystem.DmsTopAppBar import team.aliens.dms.android.core.designsystem.RoundedButton import team.aliens.dms.android.core.designsystem.Scaffold import team.aliens.dms.android.core.designsystem.ShadowDefaults +import team.aliens.dms.android.core.designsystem.shadow import team.aliens.dms.android.core.ui.DefaultVerticalSpace import team.aliens.dms.android.core.ui.PaddingDefaults import team.aliens.dms.android.core.ui.bottomPadding @@ -110,13 +111,13 @@ private fun ApplicationCard( modifier = modifier .animateContentSize() .horizontalPadding() - .verticalPadding(), + .verticalPadding() + .shadow(), shape = DmsTheme.shapes.surfaceSmall, - colors = CardDefaults.cardColors( + colors = CardDefaults.elevatedCardColors( containerColor = DmsTheme.colorScheme.surface, contentColor = DmsTheme.colorScheme.onSurface, ), - elevation = CardDefaults.outlinedCardElevation(defaultElevation = ShadowDefaults.SmallElevation), ) { Column( verticalArrangement = Arrangement.spacedBy(DefaultVerticalSpace), diff --git a/feature/src/main/java/team/aliens/dms/android/feature/main/home/HomeScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/main/home/HomeScreen.kt index d6005b7f0..f6ec86009 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/main/home/HomeScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/main/home/HomeScreen.kt @@ -67,16 +67,17 @@ import org.threeten.bp.DayOfWeek import org.threeten.bp.LocalDate import team.aliens.dms.android.core.designsystem.ButtonDefaults import team.aliens.dms.android.core.designsystem.DmsCalendar -import team.aliens.dms.android.core.designsystem.Scaffold import team.aliens.dms.android.core.designsystem.DmsTheme import team.aliens.dms.android.core.designsystem.DmsTopAppBar import team.aliens.dms.android.core.designsystem.LocalToast import team.aliens.dms.android.core.designsystem.ModalBottomSheet import team.aliens.dms.android.core.designsystem.OutlinedButton import team.aliens.dms.android.core.designsystem.PrimaryDefault +import team.aliens.dms.android.core.designsystem.Scaffold import team.aliens.dms.android.core.designsystem.ShadowDefaults import team.aliens.dms.android.core.designsystem.TextButton import team.aliens.dms.android.core.designsystem.clickable +import team.aliens.dms.android.core.designsystem.shadow import team.aliens.dms.android.core.ui.DefaultHorizontalSpace import team.aliens.dms.android.core.ui.DefaultVerticalSpace import team.aliens.dms.android.core.ui.PaddingDefaults @@ -546,7 +547,11 @@ private fun MealCard( } } } - }, + } + .shadow( + ambientColor = DmsTheme.colorScheme.primary.copy(alpha = ShadowDefaults.DefaultAlpha), + spotColor = DmsTheme.colorScheme.primary.copy(alpha = ShadowDefaults.DefaultAlpha), + ), shape = DmsTheme.shapes.surfaceLarge, colors = CardDefaults.outlinedCardColors( containerColor = DmsTheme.colorScheme.surface, @@ -556,7 +561,6 @@ private fun MealCard( width = 1.dp, color = DmsTheme.colorScheme.primary, ), - elevation = CardDefaults.outlinedCardElevation(defaultElevation = ShadowDefaults.SmallElevation), ) { val dishes = when (currentCardType) { BREAKFAST -> breakfast diff --git a/feature/src/main/java/team/aliens/dms/android/feature/main/mypage/MyPageScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/main/mypage/MyPageScreen.kt index 1dbbfd293..bc410a4a7 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/main/mypage/MyPageScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/main/mypage/MyPageScreen.kt @@ -36,14 +36,15 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.ramcosta.composedestinations.annotation.Destination import team.aliens.dms.android.core.designsystem.AlertDialog import team.aliens.dms.android.core.designsystem.ButtonDefaults -import team.aliens.dms.android.core.designsystem.Scaffold import team.aliens.dms.android.core.designsystem.DmsTheme import team.aliens.dms.android.core.designsystem.DmsTopAppBar import team.aliens.dms.android.core.designsystem.Gray10 import team.aliens.dms.android.core.designsystem.RoundedButton +import team.aliens.dms.android.core.designsystem.Scaffold import team.aliens.dms.android.core.designsystem.ShadowDefaults import team.aliens.dms.android.core.designsystem.TextButton import team.aliens.dms.android.core.designsystem.clickable +import team.aliens.dms.android.core.designsystem.shadow import team.aliens.dms.android.core.ui.DefaultHorizontalSpace import team.aliens.dms.android.core.ui.LargeVerticalSpace import team.aliens.dms.android.core.ui.PaddingDefaults @@ -385,7 +386,8 @@ private fun PointCard( @Immutable private enum class PointCardType { - BONUS, MINUS, ; + BONUS, MINUS, + ; val containerColor: Color @Composable inline get() = when (this) { @@ -493,13 +495,14 @@ private fun OptionLayout( titleColor: Color, ) { Card( - modifier = modifier.horizontalPadding(), + modifier = modifier + .horizontalPadding() + .shadow(), shape = DmsTheme.shapes.surfaceSmall, colors = CardDefaults.cardColors( containerColor = DmsTheme.colorScheme.surface, contentColor = titleColor, ), - elevation = CardDefaults.outlinedCardElevation(defaultElevation = ShadowDefaults.SmallElevation), ) { options.forEachIndexed { index, option -> Text( diff --git a/feature/src/main/java/team/aliens/dms/android/feature/outing/OutingStatusScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/outing/OutingStatusScreen.kt index e095675a6..50e4c78c1 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/outing/OutingStatusScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/outing/OutingStatusScreen.kt @@ -38,8 +38,8 @@ import team.aliens.dms.android.core.designsystem.DmsTheme import team.aliens.dms.android.core.designsystem.DmsTopAppBar import team.aliens.dms.android.core.designsystem.LocalToast import team.aliens.dms.android.core.designsystem.Scaffold -import team.aliens.dms.android.core.designsystem.ShadowDefaults import team.aliens.dms.android.core.designsystem.TextButton +import team.aliens.dms.android.core.designsystem.shadow import team.aliens.dms.android.core.ui.DefaultHorizontalSpace import team.aliens.dms.android.core.ui.DefaultVerticalSpace import team.aliens.dms.android.core.ui.PaddingDefaults @@ -176,13 +176,13 @@ private fun OutingInformationCard( Card( modifier = modifier .horizontalPadding() - .verticalPadding(PaddingDefaults.ExtraSmall), + .verticalPadding(PaddingDefaults.ExtraSmall) + .shadow(), shape = DmsTheme.shapes.surfaceMedium, colors = CardDefaults.cardColors( containerColor = DmsTheme.colorScheme.surface, contentColor = DmsTheme.colorScheme.onSurface, ), - elevation = CardDefaults.outlinedCardElevation(defaultElevation = ShadowDefaults.SmallElevation), ) { Column( modifier = Modifier.fillMaxWidth(), diff --git a/feature/src/main/java/team/aliens/dms/android/feature/point/PointHistoryScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/point/PointHistoryScreen.kt index 379861b04..a5e8d6912 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/point/PointHistoryScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/point/PointHistoryScreen.kt @@ -28,8 +28,8 @@ import team.aliens.dms.android.core.designsystem.DmsTheme import team.aliens.dms.android.core.designsystem.DmsTopAppBar import team.aliens.dms.android.core.designsystem.OutlinedButton import team.aliens.dms.android.core.designsystem.Scaffold -import team.aliens.dms.android.core.designsystem.ShadowDefaults import team.aliens.dms.android.core.designsystem.VerticallyFadedLazyColumn +import team.aliens.dms.android.core.designsystem.shadow import team.aliens.dms.android.core.ui.DefaultHorizontalSpace import team.aliens.dms.android.core.ui.DefaultVerticalSpace import team.aliens.dms.android.core.ui.PaddingDefaults @@ -174,13 +174,13 @@ private fun PointCard( Card( modifier = modifier .horizontalPadding() - .verticalPadding(PaddingDefaults.ExtraSmall), + .verticalPadding(PaddingDefaults.ExtraSmall) + .shadow(), shape = DmsTheme.shapes.surfaceSmall, colors = CardDefaults.cardColors( containerColor = DmsTheme.colorScheme.surface, contentColor = DmsTheme.colorScheme.onSurface, ), - elevation = CardDefaults.outlinedCardElevation(defaultElevation = ShadowDefaults.SmallElevation), ) { Column( verticalArrangement = Arrangement.spacedBy(DefaultVerticalSpace), diff --git a/feature/src/main/java/team/aliens/dms/android/feature/remains/RemainsApplicationScreen.kt b/feature/src/main/java/team/aliens/dms/android/feature/remains/RemainsApplicationScreen.kt index 60d324c3a..e5fa5ede6 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/remains/RemainsApplicationScreen.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/remains/RemainsApplicationScreen.kt @@ -42,6 +42,7 @@ import team.aliens.dms.android.core.designsystem.RoundedButton import team.aliens.dms.android.core.designsystem.ShadowDefaults import team.aliens.dms.android.core.designsystem.clickable import team.aliens.dms.android.core.designsystem.VerticallyFadedLazyColumn +import team.aliens.dms.android.core.designsystem.shadow import team.aliens.dms.android.core.ui.DefaultHorizontalSpace import team.aliens.dms.android.core.ui.PaddingDefaults import team.aliens.dms.android.core.ui.bottomPadding @@ -196,20 +197,13 @@ private fun RemainsOptionCard( Card( modifier = modifier .horizontalPadding() - .verticalPadding(PaddingDefaults.ExtraSmall), + .verticalPadding(PaddingDefaults.ExtraSmall) + .shadow(), shape = DmsTheme.shapes.surfaceSmall, colors = CardDefaults.cardColors( containerColor = DmsTheme.colorScheme.surface, contentColor = DmsTheme.colorScheme.onSurface, ), - elevation = CardDefaults.outlinedCardElevation( - defaultElevation = - if (selected) { - ShadowDefaults.MediumElevation - } else { - ShadowDefaults.SmallElevation - }, - ), border = if (selected) { BorderStroke( width = 1.dp, diff --git a/feature/src/main/java/team/aliens/dms/android/feature/studyroom/Common.kt b/feature/src/main/java/team/aliens/dms/android/feature/studyroom/Common.kt index 96a8ca147..65f3c5c3d 100644 --- a/feature/src/main/java/team/aliens/dms/android/feature/studyroom/Common.kt +++ b/feature/src/main/java/team/aliens/dms/android/feature/studyroom/Common.kt @@ -14,6 +14,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import team.aliens.dms.android.core.designsystem.DmsTheme import team.aliens.dms.android.core.designsystem.ShadowDefaults +import team.aliens.dms.android.core.designsystem.shadow import team.aliens.dms.android.core.ui.DefaultHorizontalSpace import team.aliens.dms.android.core.ui.PaddingDefaults import team.aliens.dms.android.core.ui.endPadding @@ -26,7 +27,6 @@ import team.aliens.dms.android.feature.R import team.aliens.dms.android.shared.model.Sex -@OptIn(ExperimentalMaterial3Api::class) @Composable fun StudyRoomCard( modifier: Modifier = Modifier, @@ -36,13 +36,13 @@ fun StudyRoomCard( Card( modifier = modifier .horizontalPadding() - .verticalPadding(PaddingDefaults.ExtraSmall), + .verticalPadding(PaddingDefaults.ExtraSmall) + .shadow(), shape = DmsTheme.shapes.surfaceSmall, colors = CardDefaults.cardColors( containerColor = DmsTheme.colorScheme.surface, contentColor = DmsTheme.colorScheme.onSurface, ), - elevation = CardDefaults.outlinedCardElevation(defaultElevation = ShadowDefaults.SmallElevation), onClick = onClick, ) { Column {