Skip to content

Commit

Permalink
[Feature] Schedule QA (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajou4095 authored Feb 20, 2024
1 parent d80d979 commit 2799a6d
Show file tree
Hide file tree
Showing 14 changed files with 119 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ac.dnd.mour.android.presentation.common.theme.Body1
import ac.dnd.mour.android.presentation.common.theme.Caption2
import ac.dnd.mour.android.presentation.common.theme.Gray000
import ac.dnd.mour.android.presentation.common.theme.Gray300
import ac.dnd.mour.android.presentation.common.theme.Gray400
import ac.dnd.mour.android.presentation.common.theme.Gray500
import ac.dnd.mour.android.presentation.common.theme.Gray700
import ac.dnd.mour.android.presentation.common.theme.Gray800
import ac.dnd.mour.android.presentation.common.theme.Headline2
Expand All @@ -22,7 +22,6 @@ import androidx.compose.material.ButtonDefaults
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand All @@ -32,7 +31,6 @@ fun ConfirmButton(
modifier: Modifier = Modifier,
properties: ConfirmButtonProperties,
isEnabled: Boolean = true,
enableBackgroundColor: Color = Gray400,
onClick: () -> Unit = {},
content: @Composable RowScope.(TextStyle) -> Unit
) {
Expand All @@ -44,7 +42,7 @@ fun ConfirmButton(
}

val backgroundColor = when (properties.type) {
ConfirmButtonType.Primary -> if (isEnabled) Primary4 else enableBackgroundColor
ConfirmButtonType.Primary -> if (isEnabled) Primary4 else Gray500
ConfirmButtonType.Secondary -> Gray300
ConfirmButtonType.Tertiary -> Primary1
ConfirmButtonType.Outline -> Gray000
Expand All @@ -61,7 +59,7 @@ fun ConfirmButton(
ConfirmButtonType.Primary -> null
ConfirmButtonType.Secondary -> null
ConfirmButtonType.Tertiary -> null
ConfirmButtonType.Outline -> BorderStroke(1.dp, Gray800)
ConfirmButtonType.Outline -> BorderStroke(1.dp, Gray500)
}

val height = when (properties.size) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.focus.onFocusChanged
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
Expand Down Expand Up @@ -181,13 +180,9 @@ fun TypingTextField(
)
}
}
if (textType == TypingTextFieldType.Basic) {
if (textType == TypingTextFieldType.Basic && isError) {
Spacer(Modifier.height(Space8))
Box(
modifier = Modifier.alpha(if (isError) 1f else 0f)
) {
errorMessageContent()
}
errorMessageContent()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package ac.dnd.mour.android.presentation.ui.main

import ac.dnd.mour.android.presentation.common.theme.Gray000
import ac.dnd.mour.android.presentation.common.util.parseRoute
import ac.dnd.mour.android.presentation.ui.main.home.HomeConstant
import ac.dnd.mour.android.presentation.ui.main.home.schedule.add.ScheduleAddConstant
import androidx.compose.material.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.navigation.compose.currentBackStackEntryAsState
Expand All @@ -15,7 +19,13 @@ fun ManageSystemUiState(
}.orEmpty()

when (route) {
HomeConstant.ROUTE,
ScheduleAddConstant.ROUTE -> {
appState.systemUiController.setSystemBarsColor(Gray000)
}

else -> {
appState.systemUiController.setSystemBarsColor(MaterialTheme.colors.background)
appState.systemUiController.isStatusBarVisible = true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ fun HistoryRegistrationScreen(
type = ConfirmButtonType.Primary
),
isEnabled = isRegistrable,
enableBackgroundColor = Primary4,
onClick = {
register(continuousState = false)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ private fun ScheduleScreen(
.padding(horizontal = 20.dp)
) {
Text(
text = "통계",
text = "일정",
style = Headline1,
modifier = Modifier.align(Alignment.Center)
)
Expand Down Expand Up @@ -245,7 +245,7 @@ private fun ScheduleScreen(
) { style ->
Text(
text = "일정 등록하기",
style = style
style = style.merge(Gray600)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import ac.dnd.mour.android.domain.model.feature.schedule.Schedule
import ac.dnd.mour.android.presentation.R
import ac.dnd.mour.android.presentation.common.theme.Body1
import ac.dnd.mour.android.presentation.common.theme.Gray000
import ac.dnd.mour.android.presentation.common.theme.Gray400
import ac.dnd.mour.android.presentation.common.theme.Gray600
import ac.dnd.mour.android.presentation.common.theme.Gray700
import ac.dnd.mour.android.presentation.common.theme.Gray800
import ac.dnd.mour.android.presentation.common.theme.Gray900
import ac.dnd.mour.android.presentation.common.theme.Headline1
import ac.dnd.mour.android.presentation.common.theme.Primary4
import ac.dnd.mour.android.presentation.common.theme.Shapes
Expand Down Expand Up @@ -49,12 +52,15 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.datetime.Clock
import kotlinx.datetime.DateTimeUnit
import kotlinx.datetime.LocalDate
import kotlinx.datetime.LocalDateTime
import kotlinx.datetime.TimeZone
import kotlinx.datetime.minus
import kotlinx.datetime.number
import kotlinx.datetime.plus
import kotlinx.datetime.todayIn

@Composable
fun ScheduleScreenHeader(
Expand Down Expand Up @@ -97,12 +103,13 @@ fun ScheduleScreenHeader(
) {
Text(
text = formattedDate,
style = Headline1
style = Headline1.merge(Gray900)
)
Icon(
modifier = Modifier.size(20.dp),
painter = painterResource(R.drawable.ic_drop_down),
contentDescription = null
contentDescription = null,
tint = Gray900
)
}
Spacer(modifier = Modifier.height(20.dp))
Expand Down Expand Up @@ -149,7 +156,8 @@ fun ScheduleScreenHeader(
} else {
painterResource(R.drawable.ic_chevron_down)
},
contentDescription = null
contentDescription = null,
tint = Gray600
)
}
}
Expand Down Expand Up @@ -259,17 +267,19 @@ private fun ScheduleScreenHeaderCalendarItem(
isExpanded: Boolean,
onClickDay: (LocalDate) -> Unit
) {
val now = Clock.System.todayIn(TimeZone.currentSystemDefault())
val isSelected = item == selectedDate
val isToday = item == now

Column(
modifier = modifier,
horizontalAlignment = Alignment.CenterHorizontally
) {
val boxModifier = if (isSelected) {
val boxModifier = if (isSelected || isToday) {
Modifier
.size(28.dp)
.clip(CircleShape)
.background(Primary4)
.background(if (isSelected) Primary4 else Gray400)
} else {
Modifier.size(28.dp)
}
Expand All @@ -286,7 +296,7 @@ private fun ScheduleScreenHeaderCalendarItem(
Text(
text = item.dayOfMonth.toString(),
style = Body1.merge(
color = if (isSelected) Gray000 else Gray600,
color = if (isSelected) Gray000 else if (isToday) Gray700 else Gray800,
fontWeight = FontWeight.SemiBold
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ 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.text.font.FontWeight
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
Expand Down Expand Up @@ -153,7 +154,10 @@ fun ScheduleScreenItem(
) {
Text(
text = schedule.event,
style = Body1.merge(Gray000)
style = Body1.merge(
color = Gray000,
fontWeight = FontWeight.SemiBold
)
)
}
}
Expand Down Expand Up @@ -218,7 +222,6 @@ fun ScheduleScreenItemDescription(
@DrawableRes iconRes: Int,
text: String
) {
Spacer(modifier = Modifier.height(6.dp))
Row(
modifier = Modifier
.padding(horizontal = 16.dp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
Expand Down Expand Up @@ -298,7 +299,10 @@ fun ScheduleAddScreen(
Row {
Text(
text = "이름",
style = Body1
style = Body1.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
)
Spacer(modifier = Modifier.width(6.dp))
Text(
Expand Down Expand Up @@ -363,7 +367,10 @@ fun ScheduleAddScreen(
) {
Text(
text = "날짜",
style = Body1
style = Body1.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
)
Spacer(modifier = Modifier.width(6.dp))
Text(
Expand All @@ -385,7 +392,10 @@ fun ScheduleAddScreen(
) {
Text(
text = "경사 종류",
style = Body1
style = Body1.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
)
Spacer(modifier = Modifier.width(6.dp))
Text(
Expand Down Expand Up @@ -449,7 +459,10 @@ fun ScheduleAddScreen(
Spacer(modifier = Modifier.width(4.dp))
Text(
text = "미리 알림",
style = Body1
style = Body1.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
)
}
Spacer(modifier = Modifier.height(6.dp))
Expand All @@ -473,7 +486,10 @@ fun ScheduleAddScreen(
Spacer(modifier = Modifier.width(4.dp))
Text(
text = "시간",
style = Body1
style = Body1.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
)
}
FieldSelectComponent(
Expand All @@ -496,7 +512,10 @@ fun ScheduleAddScreen(
Spacer(modifier = Modifier.width(4.dp))
Text(
text = "위치",
style = Body1
style = Body1.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
)
}
Spacer(modifier = Modifier.height(6.dp))
Expand Down Expand Up @@ -525,7 +544,10 @@ fun ScheduleAddScreen(
Spacer(modifier = Modifier.width(4.dp))
Text(
text = "초대장 링크",
style = Body1
style = Body1.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
)
}
Spacer(modifier = Modifier.height(6.dp))
Expand Down Expand Up @@ -554,7 +576,10 @@ fun ScheduleAddScreen(
Spacer(modifier = Modifier.width(4.dp))
Text(
text = "메모",
style = Body1
style = Body1.merge(
color = Gray800,
fontWeight = FontWeight.SemiBold
)
)
}
Spacer(modifier = Modifier.height(6.dp))
Expand Down
12 changes: 8 additions & 4 deletions presentation/src/main/res/drawable/ic_chevron_down.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M480,615 L240,375l56,-56 184,184 184,-184 56,56 -240,240Z" />
android:fillColor="#00000000"
android:pathData="M6,9L12,15L18,9"
android:strokeWidth="1.5"
android:strokeColor="#101219"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>
6 changes: 3 additions & 3 deletions presentation/src/main/res/drawable/ic_chevron_left.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="25dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="25">
android:viewportHeight="24">
<path
android:fillColor="#00000000"
android:pathData="M15,18.779L9,12.779L15,6.779"
android:pathData="M15,18L9,12L15,6"
android:strokeWidth="1.5"
android:strokeColor="#101219"
android:strokeLineCap="round"
Expand Down
12 changes: 8 additions & 4 deletions presentation/src/main/res/drawable/ic_chevron_right.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="960"
android:viewportHeight="960">
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF000000"
android:pathData="M504,480 L320,296l56,-56 240,240 -240,240 -56,-56 184,-184Z" />
android:fillColor="#00000000"
android:pathData="M9,18L15,12L9,6"
android:strokeWidth="1.5"
android:strokeColor="#101219"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
</vector>
Loading

0 comments on commit 2799a6d

Please sign in to comment.