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

Feature/#111 행사 상세 화면 구현 #191

Merged
merged 7 commits into from
Aug 2, 2023

Conversation

chws0508
Copy link
Collaborator

@chws0508 chws0508 commented Aug 2, 2023

#️⃣연관된 이슈

#111

📝작업 내용

행사 상세정보 화면 구현했어요.

스크린샷 (선택)

스크린샷 2023-08-02 오후 4 49 29

예상 소요 시간 및 실제 소요 시간

이슈의 예상 소요 시간과 실제 소요된 시간을 분 or 시간 or 일 단위로 작성해주세요.

ex) 1시간/2시간

💬리뷰 요구사항(선택)

EventDetail 부분만 봐주세요. 너무 아니다 싶은 부분만 리뷰 달아주세요 머지가 시급합니다.
presentation 리뷰 커밋

data 리뷰 커밋

private lateinit var binding: ActivityEventDetailBinding
private val viewModel: EventDetailViewModel by viewModels { EventDetailViewModel.factory }
private val eventId: Long by lazy {
intent.getLongExtra(EVENT_ID_KEY, DEFAULT_EVENT_ID).apply {
Copy link
Collaborator

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.

실수요 ㅎㅎ

Comment on lines +38 to +40
INFORMATION_TAB_POSITION -> tab.text = "상세 정보"
COMMENT_TAB_POSITION -> tab.text = "댓글"
PARTICIPANT_TAB_POSITION -> tab.text = "같이가요"
Copy link
Collaborator

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.

ㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋㅋ

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 com.google.android.material.tabs.TabLayoutMediator

class EventDetailActivity : AppCompatActivity() {
private lateinit var binding: ActivityEventDetailBinding
Copy link
Collaborator

Choose a reason for hiding this comment

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

private val binding: ActivityEventDetailBinding by lazy { ActivityEventDetailBinding.inflate(layoutInflater) }
이렇게 var를 val로 바꿔도 괜찮을 것 같습니다 😄

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

바꿨어용~~~

val eventDetail: LiveData<EventDetailUiState>
get() = _eventDetail

private val _participation: MutableLiveData<Boolean> = MutableLiveData()
Copy link
Collaborator

Choose a reason for hiding this comment

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

타입이 Boolean이라면 participation이라는 명사보다 isParticipated 같은 동사구가 국룰 아닌가요? ❓

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 com.emmsale.R
import com.emmsale.presentation.utils.extension.px

class EventTag : AppCompatCheckBox {
Copy link
Collaborator

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.

저도 급하게 코드를 작성하느라 CheckBox의 checkable 속성을 false로 설정해두고 사용하고 있지만,
선택할 필요가 없는 View이기 때문에 TextView로 변경하는 것이 좋을 것 같습니다 : )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

그렇겠네요 오래 안걸리면 바꿔볼게요

android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:ems="12"
android:text="@{eventDetail.name}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

eventDetail은 EventDetailUiState.Success 타입인데 observable을 구현한 타입이 아니라서 변경을 관찰할 수 없습니다.
나중에 새로고침 기능을 추가한다면 문제가 생길 것 같습니다 😢

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

EventDetail 을 새로고침할 일이 없을 것 같긴 해서... 이 작업은 시간이 오래걸릴 것 같고 논의 해야할 사항이라서 일단은 나중에 더 고려해보겠습니다.

import com.emmsale.data.common.ApiResult

interface EventDetailRepository {
suspend fun fetchEventDetail(eventId: Long): ApiResult<EventDetail>
Copy link
Collaborator

Choose a reason for hiding this comment

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

image

컨벤션에 따르면 반환값이 있으므로 getXxx 네이밍이 맞습니당ㅠㅠ
viewModel에서는 데이터를 불러오는 로직에 반환값이 없으므로 fetchXxx를 사용합니다.

Copy link
Member

Choose a reason for hiding this comment

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

이전에 토마스 PR에도 남긴 리뷰입니다.
위에 남겨주신 리뷰를 조금 더 구체적으로 작성한 예시입니다.

스크린샷 2023-08-02 오후 5 37 27

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이 부분도 사실 다시 고려해 봐야할 것 같아요. viewModel 에서만 fetch를 쓰고 서버에서는 get 을 쓰는게 좀 어색합니다. fetch 가 좀더 서버에서 쓰이는 언어같은데... 일단은 놔두고 다음 회의 때 한번 더 정했으면 좋겠습니다.

Comment on lines 33 to 35
EventDetailUiState.from(
result.data,
),
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.

넵!

@chws0508 chws0508 requested a review from tmdgh1592 August 2, 2023 09:19
@chws0508 chws0508 added the Android 안드로이드 관련 이슈 label Aug 2, 2023
@chws0508 chws0508 added this to the 3차 스프린트 2주차 milestone Aug 2, 2023
@chws0508 chws0508 self-assigned this Aug 2, 2023
@chws0508 chws0508 merged commit 771fff9 into android-main Aug 2, 2023
@amaran-th amaran-th deleted the Feature/#111-행사_상세_화면_구현 branch August 4, 2023 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android 안드로이드 관련 이슈
Projects
Status: Archive
Development

Successfully merging this pull request may close these issues.

3 participants