Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] #8 회원가입, 로그인 프로세스 화면 구현 #18

Merged
merged 40 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a38df65
[UI] #10 text 간격 조절
l5x5l Jul 7, 2024
edb20f0
[UI] #10 icon만 존재하는 PokitButton의 좌우 패딩값이 상하 패딩값과 동일해지도록 수정
l5x5l Jul 7, 2024
1ca33c9
[UI] #10 컴포넌트 이름 변경 CategoryCard -> PokitList
l5x5l Jul 7, 2024
2d8c3f8
[FEATURE] #10 PokitCard 컴포넌트 구현
l5x5l Jul 7, 2024
6a8c139
[UI] #10 LinkCard 컴포넌트에서 즐겨찾기 제거 및 안읽음 표시 UI 수정
l5x5l Jul 7, 2024
e16bb54
[UI] #10 LabeledInput에서 글자수 표시 부분을 선택 가능하도록 수정
l5x5l Jul 7, 2024
7adf5cc
[UI] #10 PokitButton Large 사이즈의 높이 조정
l5x5l Jul 7, 2024
6af1a87
[UI] #10 typography의 글자 크기를 sp에서 dp로 수정
l5x5l Jul 7, 2024
5fa267b
[UI] #10 PokitBottomSheet가 시스템 navigation bar영역에 겹쳐보이는 문제 수정
l5x5l Jul 7, 2024
d71a7a9
[UI] #10 ktlintFormat 적용
l5x5l Jul 7, 2024
ed571d7
[UI] #10 PokitInput Default, Input 상태일 시 디자인 수정 및 Round Shape일 때 높이 수정
l5x5l Jul 7, 2024
a263df1
[UI] #10 PushCard 컴포넌트 구현
l5x5l Jul 7, 2024
5e0f3ab
[chore] core:ui 모듈 추가
jiwon2724 Jul 8, 2024
6dc0cdc
[ui] 로그인 화면 UI 구현
jiwon2724 Jul 8, 2024
81691b5
[chore] ci 코드 컨벤션 반영
jiwon2724 Jul 8, 2024
9302a44
[chore] 로그인 프로세스 string resouce 추가
jiwon2724 Jul 13, 2024
282e2a4
[ui] 디자인 시스템 수정
jiwon2724 Jul 13, 2024
5e5ebcd
[chore] string resource 추가
jiwon2724 Jul 13, 2024
660a2bc
[chore] 디자인 시스템 반영 및 리소스 적용
jiwon2724 Jul 13, 2024
747586a
[ui] 약관화면 구현
jiwon2724 Jul 13, 2024
298aa85
[chore] string id 수정
jiwon2724 Jul 13, 2024
e0812e7
[chore] adjustResize 속성 추가
jiwon2724 Jul 14, 2024
7149c80
[feature] LoginNavHost 구현
jiwon2724 Jul 15, 2024
d04fc79
[ui] LoginScreen 구현
jiwon2724 Jul 15, 2024
2876a45
[chore] string resource 수정
jiwon2724 Jul 15, 2024
01d627a
[feature] 약관동의 화면 구현
jiwon2724 Jul 15, 2024
81430ed
[ui] 체크박스 디자인시스템 로직 수정
jiwon2724 Jul 15, 2024
0749295
[chore] string resource 추가
jiwon2724 Jul 15, 2024
69a57ca
[ui] 카테고리, 회원가입 완료 화면 추가
jiwon2724 Jul 15, 2024
58e9c05
[chore] 코딩 컨벤션 반영
jiwon2724 Jul 15, 2024
a114d27
[chore] loginbutton 패키지 추가 및 파일 이동
jiwon2724 Jul 16, 2024
410f2fb
[chore] string 및 디자인 resource casting
jiwon2724 Jul 16, 2024
b4cbf0e
Merge branch 'develop' into ui/login-process
jiwon2724 Jul 16, 2024
fb89a58
[chore] 컨벤션 반영
jiwon2724 Jul 16, 2024
c45f875
Merge remote-tracking branch 'origin/ui/login-process' into ui/login-…
jiwon2724 Jul 16, 2024
4f29c30
[chore] 컨벤션 반영
jiwon2724 Jul 16, 2024
5b66434
[chore] Preview 수정
jiwon2724 Jul 16, 2024
44b3f08
[chore] 로그인 버튼 속성 수정
jiwon2724 Jul 17, 2024
f70c017
[chore] 미사용 리소스 제거
jiwon2724 Jul 17, 2024
bd0474a
[chore] padding 속성 수정
jiwon2724 Jul 17, 2024
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
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize"
android:theme="@style/Theme.Pokit">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/pokitmons/pokit/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.login.LoginScreen
import pokitmons.pokit.navigation.LoginNavHost

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
PokitTheme {
LoginScreen()
LoginNavHost()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package pokitmons.pokit.core.ui.components.atom.button.attributes

import androidx.compose.ui.graphics.Color

enum class PokitButtonShape {
ROUND, RECTANGLE,
}
Expand Down Expand Up @@ -28,3 +30,15 @@ data class PokitButtonIcon(
enum class PokitButtonIconPosition {
RIGHT, LEFT,
}

enum class PokitLoginButtonType {
GOOGLE, APPLE
}

data class PokitLoginResource(
val iconResourceId: Int,
val iconTintColor: Color = Color.Unspecified,
val textColor: Color,
val backgroundColor: Color,
val borderColor: Color,
)
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private fun getStrokeColor(
Color.Unspecified
}

!checked -> {
!checked && (style != PokitCheckboxStyle.ICON_ONLY) -> {
PokitTheme.colors.borderSecondary
}

Expand All @@ -134,7 +134,7 @@ private fun getBackgroundColor(
PokitTheme.colors.backgroundDisable
}

!checked -> {
!checked && (style != PokitCheckboxStyle.ICON_ONLY) -> {
PokitTheme.colors.backgroundBase
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package pokitmons.pokit.core.ui.components.atom.loginbutton

import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
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.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
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.res.painterResource
import androidx.compose.ui.unit.dp
import pokitmons.pokit.core.ui.R
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginButtonType
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitLoginResource
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.core.ui.theme.color.Gray200
import pokitmons.pokit.core.ui.theme.color.Gray700
import pokitmons.pokit.core.ui.theme.color.Gray900

@Composable
fun PokitLoginButton(
modifier: Modifier = Modifier,
onClick: () -> Unit,
loginType: PokitLoginButtonType,
text: String,
) {
val loginResource: PokitLoginResource = getLoginResource(loginType)

Surface(
modifier = Modifier
.height(50.dp)
.border(
shape = RoundedCornerShape(8.dp),
width = 1.dp,
color = loginResource.borderColor
),
shape = RoundedCornerShape(8.dp),
color = loginResource.backgroundColor,
onClick = onClick
) {
Row(
modifier = modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center
) {
Icon(
modifier = Modifier
.size(24.dp),
painter = painterResource(id = loginResource.iconResourceId),
tint = loginResource.iconTintColor,
contentDescription = null
)
Text(
modifier = Modifier
.padding(start = 12.dp),
text = text,
color = loginResource.textColor,
style = PokitTheme.typography.label3Regular
)
}
}
}

private fun getLoginResource(loginType: PokitLoginButtonType): PokitLoginResource {
return when (loginType) {
PokitLoginButtonType.APPLE -> PokitLoginResource(
iconResourceId = R.drawable.icon_24_apple,
iconTintColor = Color.White,
textColor = Color.White,
backgroundColor = Gray700,
borderColor = Gray700
)

PokitLoginButtonType.GOOGLE -> PokitLoginResource(
iconResourceId = R.drawable.icon_24_google,
textColor = Gray900,
backgroundColor = Color.White,
borderColor = Gray200
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

색상 지정하는 부분 Pokit.theme.colors 사용하는 방향으로 진행하시면
추후에 다크모드 테마 지원할 때 자동으로 반영될 수 있을 것 같습니다!

Copy link
Member Author

@jiwon2724 jiwon2724 Jul 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

궁금한게 있읍니다.ㅎ

PokitTheme.colors.backgroundBase << 이렇게 사용시
Composable 애노테이션을 추가하라는 린트가 나오는데, 상관이 없을까요~?
일반 함수에서 컴포즈 관련 속성을 사용해서 그런 것 같아요!

일단 빌드는 잘 됩니다 ㅎㅎ

}
3 changes: 3 additions & 0 deletions feature/login/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ dependencies {
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation(libs.androidx.navigation.compose)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
Expand All @@ -81,4 +82,6 @@ dependencies {
implementation(libs.androidx.credentials)
implementation(libs.androidx.credentials.play.services.auth)
implementation(libs.googleid)

implementation(project(":core:ui"))
}
161 changes: 161 additions & 0 deletions feature/login/src/main/java/pokitmons/pokit/keyword/KeywordScreen.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
package pokitmons.pokit.keyword

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import pokitmons.pokit.core.ui.components.atom.button.PokitButton
import pokitmons.pokit.core.ui.components.atom.button.attributes.PokitButtonSize
import pokitmons.pokit.core.ui.components.atom.chip.PokitChip
import pokitmons.pokit.core.ui.components.atom.chip.attributes.PokitChipSize
import pokitmons.pokit.core.ui.theme.PokitTheme
import pokitmons.pokit.core.ui.R as Ui
import pokitmons.pokit.login.R as Login

@Composable
fun KeywordScreen(
onNavigateToSignUpScreen: () -> Unit,
popBackStack: () -> Unit,
) {
Box(
modifier = Modifier
.fillMaxSize()
.padding(all = 20.dp)
.padding(bottom = 8.dp)
) {
Column {
Icon(painter = painterResource(id = Ui.drawable.icon_24_arrow_left), contentDescription = null)
Spacer(modifier = Modifier.height(32.dp))
Text(
text = stringResource(id = Login.string.keyword_title),
style = PokitTheme.typography.title1
)
Spacer(modifier = Modifier.height(12.dp))
Text(
text = stringResource(id = Login.string.select_keyword),
style = PokitTheme.typography.title3
)
Spacer(modifier = Modifier.height(36.dp))

// TODO FlowRow도 사용해보기
Column {
val categories: List<List<String>> = listOf(
stringResource(id = Login.string.sports_and_leisure),
stringResource(id = Login.string.phrases_and_office),
stringResource(id = Login.string.fashion),
stringResource(id = Login.string.travel),
stringResource(id = Login.string.economy_and_politics),
stringResource(id = Login.string.movies_and_dramas),
stringResource(id = Login.string.restaurants),
stringResource(id = Login.string.interior),
stringResource(id = Login.string.it),
stringResource(id = Login.string.design),
stringResource(id = Login.string.self_development),
stringResource(id = Login.string.humor),
stringResource(id = Login.string.music),
stringResource(id = Login.string.job_info)
).chunked(3)

Row {
categories[0].forEach { category ->
PokitChip(
data = null,
size = PokitChipSize.MEDIUM,
text = category,
removeIconPosition = null,
onClickRemove = { },
onClickItem = { }
)
Spacer(modifier = Modifier.padding(start = 12.dp))
}
}

Spacer(modifier = Modifier.height(16.dp))

Row {
categories[1].forEach { category ->
PokitChip(
data = null,
size = PokitChipSize.MEDIUM,
text = category,
removeIconPosition = null,
onClickRemove = { },
onClickItem = { }
)
Spacer(modifier = Modifier.padding(start = 12.dp))
}
}

Spacer(modifier = Modifier.height(16.dp))

Row {
categories[2].forEach { category ->
PokitChip(
data = null,
size = PokitChipSize.MEDIUM,
text = category,
removeIconPosition = null,
onClickRemove = { },
onClickItem = { }
)
Spacer(modifier = Modifier.padding(start = 12.dp))
}
}

Spacer(modifier = Modifier.height(16.dp))

Row {
categories[3].forEach { category ->
PokitChip(
data = null,
size = PokitChipSize.MEDIUM,
text = category,
removeIconPosition = null,
onClickRemove = { },
onClickItem = { }
)
Spacer(modifier = Modifier.padding(start = 12.dp))
}
}

Spacer(modifier = Modifier.height(16.dp))

Row {
categories[4].forEach { category ->
PokitChip(
data = null,
size = PokitChipSize.MEDIUM,
text = category,
removeIconPosition = null,
onClickRemove = { },
onClickItem = { }
)
Spacer(modifier = Modifier.padding(start = 12.dp))
}
}
}
}

PokitButton(
modifier = Modifier
.fillMaxWidth()
.align(Alignment.BottomCenter),
text = stringResource(id = pokitmons.pokit.login.R.string.next),
icon = null,
size = PokitButtonSize.LARGE,
onClick = { onNavigateToSignUpScreen() }
)
}
}
Loading
Loading