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

6/onboarding #10

Merged
merged 30 commits into from
Aug 2, 2022
Merged

6/onboarding #10

merged 30 commits into from
Aug 2, 2022

Conversation

likppi10
Copy link
Contributor

@likppi10 likppi10 commented Aug 1, 2022

0. 화면 이미지


정보 기입 온보딩 화면(왼쪽) 와 검색 결과 화면(오른쪽)


회사 정보가 없는 경우 : 주소 검색 화면(왼쪽) 와 검색 결과 및 회사 등록 화면(오른쪽)


위 둘 중 어느 한 단계를 거치고, 메인으로 넘어가기 위한 로딩 화면 : 로딩 화면

1. 개요

온보딩 화면 구현

2. 작업사항

리싸이클러뷰를 구현함에 있어 xml에서 리사이클러뷰를 구현하듯이 kotlin 단에서도 구현해보려고 합니다.
쉽게 설명해보자면 이전과 달리 리사이클러뷰를 구현하는 아이템 뷰의 설정을 kotlin으로도 구현해준다고 생각하시면 됩니다.

  • 주황색 : 기본적으로 아이템 뷰의 중복과 구분을 위한 DiffUtil 관련 코드입니다.
  • 보라색 : 아이템뷰를 리싸이클러뷰에 바인드 시켜주는 바인딩 어댑터입니다. (items라는 이름으로 이를 구현합니다.)
  • 노랑색 : 재사용 할 리싸이클러뷰 어댑터와 재사용 할 아이템 뷰의 포맷이 되는 코드입니다.
  • 초록색 : 구현하고자 하는 아이템뷰의 속성입니다.

스크린샷 2022-08-01 오후 3 10 08

RecycleItem을 토대로 구현한 SearchResultRecycleModel을 만들어서 (ItemView 관련)
RecycleViewBinding으로 RecycleAdapter에 뷰를 띄우고 (Adapter의 작동)
내부에서 아이템의 구분은 DiffCallback과 RecycleItemComparator로 구분합니다. (item 구분)

스크린샷 2022-08-01 오후 3 33 35
위 그림은 itemView를 설정해 줄 ViewModel에서 표현하고자 하는 데이터 양식을
SearchResultRecycleModel으로 변환하고, 이를 RecycleItem의 포맷으로 변화시키는 2단계를 보여줍니다.

  • 분홍색 : ViewModel에서 최초로 받은 데이터 소스입니다.
  • 민트색 : 이를 현 ViewModel에서 사용하려는 구성인 SearchResultRecycleModel으로 변환합니다.
  • 노란색 : 이를 마지막으로 RecycleItem이라는 RecycleAdapter에서 취급하는 객체로 변환합니다.

RecycleItem과 XXXXRecycleModel의 차이
RecycleItem은 어댑터에 바인딩 하기 위해 필요한 속성을 가집니다. (어떤 데이터를 가지는지, 어떤 레이아웃 아이디에 속하는지 등)
SearchResultRecycleModel은 사용하려는 아이템 뷰의 고유한 속성을 가집니다. (몇개의 무슨 데이터를 가지는지, 어떤 이벤트가 있는지)

3. 변경로직

액티비티에서 만들어서 사용하는 방식의 intent를 일부 액티비티에 적용했습니다.
지난번에 함께 만든 코드가 작동하지 않고 빨간줄이 뜬 이유는 gradle에 parcel 관련 의존성을 추가하지 않았기 때문입니다.

4. 기타

메인 액티비티 관련한 바템네비게이션의 기본 포맷이 나오면 알려주시기 바랍니다.
저는 애플로그인 관련 문서를 작성하고 있겠습니다.

8월 6일 논의 할 것

  • manifest의 intent filter 논의
  • Argument 선언 위치 및 네이밍 정의

likppi10 added 8 commits July 30, 2022 15:40
- 직장 검색화면 구현
- dimen, string, themes 수정
- 리사이클러뷰로 검색결과 구현
- 검색 결과가 없는 경우 이동시킬 버튼 구현
- 이번 커밋에서는 이동만 구현
- 이전에 구현한 화면에 설정한 디자인 값들 설정
- 상태바 글자색 변경 (검정색으로)
- 재사용 할 리사이클러뷰 정의
- 러프하게 화면 구현 (직장 정보 입력, 검색 및 등록 화면 / 로딩화면)
- 상태바 글자색 변경 (검정색으로)
@likppi10 likppi10 self-assigned this Aug 1, 2022
@likppi10 likppi10 added the feature ui 화면 구현 label Aug 1, 2022
…nto 6/onboarding

� Conflicts:
�	app/src/main/AndroidManifest.xml
�	app/src/main/java/com/ftw/hometerview/di/ui/ActivityViewModelModule.kt
�	app/src/main/java/com/ftw/hometerview/ui/main/MainActivity.kt
�	app/src/main/java/com/ftw/hometerview/ui/splash/SplashActivity.kt
�	app/src/main/res/layout/activity_main.xml
�	app/src/main/res/values/dimen.xml
- rough_ui에서 가져온 커밋 conflict 해결
app/src/main/AndroidManifest.xml Show resolved Hide resolved
Comment on lines 8 to 21
override fun areItemsTheSame(
oldItem: RecyclerItem,
newItem: RecyclerItem
): Boolean {
val oldData = oldItem.data
val newData = newItem.data
// Use appropriate comparator's method if both items implement the interface
// and rely on the plain 'equals' otherwise
return if (oldData is RecyclerItemComparator
&& newData is RecyclerItemComparator
) {
oldData.isSameItem(newData)
} else oldData == newData
}
Copy link
Contributor

Choose a reason for hiding this comment

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

RecyclerItemRecyclerItemComparator 를 구현하고 있지 않은데, 이 부분은 왜 추가된걸까?.?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

어댑터에서 아이템의 중복을 DiffUtil로 구분하고 있어요!
그래서 RecyclerItem으로 들어온 아이템들을 구분하는 이 DiffCallback을 어댑터에서 상속해서 아이템간 구분을 구현하고 있는것 같아요!

Copy link
Contributor

Choose a reason for hiding this comment

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

나 잘 이해가 안되었는데.. oldData&newData 가 RecyclerItemComparator 를 구현하고 있어야 의미있는 코드로 보이는데, DiffCallback 을 adapter 에서 상속한다면 어떻게 의미가 바뀌는걸까?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

스크린샷 2022-08-02 오후 3 06 16
RecyclerItem의 데이터를 비교하는 comparator처럼 ListAdapter 내부에서 작동하는 것 같아요!
oldData랑 newData가 다른 객체를 비교하는거라 RecyclerItem가 RecyclerItemComparator를 구현하지 않아도 좋지 않나 싶어요..!

app/src/main/res/layout/activity_loading.xml Outdated Show resolved Hide resolved
likppi10 and others added 15 commits August 2, 2022 12:39
- 메소드 사용부의 변수와 메소드의 파라미터 명이 다를 경우 통일

Co-authored-by: hayley <[email protected]>
- textview, textview2, textview3 ...
- 추가로 lateInit 시점에는 정의되지 않을 수 있기 때문에 nullable 하게 변경
@likppi10 likppi10 merged commit c5000ea into 6/rough_ui Aug 2, 2022
@likppi10 likppi10 deleted the 6/onboarding branch August 2, 2022 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ui 화면 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants