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

[2주차/필수] Android UI 구현 심화 - Compose #6 #8

Merged
merged 13 commits into from
May 3, 2024

Conversation

Hyobeen-Park
Copy link
Collaborator

Related issue 🛠

Work Video ✏️

Screen_Recording_20240419_145957_NOW.SOPT.Android.mp4

Copy link
Member

@Eonji-sw Eonji-sw left a comment

Choose a reason for hiding this comment

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

열심히 잘하셨네요! xml하고도 디자인이 큰 차이가 없어보이네욤 셤 화이팅!!!

titleContentColor = MaterialTheme.colorScheme.primary
),
title = {
Text("NOW SOPT ANDROID")
Copy link
Member

Choose a reason for hiding this comment

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

이 string은 strings 파일에도 있는데 불러올 수 있지 않을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

오호 그러네요!! 감사합니다😊

Comment on lines 49 to 69
Row (
modifier = Modifier
.fillMaxWidth()
.padding(top = 40.dp),
horizontalArrangement = Arrangement.Start
) {
Text(
text = "ID : ",
fontSize = 30.sp,
fontWeight = FontWeight.Bold,
textAlign = TextAlign.Start
)
id?.let {
Text(
text = it,
fontSize = 30.sp,
textAlign = TextAlign.Start,
modifier = Modifier.padding(20.dp, 0.dp)
)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

spanStyle을 사용하면 여러 스타일을 text에 적용할 수 있어요

https://developer.android.com/reference/kotlin/androidx/compose/ui/text/SpanStyle

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

우왕 너무 유용해보이네요 한번 써봐야겠어요ㅎㅎ 링크 공유까지 해주시다니!!! 감사합니다❤️

Copy link
Member

Choose a reason for hiding this comment

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

Fragment를 사용하지 않았는데 해당 파일 네이밍을 지은 의도가 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

어떻게 지어야 할지 모르겠어서 일단 xml때랑 동일하게 지었었는데 Screen으로 수정하는게 좋을 것 같네요!! 감사합니다😊

text = it,
fontSize = 30.sp,
textAlign = TextAlign.Start,
modifier = Modifier.padding(20.dp, 0.dp)
Copy link
Member

Choose a reason for hiding this comment

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

start = 20.dp로 바꿔도 될 것 같아요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아하!!! 감사합니다!!

import androidx.compose.ui.unit.dp

@Composable
fun UserItem(
Copy link
Member

Choose a reason for hiding this comment

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

이 친구는 한 부분에서만 사용되나요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

홈에서 유저 데이터 담을 때랑 친구 데이터 담을 때 사용됩니다!!

Copy link

@seohee0925 seohee0925 left a comment

Choose a reason for hiding this comment

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

크게 수정할 부분은 없어보입니다! 과제 열심히 하신 것같네요 ㅎㅎ
수고 많았어요 👍

intent.getStringExtra("pw"),
intent.getStringExtra("nickname"),
intent.getStringExtra("mbti")
)

Choose a reason for hiding this comment

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

apply 함수 쓰거나 아니면 따로 정보를 가져오는 함수 만들어도 좋을 것같아욤

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아 그러네요!! 한번 함수로 분리해볼게요!! 감사합니다❤️

@Composable
fun HomeFragment(nickname: String?, mbti: String?){
val homeViewModel = HomeViewModel()
val friendsList = homeViewModel.getFriendsData()

Choose a reason for hiding this comment

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

뷰모델로 friend Data 받아오는거 좋은 것같아요

LazyColumn {
item {
nickname?.let {
mbti?.let { it1 ->

Choose a reason for hiding this comment

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

오 람다식에서 변수가 두 개일 경우 파라미터를 it랑 it1로 작성하나요?! 아니면 구분을 하려고 한걸까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

네네!! 반드시 it1로 해야 하는건 아닌데 파라미터를 다르게 해줘야 구분이 가능한걸로 알고 있어요!!! 근데 이부분 너무 가독성이 안 좋은 것 같아서 ?: 로 체크하는걸로 수정했습니다😊😊

@Hyobeen-Park Hyobeen-Park merged commit 5c1da4f into develop-compose May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants