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

부산대 Android_노신 4주차 Step2 #59

Open
wants to merge 25 commits into
base: normenghub
Choose a base branch
from

Conversation

Normenghub
Copy link

어려웠던 점

멘토님에게 말씀드린 에러 처리를 못했습니다. 코드리뷰후 수정을 거치겠습니다

중점적으로 리뷰해주셨으면 하는 부분

없습니다.

Comment on lines 21 to 23
if (savedInstanceState == null) {
showMapFragment()
}

Choose a reason for hiding this comment

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

savedInstanceState가 없을때만 map fragment를 보여주게 한 이유가 있으신가요? 혹시, 화면회전이나 구성요소변경 상황을 대응하려고 하셨던것일까요?

Copy link
Author

Choose a reason for hiding this comment

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

맞습니다.

Comment on lines 96 to 118
fun searchPlaces(query: String) {
val apiKey = "KakaoAK ${campus.tech.kakao.map.BuildConfig.KAKAO_REST_API_KEY}"

RetrofitClient.instance.searchPlaces(apiKey, query).enqueue(object : Callback<ResultSearchKeyword> {
override fun onResponse(call: Call<ResultSearchKeyword>, response: Response<ResultSearchKeyword>) {
if (response.isSuccessful && response.body() != null) {
val places = response.body()?.documents ?: emptyList()
if (places.isEmpty()) {
showNoResultMessage()
} else {
hideNoResultMessage()
adapter.updateData(places)
}
} else {
showNoResultMessage()
}
}

override fun onFailure(call: Call<ResultSearchKeyword>, t: Throwable) {
showNoResultMessage()
}
})
}

Choose a reason for hiding this comment

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

이 부분은 카카오api를 통해서 장소검색을 수행하는곳 이네요. UI표현, 데이터 조회를 모두 fragment에서 하기 보다는 data를 가져오는곳을 repository로 분리하는것이 좋을것 같습니다. UI 입장에서 어디에서 데이터를 가져오는지 까지 담당할 필요는 없기 때문이죠. 조회가 완료된 형태의 places데이터만 전달받는게 어떨까 합니다.

Copy link
Author

Choose a reason for hiding this comment

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

수정 했습니다.

@Normenghub Normenghub requested a review from LeeOhHyung July 25, 2024 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants