Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,44 +26,60 @@ private fun PreviewPawkeyButton() {
Column (
verticalArrangement = Arrangement.spacedBy(12.dp),
){
// 초록색 버튼
// 기본 초록색 버튼 (활성화)
PawkeyButton(
text = "신규 계정으로 회원가입",
enabled = true,
onClick = {}
)

// 회색 버튼
// 기본 회색 버튼 (비활성화)
PawkeyButton(
text = "신규 계정으로 회원가입",
enabled = false,
onClick = {}
)

// 활성화 - 빈 상자
// 활성화 - 흰 배경, 초록 테두리
PawkeyButton(
text = "신규 계정으로 회원가입",
enabled = true,
onClick = {},
isBorder = false,
isBackGround = true
)

// 비활성화 - 빈 상자
// 비활성화 - 흰 배경, 회색 테두리
PawkeyButton(
text = "신규 계정으로 회원가입",
enabled = false,
onClick = {},
isBackGround = true
)

// 투명 border
// 활성화 - 흰 배경, 테두리 없음
PawkeyButton(
text = "신규 계정으로 회원가입",
enabled = true,
onClick = {},
isBorder = true,
isBackGround = true
isBackGround = true,
isBorder = false
)

// 비활성화 - 흰 배경, 테두리 없음
PawkeyButton(
text = "신규 계정으로 회원가입",
enabled = false,
onClick = {},
isBackGround = true,
isBorder = false
)

// 초록색 버튼 - 테두리 없음
PawkeyButton(
text = "신규 계정으로 회원가입",
enabled = true,
onClick = {},
isBorder = false
)
}
}
Expand All @@ -76,34 +92,48 @@ fun PawkeyButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
isBackGround: Boolean = false,
isBorder: Boolean = false
isBorder: Boolean = true
) {

val actualEnabled = if (!isBackGround) {
enabled
} else {
enabled
}

val backgroundColor = when {
enabled && !isBackGround -> PawKeyTheme.colors.green500
enabled && isBackGround -> PawKeyTheme.colors.white1
!enabled && isBackGround -> PawKeyTheme.colors.white1
actualEnabled && !isBackGround -> PawKeyTheme.colors.green500
actualEnabled && isBackGround -> PawKeyTheme.colors.white1
!actualEnabled && isBackGround -> PawKeyTheme.colors.white1
else -> PawKeyTheme.colors.gray200
}

val contentColor = when {
enabled && !isBackGround -> PawKeyTheme.colors.white1
enabled && isBackGround -> PawKeyTheme.colors.green500
!enabled && isBackGround -> PawKeyTheme.colors.gray100
actualEnabled && !isBackGround -> PawKeyTheme.colors.white1
actualEnabled && isBackGround -> PawKeyTheme.colors.green500
!actualEnabled && isBackGround -> PawKeyTheme.colors.gray100
else -> PawKeyTheme.colors.white1
}

val borderColor = when {
enabled && isBackGround -> PawKeyTheme.colors.green500
!enabled && isBackGround -> PawKeyTheme.colors.gray200
!isBorder -> Color.Transparent
actualEnabled && isBackGround -> PawKeyTheme.colors.green500
!actualEnabled && isBackGround -> PawKeyTheme.colors.gray200
else -> Color.Transparent
}

Box(
modifier = modifier
.fillMaxWidth()
.background(backgroundColor, shape = RoundedCornerShape(8.dp))
.then(if (isBorder || isBackGround) Modifier.border(1.dp, borderColor, RoundedCornerShape(8.dp)) else Modifier)
.noRippleClickable{ onClick() }
.border(
width = 1.dp,
color = borderColor,
shape = RoundedCornerShape(8.dp)
)
.noRippleClickable {
if (actualEnabled) onClick()
}
.padding(vertical = 14.dp),
contentAlignment = Alignment.Center
) {
Expand All @@ -113,5 +143,4 @@ fun PawkeyButton(
color = contentColor
)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,8 @@ fun HomeScreen(
date = "년도/월/일",
onCLickItem = {}
)
Spacer(modifier = Modifier.height(48.dp))
}
item{}
item{}


}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ fun DaytimeCard(
)
}
Icon(
imageVector = ImageVector.vectorResource(R.drawable.img_home_sunset),
imageVector = ImageVector.vectorResource(R.drawable.img_home_sunrise),
contentDescription = "daytime",
tint = Color.Unspecified,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ fun RowCalendar(
Text(
text = date,
color = PawKeyTheme.colors.black,
style = PawKeyTheme.typography.head18Sb
style = PawKeyTheme.typography.head18Sb,
modifier = Modifier
.padding(bottom = 28.dp)
)

LazyRow(
Expand All @@ -82,13 +84,16 @@ fun RowCalendar(
val dates = listOf("14", "15", "16", "17", "18", "19", "20")
val days = listOf("월", "화", "수", "목", "금", "토", "일")
val hasActivity = listOf(true, true, false, true, false, false, false)
val selectedIndex = 3
val todayIndex = 6

CalendarItem(
date = dates[index],
day = days[index],
state = hasActivity[index],
isSelected = index == 3, // 17일이 선택됨
isToday = index == 6 // 20일이 오늘
isSelected = index == selectedIndex,
isToday = index == todayIndex,
isAfterSelected = index > selectedIndex && index < todayIndex
)
}
}
Expand All @@ -104,6 +109,7 @@ private fun CalendarItem(
state: Boolean = false,
isSelected: Boolean = false,
isToday: Boolean = false,
isAfterSelected: Boolean = false,
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
Expand Down Expand Up @@ -133,6 +139,7 @@ private fun CalendarItem(
color = when {
isSelected -> PawKeyTheme.colors.white1
isToday -> Color.Red
isAfterSelected -> PawKeyTheme.colors.black
else -> PawKeyTheme.colors.gray900.copy(alpha = 0.6f)
},
style = PawKeyTheme.typography.body14R,
Expand All @@ -143,6 +150,7 @@ private fun CalendarItem(
color = when {
isSelected -> PawKeyTheme.colors.white1
isToday -> Color.Red
isAfterSelected -> PawKeyTheme.colors.black
else -> PawKeyTheme.colors.gray900.copy(alpha = 0.6f)
},
style = PawKeyTheme.typography.body14R,
Expand Down
25 changes: 22 additions & 3 deletions app/src/main/java/com/paw/key/presentation/ui/login/LoginScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand Down Expand Up @@ -77,7 +78,7 @@ fun LoginScreen(
modifier = modifier
.fillMaxSize()
.background(PawKeyTheme.colors.white1)
.padding(horizontal = 16.dp),
.padding(horizontal = 16.dp, vertical = 60.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Expand Down Expand Up @@ -122,7 +123,7 @@ fun LoginScreen(
suffix = {
Icon(
imageVector = ImageVector.vectorResource(
if (!isPasswordVisible) R.drawable.ic_eye_linear_valid else R.drawable.ic_eye_linear_invalid
if (!isPasswordVisible) R.drawable.ic_eye_linear_gray_valid else R.drawable.ic_eye_linear_invalid
),
contentDescription = null,
modifier = Modifier.noRippleClickable(onClickIcon),
Expand Down Expand Up @@ -153,7 +154,25 @@ fun LoginScreen(
.fillMaxWidth()
.navigationBarsPadding()
)
}
}

Spacer(modifier = Modifier.height(60.dp))
@Preview(showBackground = true)
@Composable
private fun PreviewLoginScreen(){
PawKeyTheme{
LoginScreen(
paddingValues = PaddingValues(),
navigateUp = {},
navigateNext = {},
onEmailChanged = {},
onPasswordChanged = {},
onClickIcon = {},
snackBarHostState = SnackbarHostState(),
email = "",
password = "",
isPasswordVisible = false,
isLoginFormValid = true,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.withStyle
import androidx.compose.ui.text.buildAnnotatedString
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.paw.key.core.designsystem.component.PawkeyButton
Expand Down Expand Up @@ -70,12 +74,17 @@ fun OnboardingScreen(
Column(
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 16.dp, vertical = 48.dp)
.padding(horizontal = 16.dp, vertical = 60.dp)
) {
Spacer(modifier = Modifier.height(36.dp))

Text(
text = "안녕하세요\n우리 강아지를 위한 산책,\n${"PAWKEY"}와 함께해요! ",
text = buildAnnotatedString {
append("안녕하세요\n우리 강아지를 위한 산책,\n")
withStyle(style = SpanStyle(color = PawKeyTheme.colors.green500)) {
append("PAWKEY")
}
append("와 함께해요! ")
},
color = PawKeyTheme.colors.black,
style = PawKeyTheme.typography.head22B
)
Expand All @@ -95,6 +104,7 @@ fun OnboardingScreen(
text = "기존 계정으로 로그인",
enabled = true,
isBackGround = true,
isBorder = false,
onClick = { navigateSignUp() },
)
}
Expand Down
Loading