Conversation
| class MainActivity : AppCompatActivity() { | ||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| enableEdgeToEdge() | ||
| setContentView(R.layout.activity_main) | ||
| ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets -> | ||
| val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars()) | ||
| v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom) | ||
| insets | ||
| } | ||
| } | ||
| } No newline at end of file |
| android:layout_width="75dp" | ||
| android:layout_height="75dp" | ||
| android:layout_marginTop="15dp" | ||
| android:contentDescription="행복한 우표" |
There was a problem hiding this comment.
이미지 모두에게 설명을 잘 남겨주셨네요! 굿굿
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="부글부글 화가나요" |
There was a problem hiding this comment.
텍스트랑 컬러 따로 파일 분리해서 관리하면 유지보수에 좋을 거 같아요!! ui 모두 잘 구현하신 거 같아요 수고 많으셨습니다!!
There was a problem hiding this comment.
1주차 미션 완료하시느라 정말 수고 많으셨습니다! 😃 Constraintlayout써주셔서 구현한 부분 아주 좋았어요!
코드 전반적으로 훌륭하게 동작하지만, 더 완성도 높은 안드로이드 프로젝트를 위해 몇 가지 개선하면 좋을 부분들을 리뷰로 남겼습니다. 또한 미션 작업하시기전 이슈를 파놓은 다음에 pr때 연결해주세요!
마지막으로 사진같은 요소들을 올리실때에는 마크다운(Markdown)을 활용하면 훨씬 보기 좋게 작성할 수 있습니다!
ex) 파이프 기호(|)로 칸을 나누고 하이픈(---)으로 두 번째 줄을 구분해 주는 방식
나중에 pr제출하실때 사진이 많다면은 표로 정리해서 올려주세요!
There was a problem hiding this comment.
벡터이미지로 잘 넣어주신거 같습니다! 다만, 파일 이름 앞에 아이콘이면 ic_, 배경이면 bg_, 일반 이미지면 img_ 같은 접두어(prefix)를 붙여주면 나중에 파일이 많아졌을 때 찾기 훨씬 수월해져요! (예: ic_emotion_happy.xml)
| val ivHappy = findViewById<ImageView>(R.id.yellow_happy) | ||
| val tvHappy = findViewById<TextView>(R.id.tv_happy_text) | ||
|
|
There was a problem hiding this comment.
MainActivity를 보면 findViewById가 10번이나 반복되고 있습니다. 요즘 안드로이드 개발에서는 뷰 바인딩(View Binding)을 도입해서 이런 보일러플레이트 코드를 줄이고 Null 안정성을 챙기는 추세입니다! 다음 미션 때 꼭 한번 적용해 보시는 걸 추천해요!
| tvHappy.setTextColor(Color.parseColor("#FFD600")) | ||
| } |
There was a problem hiding this comment.
Color.parseColor("#FFD600") 같은 값들이 하드코딩되어 있습니다
이런 값들을 colors.xml로 분리해 두면, 나중에 다크모드를 대응하거나 텍스트를 수정할 때 한곳에서 관리할 수 있어서 유지보수하기 훨씬 편해져요! 협업할 때도 마찬가지로 다른 팀원이 지정한 색상을 쉽게 가져다 쓸 수 있어 아주 편리합니다! 따라서 다음 부터는 분리해서 미션 부탁드립니다!
| <ImageView | ||
| android:id="@+id/yellow_happy" | ||
| android:layout_width="75dp" | ||
| android:layout_height="75dp" | ||
| android:layout_marginTop="15dp" | ||
| android:contentDescription="행복한 우표" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/tv_description" | ||
| app:srcCompat="@drawable/yellow_happy" /> |
There was a problem hiding this comment.
중요한거는 아니지만! 상단 testview랑 너무 붙어있는거 같아서 피그마 처럼 하려면은 상단에 margin을 조금더 주는것도 좋은 방법일거 같습니다~
| <TextView | ||
| android:id="@+id/tv_subtitle" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="감정 우표를 선택해 주세요" | ||
| android:textSize="18sp" | ||
| android:textColor="@color/black" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/tv_title" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/tv_description" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="16dp" | ||
| android:text="선택한 감정 우표를 기반으로 맞춤형 질문이 배달됩니다" | ||
| android:textSize="14sp" | ||
| android:textColor="#888888" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/tv_subtitle" /> | ||
|
|
||
| <ImageView | ||
| android:id="@+id/yellow_happy" | ||
| android:layout_width="75dp" | ||
| android:layout_height="75dp" | ||
| android:layout_marginTop="15dp" | ||
| android:contentDescription="행복한 우표" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/tv_description" | ||
| app:srcCompat="@drawable/yellow_happy" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/tv_happy_text" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="더없이 행복한 하루였어요" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/yellow_happy" /> | ||
|
|
||
| <ImageView | ||
| android:id="@+id/purple_happy" | ||
| android:layout_width="75dp" | ||
| android:layout_height="75dp" | ||
| android:layout_marginTop="130dp" | ||
| android:contentDescription="들뜬 우표" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintHorizontal_bias="0.498" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/tv_description" | ||
| app:srcCompat="@drawable/purple_happy" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/tv_excited_text" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="들뜨고 흥분돼요" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/purple_happy" /> | ||
|
|
||
| <ImageView | ||
| android:id="@+id/purple_soso" | ||
| android:layout_width="75dp" | ||
| android:layout_height="75dp" | ||
| android:layout_marginTop="245dp" | ||
| android:contentDescription="평범 우표" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintHorizontal_bias="0.508" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/tv_description" | ||
| app:srcCompat="@drawable/purple_soso" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/tv_soso_text" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="평범한 하루였어요" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/purple_soso" /> | ||
|
|
||
| <ImageView | ||
| android:id="@+id/green_sad" | ||
| android:layout_width="75dp" | ||
| android:layout_height="75dp" | ||
| android:layout_marginTop="360dp" | ||
| android:contentDescription="불안 우표" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintHorizontal_bias="0.508" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/tv_description" | ||
| app:srcCompat="@drawable/green_sad" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/tv_green_sad_text" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="생각이 많아지고 불안해요" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/green_sad" /> | ||
|
|
||
| <ImageView | ||
| android:id="@+id/angry_red" | ||
| android:layout_width="75dp" | ||
| android:layout_height="75dp" | ||
| android:layout_marginTop="475dp" | ||
| android:contentDescription="화난 우표" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintHorizontal_bias="0.508" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/tv_description" | ||
| app:srcCompat="@drawable/angry_red" /> | ||
|
|
||
| <TextView | ||
| android:id="@+id/tv_angry_red_text" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="부글부글 화가나요" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:layout_constraintTop_toBottomOf="@+id/angry_red" /> | ||
|
|
||
| </androidx.constraintlayout.widget.ConstraintLayout> No newline at end of file |
There was a problem hiding this comment.
ConstraintLayout으로 구현하신 부분 너무 좋았습니다! 하지만 지금 모든 우표 이미지의 constraintTop이 tv_description에 걸려있고 marginTop을 130dp, 245dp처럼 절대값으로 띄우셨더라고요! 이렇게 하면 기기마다 레이아웃이 깨질 수 있어요
두 번째 우표(purple_happy)의 top은 첫 번째 우표 텍스트(tv_happy_text)의 bottom에 거는 식으로, 위아래 뷰들끼리 꼬리에 꼬리를 무는 상대 위치 방식으로 제약을 변경해 보시면 훨씬 안정적인 UI가 될 거예요!
| android:text="생각이 많아지고 불안해요" | ||
| app:layout_constraintEnd_toEndOf="parent" |
There was a problem hiding this comment.
이런 값들을 res/values/strings.xml로 선언해주고 쓰시면 나중에 텍스트 변경해야 할 때 코드를 일일이 찾아다니며 바꿀 필요 없이 해당 xml 파일 한 곳에서만 싹 수정하면 되기 때문에 훨씬 편리해집니다!
📌 PR 제목
1주차 미션
🔗 관련 이슈
Closes #이슈번호
✨ 변경 사항
우표
우표 클릭 시 글씨 색 변
🔍 테스트
테스트 완료
에러 없음
📸 스크린샷 (선택)
🚨 추가 이슈